2026-03-04 09:51:44 +08:00
|
|
|
|
unit U_BuDongKCInPut;
|
|
|
|
|
|
|
|
|
|
|
|
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, cxLookAndFeels, cxLookAndFeelPainters,
|
2026-03-04 13:44:13 +08:00
|
|
|
|
cxNavigator, 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;
|
2026-03-04 09:51:44 +08:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmBuDongKCInPut = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ADOQueryMain: TADOQuery;
|
|
|
|
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|
|
|
|
|
DS_HZ: TDataSource;
|
|
|
|
|
|
CDS_HZ: TClientDataSet;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
|
|
|
|
|
cxGrid2: TcxGrid;
|
|
|
|
|
|
Tv2: TcxGridDBTableView;
|
|
|
|
|
|
v2Column2: TcxGridDBColumn;
|
|
|
|
|
|
Tv2Column4: TcxGridDBColumn;
|
|
|
|
|
|
v2Column6: TcxGridDBColumn;
|
|
|
|
|
|
v2Column11: TcxGridDBColumn;
|
|
|
|
|
|
v2Column3: TcxGridDBColumn;
|
|
|
|
|
|
v2Column4: TcxGridDBColumn;
|
|
|
|
|
|
v2Column1: TcxGridDBColumn;
|
|
|
|
|
|
v2Column7: TcxGridDBColumn;
|
|
|
|
|
|
Tv2Column1: TcxGridDBColumn;
|
|
|
|
|
|
Tv2Column2: TcxGridDBColumn;
|
|
|
|
|
|
Tv2Column5: TcxGridDBColumn;
|
|
|
|
|
|
Tv2Column6: TcxGridDBColumn;
|
|
|
|
|
|
Tv2Column7: TcxGridDBColumn;
|
|
|
|
|
|
Tv2Column8: TcxGridDBColumn;
|
|
|
|
|
|
Tv2Column9: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel1: TcxGridLevel;
|
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
|
ToolButton2: TToolButton;
|
|
|
|
|
|
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 ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
procedure Tv2Column7PropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
procedure Tv2Column8PropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
procedure ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
private
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
FDate:TDateTime;
|
|
|
|
|
|
procedure InitGrid();
|
|
|
|
|
|
function SaveData(): Boolean;
|
|
|
|
|
|
public
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
RKFlag, FCYID: string;
|
|
|
|
|
|
fDEFstr5: string;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmBuDongKCInPut: TfrmBuDongKCInPut;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
U_DataLink, U_RTFun, U_ZDYHelp;
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.InitGrid();
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryMain.DisableControls;
|
|
|
|
|
|
with ADOQueryMain do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Filtered := False;
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add(' select * from CP_BuDong where CBID=''' + Trim(FCYID) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|
|
|
|
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|
|
|
|
|
finally
|
|
|
|
|
|
ADOQueryMain.EnableControls;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.FormDestroy(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
frmBuDongKCInPut := nil;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Action := caFree;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
WriteCxGrid('<27><>Ʒ<EFBFBD><C6B7>Ϣ¼<CFA2><C2BC>', Tv2, '<27>ͻ<EFBFBD><CDBB>Զ<EFBFBD><D4B6><EFBFBD>');
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
FDate:=SGetServerDate(ADOQueryTemp);
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
if Trim(FCYID) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
CDS_HZ.Append;
|
|
|
|
|
|
CDS_HZ.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.TBRafreshClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmBuDongKCInPut.SaveData(): Boolean;
|
|
|
|
|
|
var
|
|
|
|
|
|
maxId: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
|
CDS_HZ.DisableControls;
|
|
|
|
|
|
with CDS_HZ do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from CP_BuDong where CBID='''+Trim(CDS_HZ.fieldbyname('CBID').AsString)+'''');
|
|
|
|
|
|
open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
FCYID:=Trim(ADOQueryCmd.fieldbyname('CBID').AsString);
|
|
|
|
|
|
if Trim(FCYID) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOQueryCmd, maxId, 'CB', 'CP_BuDong', 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 CP_BuDong where CBID=''' + Trim(FCYID) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(FCYID) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('FillerCode').Value := Trim(DCode);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('EditerCode').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('CBID').Value := Trim(maxId);
|
|
|
|
|
|
RTSetSaveDataCDS(ADOQueryCmd, Tv2, CDS_HZ, 'CP_BuDong', 0);
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('CBID').Value := Trim(maxId);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
|
CDS_HZ.EnableControls;
|
|
|
|
|
|
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
Result := False;
|
|
|
|
|
|
CDS_HZ.EnableControls;
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxGrid2.SetFocus;
|
|
|
|
|
|
if CDS_HZ.Locate('SPName',Null,[]) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if CDS_HZ.Locate('CRTime',Null,[]) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if CDS_HZ.Locate('WeiZhi',Null,[]) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('λ<>ò<EFBFBD><C3B2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if CDS_HZ.Locate('ColorName',Null,[]) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if CDS_HZ.Locate('PS',Null,[]) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('ƥ<><C6A5><EFBFBD><EFBFBD><EFBFBD><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;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_HZ do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('CRTime').Value:=FDate;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.Tv2Column7PropertiesButtonClick(
|
|
|
|
|
|
Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'YWY';
|
|
|
|
|
|
flagname := 'ҵ<><D2B5>Ա';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Self.CDS_HZ do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('YWY').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.Tv2Column8PropertiesButtonClick(
|
|
|
|
|
|
Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'LiDan';
|
|
|
|
|
|
flagname := '<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Self.CDS_HZ do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('LiDan').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBuDongKCInPut.ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_HZ.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(CDS_HZ.fieldbyname('CBId').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 CP_BuDong where CBId=''' + Trim(CDS_HZ.fieldbyname('CBId').AsString) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
CDS_HZ.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|