556 lines
14 KiB
ObjectPascal
556 lines
14 KiB
ObjectPascal
|
|
unit U_ZdyAttInputCP;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
|||
|
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
|
|||
|
|
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
|||
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
|||
|
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
|||
|
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
|||
|
|
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
|
|||
|
|
cxTextEdit, cxDropDownEdit, strutils, cxCurrencyEdit, cxLookAndFeels,
|
|||
|
|
cxLookAndFeelPainters, cxNavigator;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmZdyAttInputCP = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DS_HZ: TDataSource;
|
|||
|
|
CDS_HZ: TClientDataSet;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
v2Column6: TcxGridDBColumn;
|
|||
|
|
v2Column3: TcxGridDBColumn;
|
|||
|
|
v2Column4: TcxGridDBColumn;
|
|||
|
|
v2Column5: TcxGridDBColumn;
|
|||
|
|
v2Column8: TcxGridDBColumn;
|
|||
|
|
v2Column9: TcxGridDBColumn;
|
|||
|
|
v2Column7: TcxGridDBColumn;
|
|||
|
|
v2Column1: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
v2Column11: TcxGridDBColumn;
|
|||
|
|
v2defstr9: TcxGridDBColumn;
|
|||
|
|
v2Column13: TcxGridDBColumn;
|
|||
|
|
v2Mrate: TcxGridDBColumn;
|
|||
|
|
v2Column15: TcxGridDBColumn;
|
|||
|
|
v2Column2: TcxGridDBColumn;
|
|||
|
|
ToolBar2: TToolBar;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
ToolButton4: TToolButton;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
DS_GC: TDataSource;
|
|||
|
|
CDS_GC: TClientDataSet;
|
|||
|
|
ADOQueryGC: TADOQuery;
|
|||
|
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
|
Tv1Column2: TcxGridDBColumn;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure v2Column6PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2defstr9PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2Column5PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure Tv1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure Initsub();
|
|||
|
|
function SaveData(): Boolean;
|
|||
|
|
public
|
|||
|
|
{ Public declarations }
|
|||
|
|
RKFlag, FCYID, Fzdyname: string;
|
|||
|
|
fkhType: string;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmZdyAttInputCP: TfrmZdyAttInputCP;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_Fun, U_ZDYHelp, U_ZdyAttachGYSxz;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' select * from KH_Zdy_Attachment where ATID=''' + Trim(FCYID) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
Fzdyname := ADOQueryMain.FieldByName('zdyname').AsString;
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.Initsub();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryGC.DisableControls;
|
|||
|
|
with ADOQueryGC do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' select * from KH_CP_JGC where CPname=''' + Trim(CDS_HZ.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryGC, CDS_GC);
|
|||
|
|
SInitCDSData20(ADOQueryGC, CDS_GC);
|
|||
|
|
finally
|
|||
|
|
ADOQueryGC.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZdyAttInputCP := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>1', Tv2, '<27>ͻ<EFBFBD><CDBB>Զ<EFBFBD><D4B6><EFBFBD>');
|
|||
|
|
Close;
|
|||
|
|
ModalResult := 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>1', Tv2, '<27>ͻ<EFBFBD><CDBB>Զ<EFBFBD><D4B6><EFBFBD>');
|
|||
|
|
InitGrid();
|
|||
|
|
Initsub();
|
|||
|
|
if Trim(FCYID) = '' then
|
|||
|
|
begin
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('DEFstr5').Value := '<27><>Ʒ';
|
|||
|
|
// FieldByName('JgcCode').Value := '';
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
// CDS_HZ.Append;
|
|||
|
|
// CDS_HZ.Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmZdyAttInputCP.SaveData(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxId, CRID, maxno: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
if Trim(FCYID) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQueryCmd, maxId, 'AT', 'KH_Zdy_Attachment', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
Result := False;
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxId := Trim(FCYID);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from KH_Zdy_Attachment where ATID=''' + Trim(FCYID) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FCYID) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
|
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
|
|||
|
|
end;
|
|||
|
|
FieldByName('ATID').Value := Trim(maxId);
|
|||
|
|
|
|||
|
|
RTSetSaveDataCDS(ADOQueryCmd, Tv2, CDS_HZ, 'KH_Zdy_Attachment', 0);
|
|||
|
|
FieldByName('ZdyName').Value := Trim(CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
|
FieldByName('ZdyCode').Value := Trim(maxId);
|
|||
|
|
FieldByName('Mrate').Value := CDS_HZ.fieldbyname('Mrate').AsFloat;
|
|||
|
|
FieldByName('defflt1').Value := CDS_HZ.fieldbyname('defflt1').AsFloat;
|
|||
|
|
FieldByName('Type').Value := 'CP';
|
|||
|
|
FieldByName('khType').Value := trim(fkhType);
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from KH_Zdy where ZdyNo=''' + Trim(FCYID) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FCYID) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('ZdyNo').Value := Trim(maxId);
|
|||
|
|
FieldByName('ZdyName').Value := Trim(CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
|
FieldByName('Type').Value := 'CP';
|
|||
|
|
FieldByName('MainType').Value := Trim(CDS_HZ.fieldbyname('DEFstr5').AsString);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from KH_Zdy_Attachment where ZdyName=''' + Trim(CDS_HZ.fieldbyname('ZdyName').AsString) + ''' and DEFstr3=''' + Trim(CDS_HZ.fieldbyname('DEFstr3').AsString) + ''' ');
|
|||
|
|
sql.Add(' and Type=''CP'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryCmd.RecordCount > 1 then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('ATID').Value := Trim(maxId);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
|
|||
|
|
with CDS_GC do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_GC.fieldbyname('Jgcid').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQueryCmd, maxno, 'GC', 'KH_CP_JGC', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxno := Trim(CDS_GC.fieldbyname('Jgcid').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from KH_CP_JGC where CPname=''' + Trim(Fzdyname) + '''');
|
|||
|
|
sql.Add(' and Jgcid=''' + Trim(maxno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_GC.fieldbyname('Jgcid').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
// FieldByName('ATID').Value := Trim(maxId);
|
|||
|
|
FieldByName('Jgcid').Value := Trim(maxno);
|
|||
|
|
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_GC, 'KH_CP_JGC', 0);
|
|||
|
|
FieldByName('CPname').Value := Trim(CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
|
fieldbyname('JgcName').Value := CDS_GC.fieldbyname('JgcName').AsString;
|
|||
|
|
fieldbyname('JgcCode').Value := CDS_GC.fieldbyname('JgcCode').AsString;
|
|||
|
|
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
CDS_GC.Edit;
|
|||
|
|
CDS_GC.FieldByName('Jgcid').Value := Trim(maxno);
|
|||
|
|
// CDS_GC.FieldByName('ATID').Value := Trim(maxId);
|
|||
|
|
FieldByName('CPname').Value := Trim(CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
Result := True;
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.ToolButton3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
cxGrid2.SetFocus;
|
|||
|
|
{ if Trim(CDS_HZ.FieldByName('ZdyName').AsString)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end; }
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
// ModalResult := 1;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' select * from KH_Zdy_Attachment where ATID='' '' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
Fzdyname := ADOQueryMain.FieldByName('zdyname').AsString;
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
Initsub();
|
|||
|
|
if Trim(FCYID) = '' then
|
|||
|
|
begin
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('DEFstr5').Value := '<27><>Ʒ';
|
|||
|
|
// FieldByName('JgcCode').Value := '';
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
// CDS_HZ.Append;
|
|||
|
|
// CDS_HZ.Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.v2Column6PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
|
|||
|
|
if trim(mvalue) = '' then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if rightBstr(trim(mvalue), 1) <> '#' then
|
|||
|
|
begin
|
|||
|
|
mvalue := trim(mvalue) + '#';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('ZdyName').Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
self.tv2.Controller.EditingController.ShowEdit();
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.v2defstr9PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
|
|||
|
|
if trim(mvalue) = '' then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if rightBstr(trim(mvalue), 1) <> '#' then
|
|||
|
|
begin
|
|||
|
|
mvalue := trim(mvalue) + '#';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('ZdyName').Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
self.tv2.Controller.EditingController.ShowEdit();
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.v2Column5PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
|
|||
|
|
if trim(mvalue) = '' then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if rightBstr(trim(mvalue), 1) <> '#' then
|
|||
|
|
begin
|
|||
|
|
mvalue := trim(mvalue) + '#';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('DEFstr3').Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
self.tv2.Controller.EditingController.ShowEdit();
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.ToolButton1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
i: Integer;
|
|||
|
|
begin
|
|||
|
|
// Tv1.Columns[0].FocusWithSelection;
|
|||
|
|
// if Trim(ZdyName.Text) = '' then
|
|||
|
|
// begin
|
|||
|
|
// Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
// Exit;
|
|||
|
|
// end;
|
|||
|
|
// i := CDS_GC.RecordCount;
|
|||
|
|
// i := i + 1;
|
|||
|
|
CDS_GC.Append;
|
|||
|
|
CDS_GC.Post;
|
|||
|
|
// CopyAddRow(Tv1, CDS_GC);
|
|||
|
|
// with CDS_GC do
|
|||
|
|
// begin
|
|||
|
|
// Edit;
|
|||
|
|
//// FieldByName('XHNO').Value := IntToStr(i);
|
|||
|
|
// FieldByName('JgcName').Value := '';
|
|||
|
|
// FieldByName('JgcCode').Value := '';
|
|||
|
|
// Post;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.ToolButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_GC.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
if Trim(CDS_GC.fieldbyname('Jgcid').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete KH_CP_JGC where Jgcid=''' + Trim(CDS_GC.fieldbyname('Jgcid').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
CDS_GC.Delete;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.Tv1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmZdyAttachGYSxz := TfrmZdyAttachGYSxz.Create(Application);
|
|||
|
|
with frmZdyAttachGYSxz do
|
|||
|
|
begin
|
|||
|
|
// fkhType:='';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_GC.Edit;
|
|||
|
|
Self.CDS_GC.FieldByName('JgcName').Value := Trim(CDS_HZ.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZdyAttachGYSxz.Free;
|
|||
|
|
end;
|
|||
|
|
// try
|
|||
|
|
// frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
// with frmZDYHelp do
|
|||
|
|
// begin
|
|||
|
|
// flag := 'JgcName';
|
|||
|
|
// flagname := '<27>ӹ<EFBFBD><D3B9><EFBFBD>';
|
|||
|
|
// if ShowModal = 1 then
|
|||
|
|
// begin
|
|||
|
|
// Self.CDS_GC.Edit;
|
|||
|
|
// Self.CDS_GC.FieldByName('JgcName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
// finally
|
|||
|
|
// frmZDYHelp.Free;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZdyAttInputCP.Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'JgcCode';
|
|||
|
|
flagname := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_GC.Edit;
|
|||
|
|
Self.CDS_GC.FieldByName('JgcCode').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|