2025-01-18 16:22:10 +08:00
unit U_RKSMEdit;
interface
uses
2026-02-05 17:09:07 +08:00
Windows, Messages, strutils, SysUtils, Variants, Classes, Graphics, Controls,
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
2025-01-18 16:22:10 +08:00
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
2026-02-05 17:09:07 +08:00
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
cxGrid, StdCtrls, cxContainer, cxTextEdit, cxCurrencyEdit, BtnEdit, ExtCtrls,
ComCtrls, ToolWin, DBClient, ADODB, MovePanel, MMSystem, cxLookAndFeels,
cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint,
dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
dxSkinscxPCPainter, cxNavigator;
2025-01-18 16:22:10 +08:00
type
TfrmRKSMEdit = class( TForm)
ToolBar1: TToolBar;
TBSave: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
PHYG: TBtnEditA;
defstr2: TComboBox;
Label16: TLabel;
Label15: TLabel;
packNo: TcxCurrencyEdit;
Label14: TLabel;
Label1: TLabel;
Panel2: TPanel;
cxGrid2: TcxGrid;
TV2: TcxGridDBTableView;
cxGridDBColumn1: TcxGridDBColumn;
cxGridDBColumn2: TcxGridDBColumn;
cxGridDBColumn3: TcxGridDBColumn;
cxGridDBColumn4: TcxGridDBColumn;
cxGridDBColumn5: TcxGridDBColumn;
cxGridDBColumn6: TcxGridDBColumn;
cxGridDBColumn7: TcxGridDBColumn;
cxGridLevel1: TcxGridLevel;
ADOQueryMain: TADOQuery;
ADOQueryCmd: TADOQuery;
CDSMJID: TClientDataSet;
DataSource2: TDataSource;
SmNO: TEdit;
ADOQueryTmp: TADOQuery;
V2Column1: TcxGridDBColumn;
kcKw: TBtnEditA;
Label5: TLabel;
MovePanel1: TMovePanel;
Edit2: TEdit;
Button4: TButton;
Label2: TLabel;
cxStyleRepository1: TcxStyleRepository;
cxStyle1: TcxStyle;
cxStyle2: TcxStyle;
cxStyle_gridRow: TcxStyle;
cxStyle_gridFoot: TcxStyle;
cxStyle_gridHead: TcxStyle;
cxStyle_gridGroupBox: TcxStyle;
cxStyle_yellow: TcxStyle;
cxStyle_Red: TcxStyle;
cxStyle_fontBlack: TcxStyle;
cxStyle_fontclFuchsia: TcxStyle;
cxStyle_fontclPurple: TcxStyle;
cxStyle_fontclGreen: TcxStyle;
cxStyle_fontclBlue: TcxStyle;
cxStyle_fontclTeal: TcxStyle;
cxStyle_fontclOlive: TcxStyle;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
v1Column4: TcxGridDBColumn;
v1Column5: TcxGridDBColumn;
v1Column6: TcxGridDBColumn;
v1Column7: TcxGridDBColumn;
v1Column8: TcxGridDBColumn;
v1Column9: TcxGridDBColumn;
v1Column10: TcxGridDBColumn;
v1Column16: TcxGridDBColumn;
v1Column15: TcxGridDBColumn;
cxGrid2Level1: TcxGridLevel;
ADOQuery1: TADOQuery;
DataSource1: TDataSource;
cxGrid3: TcxGrid;
Tv3: TcxGridDBTableView;
cxGridLevel2: TcxGridLevel;
Tv3Column1: TcxGridDBColumn;
ADOQueryTm: TADOQuery;
DSTm: TDataSource;
procedure FormDestroy( Sender: TObject) ;
procedure FormClose( Sender: TObject; var Action: TCloseAction) ;
procedure TBCloseClick( Sender: TObject) ;
procedure FormCreate( Sender: TObject) ;
procedure SmNOKeyPress( Sender: TObject; var Key: Char ) ;
procedure FormShow( Sender: TObject) ;
2026-02-05 17:09:07 +08:00
procedure TV2CustomDrawCell( Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean ) ;
2025-01-18 16:22:10 +08:00
procedure kcKwBtnClick( Sender: TObject) ;
procedure Button4Click( Sender: TObject) ;
private
procedure InitGrid( ) ;
procedure InitMJID( ) ;
2026-02-05 17:09:07 +08:00
function SaveRK( ) : Boolean ;
procedure QueryRk( ) ;
procedure QueryTM( ) ;
2025-01-18 16:22:10 +08:00
{ Private declarations }
public
{ Public declarations }
end ;
var
frmRKSMEdit: TfrmRKSMEdit;
implementation
2026-02-05 17:09:07 +08:00
2025-01-18 16:22:10 +08:00
uses
2026-02-05 17:09:07 +08:00
U_DataLink, U_Fun, U_UserHelp, U_ZDYHelp;
2025-01-18 16:22:10 +08:00
{$R *.dfm}
2026-02-05 17:09:07 +08:00
procedure TfrmRKSMEdit. QueryTm( ) ;
2025-01-18 16:22:10 +08:00
begin
with ADOQueryTM do
begin
close;
sql. Clear;
sql. Add( 'select TOP 50 MJID' ) ;
sql. Add( 'from WFB_MJJY A ' ) ;
2026-02-05 17:09:07 +08:00
SQL. Add( 'WHERE exists(select MJID from WFB_MJJY X where X.APID=A.APID and X.MJID=' + quotedstr( trim( smNO. Text ) ) ) ;
2025-01-18 16:22:10 +08:00
sql. Add( ') and A.mjstr2=' 'δ<> <CEB4> <EFBFBD> <EFBFBD> ' ' ' ) ;
open;
end ;
end ;
2026-02-05 17:09:07 +08:00
procedure TfrmRKSMEdit. QueryRk( ) ;
2025-01-18 16:22:10 +08:00
begin
with ADOQuery1 do
begin
close;
sql. Clear;
sql. Add( 'select A.*,hC_ps=A.AordQty2,JY_ps=(select count(MainID) from WFB_MJJY X where X.APID=A.APID),' ) ;
sql. Add( 'JY_Qty=(select sum(MJLen) from WFB_MJJY X where X.APID=A.APID), ' ) ;
sql. Add( 'RK_RollNum=(select sum(RollNum) from CK_BanCP_CR X where X.APID=A.APID and X.CRType=' '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' '),' ) ;
sql. Add( 'RK_Qty=(select sum(Qty) from CK_BanCP_CR X where X.APID=A.APID and X.CRType=' '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ') ' ) ;
sql. Add( 'from JYOrder_sub_anPai A ' ) ;
2026-02-05 17:09:07 +08:00
SQL. Add( 'WHERE exists(select MJID from WFB_MJJY X where X.APID=A.APID and X.MJID=' + quotedstr( trim( smNO. Text ) ) ) ;
2025-01-18 16:22:10 +08:00
sql. Add( ')' ) ;
open;
end ;
end ;
2026-02-05 17:09:07 +08:00
function TfrmRKSMEdit. SaveRK( ) : Boolean ;
2025-01-18 16:22:10 +08:00
var
2026-02-05 17:09:07 +08:00
maxno: string ;
CRID: Integer ;
MaxCkNo, MaxCkSubNo: string ;
MhcTime: TdateTime;
2025-01-18 16:22:10 +08:00
begin
2026-02-05 17:09:07 +08:00
Result : = false ;
2025-01-18 16:22:10 +08:00
ADOQueryCmd. Connection. BeginTrans;
try
2026-02-05 17:09:07 +08:00
with ADOQueryTmp do
2025-01-18 16:22:10 +08:00
begin
Close;
sql. Clear;
SQL. add( 'Update CK_BanCP_CRID Set CRID=CRID+1' ) ;
sql. Add( 'select * from CK_BanCP_CRID' ) ;
Open;
end ;
2026-02-05 17:09:07 +08:00
CRID : = ADOQueryTmp. fieldbyname( 'CRID' ) . AsInteger;
if GetLSNo( ADOQueryTmp, MaxCkNo, 'JR' , 'CK_BanCP_CR' , 5 , 1 ) = False then
2025-01-18 16:22:10 +08:00
begin
ADOQueryCmd. Connection. RollbackTrans;
2026-02-05 17:09:07 +08:00
Application. MessageBox( 'ȡ<> <C8A1> Ʒ <EFBFBD> ֿ<EFBFBD> <D6BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> ܣ<EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
2025-01-18 16:22:10 +08:00
Exit;
end ;
2026-02-05 17:09:07 +08:00
with ADOQueryCmd do
begin
Close;
sql. Clear;
sql. Add( 'select * from CK_BanCP_CR where 1<>1' ) ;
Open;
end ;
2025-01-18 16:22:10 +08:00
{ with ADOQueryTmp do
begin
close;
sql. Clear;
sql. Add( 'select * from JYOrder_Sub_AnPai ' ) ;
sql. Add( ' where APID=' + quotedstr( trim( ADOQueryMain. fieldbyname( 'APID' ) . AsString) ) ) ;
open;
IF not ADOQueryTmp. IsEmpty then
begin
mhcTime: = ADOQueryTmp. fieldbyname( 'ADefDate1' ) . AsDateTime;
end
else
begin
mhcTime: = date( ) ;
end ;
end ; }
2026-02-05 17:09:07 +08:00
MhcTime : = SGetServerDateTime( ADOQueryTmp) ;
2025-01-18 16:22:10 +08:00
2026-02-05 17:09:07 +08:00
with ADOQueryCmd do
begin
Append;
FieldByName( 'MainId' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'MainId' ) . AsString) ;
FieldByName( 'SubId' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'SubId' ) . AsString) ;
FieldByName( 'C_Code' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'C_Code' ) . AsString) ;
FieldByName( 'C_CodeName' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'C_CodeName' ) . AsString) ;
FieldByName( 'C_SPec' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'C_SPec' ) . AsString) ;
FieldByName( 'C_Color' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'C_Color' ) . AsString) ;
FieldByName( 'APID' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'APID' ) . AsString) ;
FieldByName( 'MJID' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'MJId' ) . AsString) ;
FieldByName( 'mjxh' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'mjxh' ) . AsString) ;
FieldByName( 'BCGangNO' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'BCGangNO' ) . AsString) ;
FieldByName( 'RCGangNO' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'RCGangNO' ) . AsString) ;
FieldByName( 'BCID' ) . Value : = Trim( MaxCkNo) ;
FieldByName( 'CRTime' ) . Value : = FormatDateTime( 'yyyy-MM-dd' , MhcTime) ;
FieldByName( 'CRFlag' ) . Value : = '<27> <> <EFBFBD> <EFBFBD> ' ;
FieldByName( 'CRType' ) . Value : = '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ;
FieldByName( 'CRID' ) . Value : = CRID;
FieldByName( 'KGQty' ) . Value : = 0 ;
FieldByName( 'Qty' ) . Value : = ADOQueryMain. fieldbyname( 'MJLen' ) . Value;
FieldByName( 'RollNum' ) . Value : = 1 ;
FieldByName( 'QtyUnit' ) . Value : = ADOQueryMain. fieldbyname( 'MJTypeOther' ) . Value;
FieldByName( 'CPType' ) . Value : = ADOQueryMain. fieldbyname( 'MJType' ) . Value;
FieldByName( 'Note' ) . Value : = ADOQueryMain. fieldbyname( 'Note' ) . Value;
FieldByName( 'Filler' ) . Value : = Trim( DName) ;
FieldByName( 'FillTime' ) . Value : = SGetServerDateTime( ADOQueryTmp) ;
2025-01-18 16:22:10 +08:00
// FieldByName('kcKw').Value:=Trim(kcKw.Text);
2026-02-05 17:09:07 +08:00
fieldbyname( 'kcKw' ) . Value : = GetKw( ADOQueryTmp, ADOQueryMain. fieldbyname( 'C_CodeName' ) . AsString, ADOQueryMain. fieldbyname( 'C_Color' ) . AsString) ;
Post;
end ;
2025-01-18 16:22:10 +08:00
2026-02-05 17:09:07 +08:00
with ADOQueryCmd do
begin
Close;
sql. Clear;
sql. Add( 'select * from CK_BanCP_KC where 1<>1' ) ;
Open;
end ;
with ADOQueryCmd do
begin
Append;
FieldByName( 'CRID' ) . Value : = CRID;
FieldByName( 'BCID' ) . Value : = Trim( MaxCkNo) ;
FieldByName( 'CRTime' ) . Value : = FormatDateTime( 'yyyy-MM-dd' , MhcTime) ;
FieldByName( 'CRType' ) . Value : = '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ;
FieldByName( 'CPType' ) . Value : = ADOQueryMain. fieldbyname( 'MJType' ) . Value;
FieldByName( 'C_Code' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'C_Code' ) . AsString) ;
FieldByName( 'C_CodeName' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'C_CodeName' ) . AsString) ;
FieldByName( 'C_SPec' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'C_SPec' ) . AsString) ;
FieldByName( 'C_Color' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'C_Color' ) . AsString) ;
FieldByName( 'BCGangNO' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'BCGangNO' ) . AsString) ;
FieldByName( 'RCGangNO' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'RCGangNO' ) . AsString) ;
FieldByName( 'MJID' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'MJID' ) . AsString) ;
FieldByName( 'KCKGQty' ) . Value : = 0 ;
FieldByName( 'KCQty' ) . Value : = ADOQueryMain. fieldbyname( 'MJlen' ) . Value;
FieldByName( 'KCRollNum' ) . Value : = 1 ;
FieldByName( 'KCQtyUnit' ) . Value : = ADOQueryMain. fieldbyname( 'MJTypeOther' ) . Value;
FieldByName( 'mjxh' ) . Value : = Trim( ADOQueryMain. fieldbyname( 'mjxh' ) . AsString) ;
FieldByName( 'KCNote' ) . Value : = ADOQueryMain. fieldbyname( 'Note' ) . Value;
2025-01-18 16:22:10 +08:00
// FieldByName('kcKw').Value:=Trim(kcKw.Text);
2026-02-05 17:09:07 +08:00
fieldbyname( 'kcKw' ) . Value : = GetKw( ADOQueryTmp, ADOQueryMain. fieldbyname( 'C_CodeName' ) . AsString, ADOQueryMain. fieldbyname( 'C_Color' ) . AsString) ;
Post;
end ;
with ADOQueryCmd do
begin
Close;
sql. Clear;
sql. Add( 'Update WFB_MJJY Set MJStr2=' '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ' where MJID=' '' + Trim( ADOQueryMain. fieldbyname( 'MJID' ) . AsString) + '' '' ) ;
ExecSQL;
end ;
2025-01-18 16:22:10 +08:00
ADOQueryCmd. Connection. CommitTrans;
2026-02-05 17:09:07 +08:00
Result : = true ;
2025-01-18 16:22:10 +08:00
except
ADOQueryCmd. Connection. RollbackTrans;
end ;
end ;
procedure TfrmRKSMEdit. InitGrid( ) ;
begin
with ADOQueryMain do
begin
Close;
sql. Clear;
SQL. Add( 'select A.* from CK_BanCP_CR A ' ) ;
SQL. Add( 'where 1=2 ' ) ;
Open;
end ;
2026-02-05 17:09:07 +08:00
SCreateCDS20( ADOQueryMain, CDSMJID) ;
SInitCDSData20( ADOQueryMain, CDSMJID) ;
2025-01-18 16:22:10 +08:00
end ;
procedure TfrmRKSMEdit. InitMJID( ) ;
begin
2026-02-05 17:09:07 +08:00
MovePanel1. Visible : = false ;
2025-01-18 16:22:10 +08:00
with ADOQueryMain do
begin
Close;
sql. Clear;
SQL. Add( 'select A.* from WFB_MJJY A' ) ;
2026-02-05 17:09:07 +08:00
sql. Add( 'where MJID=' + quotedstr( trim( SmNO. Text ) ) ) ;
2025-01-18 16:22:10 +08:00
Open;
2026-02-05 17:09:07 +08:00
if not IsEmpty then
2025-01-18 16:22:10 +08:00
begin
2026-02-05 17:09:07 +08:00
if trim( Fieldbyname( 'MJstr2' ) . AsString) = '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' then
2025-01-18 16:22:10 +08:00
begin
CDSMJID. Append;
2026-02-05 17:09:07 +08:00
CDSMJID. FieldByName( 'SDefNote' ) . Value : = '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ;
CDSMJID. FieldByName( 'MJID' ) . Value : = trim( SmNO. Text ) ;
2025-01-18 16:22:10 +08:00
CDSMJID. Post;
2026-02-05 17:09:07 +08:00
if FileExists( PChar( ExtractFilePath( Application. ExeName) + 'wav\<5C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .wav' ) ) then
PlaySound( PChar( ExtractFilePath( Application. ExeName) + 'wav\<5C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .wav' ) , 0 , SND_ASYNC) ;
2025-01-18 16:22:10 +08:00
end
else
begin
2026-02-05 17:09:07 +08:00
if saveRk( ) then
2025-01-18 16:22:10 +08:00
begin
2026-02-05 17:09:07 +08:00
CDSMJID. Append;
CDSMJID. FieldByName( 'SDefNote' ) . Value : = '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> ' ;
CDSMJID. FieldByName( 'MJID' ) . Value : = trim( ADOQueryMain. Fieldbyname( 'MJID' ) . AsString) ;
2025-01-18 16:22:10 +08:00
// CDSMJID.FieldByName('CRID').Value:=trim(ADOQueryMain.Fieldbyname('CRID').AsString);
2026-02-05 17:09:07 +08:00
CDSMJID. FieldByName( 'C_CodeName' ) . Value : = trim( ADOQueryMain. Fieldbyname( 'C_CodeName' ) . AsString) ;
CDSMJID. FieldByName( 'C_Color' ) . Value : = trim( ADOQueryMain. Fieldbyname( 'C_Color' ) . AsString) ;
CDSMJID. FieldByName( 'CPType' ) . Value : = trim( ADOQueryMain. Fieldbyname( 'MJType' ) . AsString) ;
CDSMJID. FieldByName( 'RollNum' ) . Value : = 1 ;
CDSMJID. FieldByName( 'Qty' ) . Value : = ADOQueryMain. Fieldbyname( 'MJLen' ) . AsFloat;
CDSMJID. FieldByName( 'QtyUnit' ) . Value : = trim( ADOQueryMain. Fieldbyname( 'MJTypeOther' ) . AsString) ;
CDSMJID. FieldByName( 'mainID' ) . Value : = trim( ADOQueryMain. Fieldbyname( 'mainID' ) . AsString) ;
CDSMJID. FieldByName( 'subID' ) . Value : = trim( ADOQueryMain. Fieldbyname( 'subID' ) . AsString) ;
CDSMJID. FieldByName( 'RCGangNO' ) . Value : = trim( ADOQueryMain. Fieldbyname( 'RCGangNO' ) . AsString) ;
CDSMJID. FieldByName( 'BCgangNO' ) . Value : = trim( ADOQueryMain. Fieldbyname( 'BCgangNO' ) . AsString) ;
CDSMJID. Post;
QueryRk( ) ;
QueryTm( ) ;
with ADOQueryTM do
begin
close;
sql. Clear;
sql. Add( 'select count(*) PS' ) ;
sql. Add( 'from WFB_MJJY A ' ) ;
SQL. Add( 'WHERE exists(select MJID from WFB_MJJY X where X.APID=A.APID and X.MJID=' + quotedstr( trim( smNO. Text ) ) ) ;
sql. Add( ') and A.mjstr2=' 'δ<> <CEB4> <EFBFBD> <EFBFBD> ' ' ' ) ;
open;
end ;
if ADOQueryTM. FieldByName( 'PS' ) . AsInteger > 0 then
begin
if FileExists( PChar( ExtractFilePath( Application. ExeName) + 'wav\<5C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʣ<EFBFBD> <CAA3> .wav' ) ) then
PlaySound( PChar( ExtractFilePath( Application. ExeName) + 'wav\<5C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʣ<EFBFBD> <CAA3> .wav' ) , 0 , SND_ASYNC) ;
end
else
begin
if FileExists( PChar( ExtractFilePath( Application. ExeName) + 'wav\<5C> <> <EFBFBD> <EFBFBD> .wav' ) ) then
PlaySound( PChar( ExtractFilePath( Application. ExeName) + 'wav\<5C> <> <EFBFBD> <EFBFBD> .wav' ) , 0 , SND_ASYNC) ;
end ;
// if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\<5C> <> ȷ.wav')) then
// PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\<5C> <> ȷ.wav'), 0, SND_ASYNC);
2025-01-18 16:22:10 +08:00
end
else
begin
CDSMJID. Append;
2026-02-05 17:09:07 +08:00
CDSMJID. FieldByName( 'SDefNote' ) . Value : = '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> ' ;
CDSMJID. FieldByName( 'MJID' ) . Value : = trim( SmNO. Text ) ;
2025-01-18 16:22:10 +08:00
CDSMJID. Post;
2026-02-05 17:09:07 +08:00
if FileExists( PChar( ExtractFilePath( Application. ExeName) + 'wav\<5C> <> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> .wav' ) ) then
PlaySound( PChar( ExtractFilePath( Application. ExeName) + 'wav\<5C> <> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> .wav' ) , 0 , SND_ASYNC) ;
2025-01-18 16:22:10 +08:00
end ;
end ;
end
else
begin
CDSMJID. Append;
2026-02-05 17:09:07 +08:00
CDSMJID. FieldByName( 'SDefNote' ) . Value : = '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> 벻<EFBFBD> <EBB2BB> <EFBFBD> <EFBFBD> ' ;
CDSMJID. FieldByName( 'MJID' ) . Value : = trim( SmNO. Text ) ;
2025-01-18 16:22:10 +08:00
CDSMJID. Post;
2026-02-05 17:09:07 +08:00
if FileExists( PChar( ExtractFilePath( Application. ExeName) + 'wav\ɨ<> <C9A8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .wav' ) ) then
PlaySound( PChar( ExtractFilePath( Application. ExeName) + 'wav\ɨ<> <C9A8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .wav' ) , 0 , SND_ASYNC) ;
2025-01-18 16:22:10 +08:00
end ;
end ;
2026-02-05 17:09:07 +08:00
if trim( CDSMJID. FieldByName( 'SDefNote' ) . AsString) < > '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> ' then
2025-01-18 16:22:10 +08:00
begin
2026-02-05 17:09:07 +08:00
MovePanel1. Visible : = true ;
Edit2. Text : = SmNO. Text ;
Label2. Caption : = trim( CDSMJID. FieldByName( 'SDefNote' ) . AsString) ;
2025-01-18 16:22:10 +08:00
end ;
end ;
procedure TfrmRKSMEdit. FormDestroy( Sender: TObject) ;
begin
2026-02-05 17:09:07 +08:00
frmRKSMEdit : = nil ;
2025-01-18 16:22:10 +08:00
end ;
2026-02-05 17:09:07 +08:00
procedure TfrmRKSMEdit. FormClose( Sender: TObject; var Action: TCloseAction) ;
2025-01-18 16:22:10 +08:00
begin
2026-02-05 17:09:07 +08:00
writeCxGrid( self. Caption + tv1. Name , Tv1, '<27> <> Ʒ <EFBFBD> ֿ<EFBFBD> ' ) ;
writeCxGrid( self. Caption + Tv2. Name , Tv2, '<27> <> Ʒ <EFBFBD> ֿ<EFBFBD> ' ) ;
writeCxGrid( self. Caption + Tv3. Name , Tv3, '<27> <> Ʒ <EFBFBD> ֿ<EFBFBD> ' ) ;
Action : = cahide;
2025-01-18 16:22:10 +08:00
end ;
procedure TfrmRKSMEdit. TBCloseClick( Sender: TObject) ;
begin
close;
end ;
procedure TfrmRKSMEdit. FormCreate( Sender: TObject) ;
begin
2026-02-05 17:09:07 +08:00
Panel2. Align : = alClient;
readCxGrid( self. Caption + tv1. Name , Tv1, '<27> <> Ʒ <EFBFBD> ֿ<EFBFBD> ' ) ;
readCxGrid( self. Caption + Tv2. Name , Tv2, '<27> <> Ʒ <EFBFBD> ֿ<EFBFBD> ' ) ;
readCxGrid( self. Caption + Tv3. Name , Tv3, '<27> <> Ʒ <EFBFBD> ֿ<EFBFBD> ' ) ;
2025-01-18 16:22:10 +08:00
end ;
procedure TfrmRKSMEdit. SmNOKeyPress( Sender: TObject; var Key: Char ) ;
begin
2026-02-05 17:09:07 +08:00
if Key = #13 then
2025-01-18 16:22:10 +08:00
begin
2026-02-05 17:09:07 +08:00
if trim( smno. Text ) = '' then
exit;
2025-01-18 16:22:10 +08:00
initMJID( ) ;
2026-02-05 17:09:07 +08:00
smno. Text : = '' ;
2025-01-18 16:22:10 +08:00
smno. SetFocus;
end ;
end ;
procedure TfrmRKSMEdit. FormShow( Sender: TObject) ;
begin
2026-02-05 17:09:07 +08:00
MovePanel1. Left : = ( Width - MovePanel1. Width) div 2 ;
MovePanel1. top : = ( Height - MovePanel1. Height - 2 0 0 ) div 2 ;
2025-01-18 16:22:10 +08:00
InitGrid( ) ;
end ;
2026-02-05 17:09:07 +08:00
procedure TfrmRKSMEdit. TV2CustomDrawCell( Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean ) ;
2025-01-18 16:22:10 +08:00
var
2026-02-05 17:09:07 +08:00
i: integer ;
2025-01-18 16:22:10 +08:00
begin
2026-02-05 17:09:07 +08:00
i : = tv2. GetColumnByFieldName( 'SDefNote' ) . Index ;
if ( AViewInfo. GridRecord. Values[ i] < > '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> ' ) then
ACanvas. Brush. Color : = clred;
2025-01-18 16:22:10 +08:00
end ;
procedure TfrmRKSMEdit. kcKwBtnClick( Sender: TObject) ;
begin
try
2026-02-05 17:09:07 +08:00
frmZDYHelp : = TfrmZDYHelp. Create( Application) ;
2025-01-18 16:22:10 +08:00
with frmZDYHelp do
begin
2026-02-05 17:09:07 +08:00
flag : = 'CPKWFlag' ;
flagname : = '<27> <> λ<EFBFBD> <CEBB> Ϣ' ;
V1Name. Caption : = '<27> <> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> ' ;
V1Note. Caption : = 'Ӣ<> <D3A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ;
2025-01-18 16:22:10 +08:00
// MainType:=Trim(DName);
2026-02-05 17:09:07 +08:00
fnote : = FALSE ;
if ShowModal = 1 then
2025-01-18 16:22:10 +08:00
begin
2026-02-05 17:09:07 +08:00
kcKw. Text : = Trim( ClientDataSet1. fieldbyname( 'ZDYName' ) . AsString) ;
2025-01-18 16:22:10 +08:00
end ;
end ;
finally
frmZDYHelp. Free;
end ;
end ;
procedure TfrmRKSMEdit. Button4Click( Sender: TObject) ;
begin
2026-02-05 17:09:07 +08:00
MovePanel1. Visible : = False ;
2025-01-18 16:22:10 +08:00
SmNO. SetFocus;
end ;
end .
2026-02-05 17:09:07 +08:00