1800 lines
50 KiB
ObjectPascal
1800 lines
50 KiB
ObjectPascal
|
|
unit U_YFCR;
|
|||
|
|
|
|||
|
|
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, cxPC, cxCurrencyEdit, cxDropDownEdit, Menus, cxLookAndFeels,
|
|||
|
|
cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmYFCR = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBDel: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
FactoryName: TEdit;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
begdate: TDateTimePicker;
|
|||
|
|
Enddate: TDateTimePicker;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DS_HZ: TDataSource;
|
|||
|
|
CDS_HZ: TClientDataSet;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
v2Column1: TcxGridDBColumn;
|
|||
|
|
VBZ: TcxGridDBColumn;
|
|||
|
|
VYB: TcxGridDBColumn;
|
|||
|
|
VBB: TcxGridDBColumn;
|
|||
|
|
v2Column6: TcxGridDBColumn;
|
|||
|
|
VOrderNo: TcxGridDBColumn;
|
|||
|
|
v2PayMent: TcxGridDBColumn;
|
|||
|
|
v2Note: TcxGridDBColumn;
|
|||
|
|
v2C_CodeName: TcxGridDBColumn;
|
|||
|
|
v2Column2: TcxGridDBColumn;
|
|||
|
|
v2Column4: TcxGridDBColumn;
|
|||
|
|
v2ssel: TcxGridDBColumn;
|
|||
|
|
P_CodeName: TEdit;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
P_spec: TEdit;
|
|||
|
|
Edit1: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Button1: TButton;
|
|||
|
|
CheckBox1: TCheckBox;
|
|||
|
|
cxTabControl1: TcxTabControl;
|
|||
|
|
Tchk: TToolButton;
|
|||
|
|
Tnochk: TToolButton;
|
|||
|
|
ToolButton4: TToolButton;
|
|||
|
|
v2OrderNO: TcxGridDBColumn;
|
|||
|
|
v2ComTaiTou: TcxGridDBColumn;
|
|||
|
|
v2MaoQty: TcxGridDBColumn;
|
|||
|
|
v2Qty: TcxGridDBColumn;
|
|||
|
|
v2PBNote: TcxGridDBColumn;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
OrderNO: TEdit;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
ComTaiTou: TEdit;
|
|||
|
|
YFName: TEdit;
|
|||
|
|
v2P_Color: TcxGridDBColumn;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
v2ChkStatus: TcxGridDBColumn;
|
|||
|
|
TKP: TToolButton;
|
|||
|
|
TCXKP: TToolButton;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
v2chknote: TcxGridDBColumn;
|
|||
|
|
v2GCPrice: TcxGridDBColumn;
|
|||
|
|
v2GCMoney: TcxGridDBColumn;
|
|||
|
|
cxTabControl2: TcxTabControl;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
Label19: TLabel;
|
|||
|
|
Label20: TLabel;
|
|||
|
|
ConNo: TEdit;
|
|||
|
|
v2ConNoHZ: TcxGridDBColumn;
|
|||
|
|
Tv2Column1: TcxGridDBColumn;
|
|||
|
|
cxStyle2: TcxStyle;
|
|||
|
|
Tv2Column2: TcxGridDBColumn;
|
|||
|
|
Tv2Column3: TcxGridDBColumn;
|
|||
|
|
Tv2Column4: TcxGridDBColumn;
|
|||
|
|
ToolButton5: TToolButton;
|
|||
|
|
KHType: TComboBox;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
ComboBox1: TComboBox;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
Edit2: TEdit;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
FYType: TEdit;
|
|||
|
|
ComboBox2: TComboBox;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure TBDelClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure FactoryNameChange(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn8PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn5PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn1PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure cxGridDBColumn6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure v2Column2PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2PSPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2BatchNoPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2PayMentPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2T_qtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure v2T_PricePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure TchkClick(Sender: TObject);
|
|||
|
|
procedure TnochkClick(Sender: TObject);
|
|||
|
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
|
procedure v2OrderNOPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2ComTaiTouPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2P_ColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2sselPropertiesChange(Sender: TObject);
|
|||
|
|
procedure Tv2StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
|
procedure TKPClick(Sender: TObject);
|
|||
|
|
procedure TCXKPClick(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure v2KPTypePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxTabControl2Change(Sender: TObject);
|
|||
|
|
procedure v2C_CodeNamePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2Column4PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure VYBPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure ToolButton5Click(Sender: TObject);
|
|||
|
|
procedure Tv2Column3PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2ConNoHZPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
|
|||
|
|
procedure InitGridHZ();
|
|||
|
|
procedure InitGrid();
|
|||
|
|
function SaveData(): Boolean;
|
|||
|
|
public
|
|||
|
|
fFlag: integer;
|
|||
|
|
{ Public declarations }
|
|||
|
|
RKFlag, FCYID, fmanage: string;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmYFCR: TfrmYFCR;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_Fun, U_ZDYHelp, U_ProductOrderList, U_ProductOrderNewList,
|
|||
|
|
U_PbProductList, U_ZdyAttachGYS, U_SXCKNewList, U_ProductOrderListSel,
|
|||
|
|
U_ContractListSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
Filtered := False;
|
|||
|
|
sql.Add(' select P_Color=(select B.SPCF from CK_SXPB_CR B where B.SPID=A.YFTypeId and B.CKName=''<27><><EFBFBD>첼'') ');
|
|||
|
|
sql.Add(',PBPrice=(select B.Price from CK_SXPB_CR B where B.SPID=A.YFTypeId) ');
|
|||
|
|
sql.Add(',KPStatusH=(case when isnull(KPstatus,'''')='''' then ''δ<><CEB4>Ʊ'' else ''<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'' end),A.*');
|
|||
|
|
sql.Add(' from YF_Money_CR A');
|
|||
|
|
sql.Add(' where A.CRTime>=''' + FormatDateTime('yyyy-MM-dd', begdate.DateTime) + ''' ');
|
|||
|
|
sql.Add(' and A.CRTime<''' + FormatDateTime('yyyy-MM-dd', Enddate.DateTime + 1) + ''' ');
|
|||
|
|
sql.Add(' and A.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' ');
|
|||
|
|
sql.add(' and isnull(FeeType,'''')<>''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
if cxTabControl1.TabIndex < 3 then
|
|||
|
|
sql.Add(' and isnull(A.status,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
|
|||
|
|
if cxtabControl2.TabIndex = 0 then
|
|||
|
|
sql.Add(' and isnull(A.YFType,'''')=''<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
if cxtabControl2.TabIndex = 1 then
|
|||
|
|
sql.Add(' and isnull(A.YFType,'''')<>''<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
|
Label12.Caption := '0';
|
|||
|
|
Label13.Caption := '0';
|
|||
|
|
Label17.Caption := '0';
|
|||
|
|
label19.Caption := '0';
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
//ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.InitGridHZ();
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
// frmYFCR:=nil;
|
|||
|
|
frmYFCR := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>ww', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
{with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('delete CK_YP_CR where isnull(CRTime,'''')='''' and CYID='''+Trim(FCYID)+''' and CRType='''+Trim(RKFlag)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;}
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.TBDelClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FBBMoney, CRID: string;
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if cxtabcontrol1.TabIndex <> 0 then
|
|||
|
|
exit;
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Ssel').asboolean = true then
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('YFName').AsString = '<27><><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7>ò<EFBFBD><C3B2><EFBFBD>ɾ<EFBFBD><C9BE>', '<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if fieldbyname('YFName').AsString = '<27><>Ʒ<EFBFBD>˻<EFBFBD><CBBB><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><>Ʒ<EFBFBD>˻<EFBFBD><CBBB>Ѳ<EFBFBD><D1B2><EFBFBD>ɾ<EFBFBD><C9BE>', '<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if fieldbyname('YFName').AsString = '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><DEB2><EFBFBD>ɾ<EFBFBD><C9BE>', '<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Fieldbyname('ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete YF_Money_CR where YFID=''' + Trim(CDS_HZ.fieldbyname('YFID').AsString) + '''');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>ww', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Enddate.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
|
begdate.DateTime := SGetServerDate(ADOQueryTemp) - 7;
|
|||
|
|
TKP.Visible := False;
|
|||
|
|
TCXKP.Visible := False;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
toolbar1.SetFocus;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.ToolButton2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
sql: string;
|
|||
|
|
begin
|
|||
|
|
Label12.Caption := '0';
|
|||
|
|
Label13.Caption := '0';
|
|||
|
|
Label17.Caption := '0';
|
|||
|
|
Label19.Caption := '0';
|
|||
|
|
if ADOQueryMain.Active then
|
|||
|
|
begin
|
|||
|
|
sql := SGetFilters(Panel1, 1, 2);
|
|||
|
|
{ if sql='' THEN
|
|||
|
|
begin
|
|||
|
|
if trim(ComboBox1.Text)='<27>ӹ<EFBFBD><D3B9><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
sql:=' LX like ''%<25>ӹ<EFBFBD>%'' ';
|
|||
|
|
end
|
|||
|
|
else if trim(ComboBox1.Text)='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
sql:=' LX ='''' AND ';
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if trim(ComboBox1.Text)='<27>ӹ<EFBFBD><D3B9><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
sql:=sql+' AND LX like ''%<25>ӹ<EFBFBD>%'' ';
|
|||
|
|
end
|
|||
|
|
else if trim(ComboBox1.Text)='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
sql:=sql+' AND LX = '''' ';
|
|||
|
|
end;
|
|||
|
|
end; }
|
|||
|
|
SDofilter(ADOQueryMain, sql);
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.FactoryNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.Button2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
if Trim(CDS_HZ.fieldbyname('SubID').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete YCL_SG_HZ where SubID=''' + Trim(CDS_HZ.fieldbyname('SubID').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
CDS_HZ.Delete;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmYFCR.SaveData(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxId, CRID: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
if GetLSNo(ADOQueryCmd, maxId, 'YF', 'YF_Money_CR', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
Result := False;
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(CDS_HZ.fieldbyname('FactoryName').AsString) + ''' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryCmd.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
CRID := ADOQueryCmd.fieldbyname('CRID').AsString;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Update YF_Money_CRID set CRID=CRID+1');
|
|||
|
|
sql.Add('select * from YF_Money_CRID ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
CRID := ADOQueryCmd.fieldbyname('CRID').AsString;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from YF_Money_KC where 1<>1');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('CRID').Value := StrToInt(CRID);
|
|||
|
|
FieldByName('FactoryNo').Value := Trim(CDS_HZ.fieldbyname('FactoryNo').AsString);
|
|||
|
|
FieldByName('FactoryName').Value := Trim(CDS_HZ.fieldbyname('FactoryName').AsString);
|
|||
|
|
FieldByName('ZdyStr1').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from YF_Money_CR where 1<>1');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('YFID').Value := Trim(maxId);
|
|||
|
|
FieldByName('CRID').Value := StrToInt(CRID);
|
|||
|
|
//SSetSaveDataCDSNew(ADOQueryCmd,Tv2,CDS_HZ,'YF_Money_CR',3);
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
FieldByName('CRType').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>';
|
|||
|
|
FieldByName('CRFlag').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('QtyFlag').Value := 1;
|
|||
|
|
FieldByName('HuiLv').Value := 1;
|
|||
|
|
FieldByName('FactoryNo').Value := Trim(CDS_HZ.fieldbyname('FactoryNo').AsString);
|
|||
|
|
FieldByName('FactoryName').Value := Trim(CDS_HZ.fieldbyname('FactoryName').AsString);
|
|||
|
|
FieldByName('CRTime').Value := formatdateTIme('yyyy-MM-dd', CDS_HZ.fieldbyname('CRTime').AsDateTime);
|
|||
|
|
FieldByName('status').Value := '0';
|
|||
|
|
fieldbyname('BZType').Value := '<27><>';
|
|||
|
|
FieldByName('KPType').Value := Trim(CDS_HZ.fieldbyname('KPType').AsString);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('YFId').Value := Trim(maxId);
|
|||
|
|
FieldByName('CRID').Value := StrToInt(CRID);
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
Result := True;
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.cxGridDBColumn8PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YCL_SG_HZ ');
|
|||
|
|
if Trim(mvalue) <> '' then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=''' + Trim(mvalue) + '''');
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=NULL');
|
|||
|
|
end;
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where SubId=''' + Trim(CDS_HZ.fieldbyname('SubId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.cxGridDBColumn5PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FQty, FPrice, FMoney, FHuiLv, FBBMoney, FKCBB, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
{if Trim(CDS_HZ.FieldByName('YFType').AsString)='<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;}
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
FieldByName('HuiLv').Value := 1;
|
|||
|
|
if trim(FFieldName) = 'MaoQty' then
|
|||
|
|
begin
|
|||
|
|
fieldbyname('Qty').AsString := Trim(mvalue);
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select isnull(BBMoney,0) BBMoney from YF_Money_CR where YFID=''' + cds_hz.fieldbyname('YFID').AsString + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FKCBB := ADOQueryTemp.fieldbyname('BBMoney').AsString;
|
|||
|
|
|
|||
|
|
FQty := Trim(CDS_HZ.fieldbyname('Qty').AsString);
|
|||
|
|
if Trim(FQty) = '' then
|
|||
|
|
FQty := '0';
|
|||
|
|
|
|||
|
|
FPrice := Trim(CDS_HZ.fieldbyname('Price').AsString);
|
|||
|
|
if Trim(FPrice) = '' then
|
|||
|
|
FPrice := '0';
|
|||
|
|
FQty := Trim(CDS_HZ.fieldbyname('Qty').AsString);
|
|||
|
|
if Trim(FQty) = '' then
|
|||
|
|
FQty := '0';
|
|||
|
|
|
|||
|
|
FMoney := Trim(CDS_HZ.fieldbyname('Money').AsString);
|
|||
|
|
if Trim(FMoney) = '' then
|
|||
|
|
FMoney := '0';
|
|||
|
|
|
|||
|
|
FHuiLv := Trim(CDS_HZ.fieldbyname('HuiLv').AsString);
|
|||
|
|
if Trim(FHuiLv) = '' then
|
|||
|
|
FHuiLv := '0';
|
|||
|
|
|
|||
|
|
if Trim(FFieldName) <> 'Money' then
|
|||
|
|
begin
|
|||
|
|
if Trim(FFieldName) <> 'HuiLv' then
|
|||
|
|
begin
|
|||
|
|
FBBMoney := FloatToStr(StrToFloat(FQty) * StrToFloat(FPrice) * StrToFloat(FHuiLv));
|
|||
|
|
FMoney := FloatToStr(StrToFloat(FQty) * StrToFloat(FPrice));
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FBBMoney := FloatToStr(StrToFloat(FMoney) * StrToFloat(FHuiLv));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FBBMoney := FloatToStr(StrToFloat(FMoney) * StrToFloat(FHuiLv));
|
|||
|
|
end;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Money').Value := StrToFloat(FMoney);
|
|||
|
|
FieldByName('BBMoney').Value := StrToFloat(FBBMoney);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
if Trim(FFieldName) <> 'Money' then
|
|||
|
|
begin
|
|||
|
|
sql.Add(',Money=''' + trim(CDS_HZ.fieldbyname('Money').AsString) + '''');
|
|||
|
|
end;
|
|||
|
|
if trim(FFieldName) = 'MaoQty' then
|
|||
|
|
begin
|
|||
|
|
sql.add(',Qty=' + FQty);
|
|||
|
|
end;
|
|||
|
|
sql.Add(',BBMoney=' + FBBMoney);
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
|
|||
|
|
sql.Add('Update YF_Money_KC Set KCBBMoney=KCBBMoney-' + FKCBB + '+' + FBBMoney);
|
|||
|
|
sql.Add(' where CRID=''' + Trim(CDS_HZ.fieldbyname('CRID').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
tv2.Controller.EditingController.ShowEdit();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.cxGridDBColumn1PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_HZ.FieldByName('YFType').AsString) = '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
if Trim(mvalue) <> '' then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=''' + Trim(mvalue) + '''');
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=NULL');
|
|||
|
|
end;
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
tv2.Controller.EditingController.ShowEdit();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.ToolButton3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
|||
|
|
with frmZdyAttachGYS do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('FactoryNo').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString);
|
|||
|
|
FieldByName('FactoryName').Value := Trim(CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
|
FieldByName('CRTime').Value := SGetServerDate(ADOQueryTemp);
|
|||
|
|
FieldByName('BZType').Value := 'RMB';
|
|||
|
|
fieldbyname('KPType').Value := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('HuiLv').Value := 1;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Self.SaveData();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZdyAttachGYS.Free;
|
|||
|
|
end;
|
|||
|
|
tv2.Controller.EditingController.ShowEdit();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_HZ.FieldByName('YFType').AsString) = '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'YFName';
|
|||
|
|
flagname := '<27><>Ŀ<EFBFBD><C4BF>ժҪ';
|
|||
|
|
Maintype := trim(DName) + 'Ӧ<><D3A6>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('YFCode').Value := Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString);
|
|||
|
|
FieldByName('YFName').Value := Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set YFCode=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
|
|||
|
|
sql.Add(' ,YFName=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.cxGridDBColumn6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'OrderUnit';
|
|||
|
|
flagname := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_HZ.Edit;
|
|||
|
|
Self.CDS_HZ.FieldByName('QtyUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set QtyUnit=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'BZType';
|
|||
|
|
flagname := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_HZ.Edit;
|
|||
|
|
Self.CDS_HZ.FieldByName('BZType').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set BZType=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
SelExportData(Tv2, ADOQueryMain, 'Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2Column2PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FBBMoney, FKCBB, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_HZ.FieldByName('YFType').AsString) = '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2PSPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2BatchNoPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
if FFieldName = 'GCPrice' then
|
|||
|
|
begin
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
if FFieldName = 'GCMoney' then
|
|||
|
|
begin
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
if FFieldName = 'GCPrice' then
|
|||
|
|
fieldbyname('GCMoney').Value := fieldbyname('GCPrice').Value * fieldbyname('Qty').AsFloat;
|
|||
|
|
if FFieldName = 'GCMoney' then
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Qty').AsFloat <> 0 then
|
|||
|
|
fieldbyname('GCPrice').Value := fieldbyname('GCMoney').Value / fieldbyname('Qty').AsFloat;
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=''' + Trim(mvalue) + '''');
|
|||
|
|
if FFieldName = 'GCPrice' then
|
|||
|
|
begin
|
|||
|
|
sql.add(',GCMoney=''' + trim(CDS_HZ.fieldbyname('GCMoney').AsString) + '''');
|
|||
|
|
end;
|
|||
|
|
if FFieldName = 'GCMoney' then
|
|||
|
|
begin
|
|||
|
|
sql.add(',GCPrice=''' + trim(CDS_HZ.fieldbyname('GCPrice').AsString) + '''');
|
|||
|
|
end;
|
|||
|
|
if CDS_HZ.fieldbyname('GCMoney').AsFloat <> 0 then
|
|||
|
|
sql.add(',BBMoney=''' + trim(CDS_HZ.fieldbyname('GCMoney').AsString) + '''');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2PayMentPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
{if Trim(CDS_HZ.FieldByName('YFType').AsString)='<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;}
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'PayMent';
|
|||
|
|
flagname := '֧<><D6A7><EFBFBD><EFBFBD>ʽ';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('PayMent').Value := Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set PayMent=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2T_qtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FQty, FPrice, FMoney, FHuiLv, FBBMoney, FKCBB, FFieldName, TMoney: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
|
|||
|
|
TMoney := format('%.2f', [CDS_HZ.Fieldbyname('T_Price').AsFloat * strtofloat(mvalue)]);
|
|||
|
|
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
|
|||
|
|
FieldByName('T_Money').Value := trim(TMoney);
|
|||
|
|
if Trim(DParameters2) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('HuiLv').Value := 1;
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
|
|||
|
|
sql.Add(',T_Money=' + TMoney);
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.Button1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
try
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('ssel').AsBoolean then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from YF_Money_CR ');
|
|||
|
|
sql.Add('where YFID=' + quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
open;
|
|||
|
|
edit;
|
|||
|
|
Fieldbyname('Price').Value := strtofloatdef(edit1.Text, 0);
|
|||
|
|
Fieldbyname('Money').Value := format('%.2f', [Fieldbyname('Qty').AsFloat * strtofloatdef(edit1.Text, 0)]);
|
|||
|
|
Fieldbyname('BBMoney').Value := format('%.2f', [Fieldbyname('Qty').AsFloat * strtofloatdef(edit1.Text, 0)]);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
InitGrid();
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Label12.Caption := '0';
|
|||
|
|
Label13.Caption := '0';
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
fieldbyname('ssel').Value := checkbox1.Checked;
|
|||
|
|
if checkbox1.Checked = true then
|
|||
|
|
begin
|
|||
|
|
Label12.Caption := floattostr(strtofloat(Label12.Caption) + fieldbyname('Qty').AsCurrency);
|
|||
|
|
Label13.Caption := floattostr(strtofloat(Label13.Caption) + fieldbyname('Money').AsCurrency);
|
|||
|
|
end;
|
|||
|
|
post;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2T_PricePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FQty, FPrice, FMoney, FHuiLv, FBBMoney, FKCBB, FFieldName, TMoney: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
|
|||
|
|
TMoney := format('%.2f', [CDS_HZ.Fieldbyname('T_Qty').AsFloat * strtofloat(mvalue)]);
|
|||
|
|
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
|
|||
|
|
FieldByName('T_Money').Value := trim(TMoney);
|
|||
|
|
if Trim(DParameters2) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('HuiLv').Value := 1;
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
|
|||
|
|
sql.Add(',T_Money=' + TMoney);
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.cxTabControl1Change(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
i: integer;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
Tchk.Enabled := false;
|
|||
|
|
TNochk.Enabled := false;
|
|||
|
|
TKP.Visible := False;
|
|||
|
|
TCXKP.Visible := False;
|
|||
|
|
//TBDel.Enabled:=false;
|
|||
|
|
// Ttj.Enabled:=false;
|
|||
|
|
// TnoTj.Enabled:=false;
|
|||
|
|
for i := 0 to tv2.ColumnCount - 1 do
|
|||
|
|
begin
|
|||
|
|
if uppercase(tv2.Columns[i].DataBinding.FieldName) <> 'SSEL' then
|
|||
|
|
tv2.Columns[i].Options.Editing := false;
|
|||
|
|
end;
|
|||
|
|
if (cxTabControl1.TabIndex > 0) and (cxTabControl1.TabIndex < 3) then
|
|||
|
|
begin
|
|||
|
|
TKP.Visible := true;
|
|||
|
|
TCXKP.Visible := true;
|
|||
|
|
end;
|
|||
|
|
if fmanage = '<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
|
begin
|
|||
|
|
if cxTabControl1.TabIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
Tchk.Enabled := true;
|
|||
|
|
//TBDel.Enabled:=true;
|
|||
|
|
for i := 0 to tv2.ColumnCount - 1 do
|
|||
|
|
begin
|
|||
|
|
tv2.Columns[i].Options.Editing := true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.TabIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
TNochk.Enabled := true;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cxTabControl1.TabIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
//Tchk.Enabled:=true;
|
|||
|
|
TBDel.Enabled := true;
|
|||
|
|
for i := 0 to tv2.ColumnCount - 1 do
|
|||
|
|
begin
|
|||
|
|
tv2.Columns[i].Options.Editing := true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.TabIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.TabIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
v2GCPrice.Options.Editing := true;
|
|||
|
|
end;
|
|||
|
|
v2ComTaiTou.Options.Editing := true;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.TchkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if cds_HZ.FieldByName('Ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
{if cds_HZ.FieldByName('KPType').AsString='' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><>Ʊ<EFBFBD><C6B1><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;}
|
|||
|
|
{if cds_HZ.FieldByName('GCPrice').asfloat=cds_HZ.FieldByName('Price').asfloat then
|
|||
|
|
begin
|
|||
|
|
application.messagebox('<27><>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>빤<EFBFBD><EBB9A4><EFBFBD><EFBFBD><EFBFBD>۲<EFBFBD><DBB2><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ύ','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
}
|
|||
|
|
if cds_HZ.FieldByName('QtyUnit').AsString = '' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', '<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if cds_HZ.FieldByName('ComTaiTou').AsString = '' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><>˾̧ͷ<CCA7><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', '<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
{if cds_HZ.FieldByName('YFName').AsString='ԭ<>Ϸ<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
if cds_HZ.FieldByName('OrderNO').AsString='' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('ָʾ<D6B8><CABE><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;}
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Fieldbyname('ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET status=''1'',ChkStatus='''' ');
|
|||
|
|
sql.Add('where YFID =' + quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.TnochkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Fieldbyname('ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET status=''0'' ');
|
|||
|
|
sql.Add('where YFID =' + quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
sql.Add(' and status=''1''');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.ToolButton4Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmSXCKNewList := TfrmSXCKNewList.create(self);
|
|||
|
|
with frmSXCKNewList do
|
|||
|
|
begin
|
|||
|
|
show;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2OrderNOPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmProductOrderListSel := TfrmProductOrderListSel.Create(Application);
|
|||
|
|
with frmProductOrderListSel do
|
|||
|
|
begin
|
|||
|
|
FFInt := 1;
|
|||
|
|
//frmProductOrderList.v1Column4.Visible:=True;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('ZSDSubid').Value := Trim(frmProductOrderListSel.Order_Main.fieldbyname('Subid').AsString);
|
|||
|
|
FieldByName('ConNO').Value := Trim(frmProductOrderListSel.Order_Main.fieldbyname('ConNO').AsString);
|
|||
|
|
FieldByName('OrderNo').Value := Trim(frmProductOrderListSel.Order_Main.fieldbyname('OrderNo').AsString);
|
|||
|
|
FieldByName('P_CodeName').Value := Trim(frmProductOrderListSel.Order_Main.fieldbyname('MPrtCodeName').AsString);
|
|||
|
|
FieldByName('P_Spec').Value := Trim(frmProductOrderListSel.Order_Main.fieldbyname('Mprtspec').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set OrderNO=''' + Trim(frmProductOrderListSel.Order_Main.fieldbyname('OrderNO').AsString) + '''');
|
|||
|
|
sql.Add(' ,ConNO=''' + Trim(frmProductOrderListSel.Order_Main.fieldbyname('ConNO').AsString) + '''');
|
|||
|
|
sql.Add(' ,P_CodeName=''' + Trim(frmProductOrderListSel.Order_Main.fieldbyname('MPrtCodeName').AsString) + '''');
|
|||
|
|
sql.Add(' ,P_Spec=''' + Trim(frmProductOrderListSel.Order_Main.fieldbyname('Mprtspec').AsString) + '''');
|
|||
|
|
sql.Add(' ,ZSDSubid=''' + Trim(frmProductOrderListSel.Order_Main.fieldbyname('Subid').AsString) + '''');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(self.CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmProductOrderListSel.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2ComTaiTouPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'ComTaiTou';
|
|||
|
|
flagname := '<27><>˾̧ͷ';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('ComTaiTou').Value := Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ComTaiTou=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2P_ColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_HZ.FieldByName('YFType').AsString) = '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'P_Color';
|
|||
|
|
flagname := '<27><>ɫ';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('P_Color').Value := Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set P_Color=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2sselPropertiesChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
toolbar1.SetFocus;
|
|||
|
|
HJ(CDS_HZ, Label12, CDS_HZ.fieldbyname('Qty').AsCurrency);
|
|||
|
|
HJ(CDS_HZ, Label13, CDS_HZ.fieldbyname('Money').AsCurrency);
|
|||
|
|
HJ(CDS_HZ, Label17, CDS_HZ.fieldbyname('GCMoney').AsCurrency);
|
|||
|
|
HJ(CDS_HZ, Label19, CDS_HZ.fieldbyname('ps').AsCurrency);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.Tv2StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
|
var
|
|||
|
|
id, id10: Integer;
|
|||
|
|
begin
|
|||
|
|
id := Tv2.GetColumnByFieldName('ChkStatus').Index;
|
|||
|
|
if ARecord.Values[id] = '<27><>ͨ<EFBFBD><CDA8>' then
|
|||
|
|
begin
|
|||
|
|
AStyle := DataLink_YSYF1.Red;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.TKPClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Fieldbyname('ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET KPStatus=''<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add('where YFID =' + quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.TCXKPClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Fieldbyname('ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET KPStatus='''' ');
|
|||
|
|
sql.Add('where YFID =' + quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_HZ, true);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_HZ, false);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2KPTypePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('KPType').Value := Trim(mvalue);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set KPType=''' + Trim(mvalue) + '''');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.cxTabControl2Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2C_CodeNamePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FBBMoney, FKCBB, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_HZ.FieldByName('YFType').AsString) = '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2Column4PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FBBMoney, FKCBB, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_HZ.FieldByName('YFType').AsString) = '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.VYBPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FBBMoney, FKCBB, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_HZ.FieldByName('YFType').AsString) = '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
sql.Add(',BBMoney=' + Trim(mvalue));
|
|||
|
|
sql.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(',Edittime=getdate() ');
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.ToolButton5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(ComboBox2.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Fieldbyname('ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET FYType=' + quotedstr(Trim(ComboBox2.Text)));
|
|||
|
|
sql.Add('where YFID =' + quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.Tv2Column3PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FQty, FPrice, FMoney, FHuiLv, FBBMoney, FKCBB, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + quotedstr(Trim(mvalue)));
|
|||
|
|
sql.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
tv2.Controller.EditingController.ShowEdit();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYFCR.v2ConNoHZPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmContractListSel := TfrmContractListSel.Create(Application);
|
|||
|
|
with frmContractListSel do
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Conid').Value := Trim(frmContractListSel.Order_Main.fieldbyname('Mainid').AsString);
|
|||
|
|
FieldByName('ConNO').Value := Trim(frmContractListSel.Order_Main.fieldbyname('ConNO').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set Conid=''' + Trim(frmContractListSel.Order_Main.fieldbyname('Mainid').AsString) + '''');
|
|||
|
|
sql.Add(' ,ConNO=''' + Trim(frmContractListSel.Order_Main.fieldbyname('ConNO').AsString) + '''');
|
|||
|
|
|
|||
|
|
sql.Add(' where YFId=''' + Trim(self.CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmProductOrderListSel.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
// UPdate YF_Money_CR
|
|||
|
|
// Set Conid='JB2212300001'
|
|||
|
|
//,ConNo='CP20220331'
|
|||
|
|
//,Editer='ADMIN'
|
|||
|
|
//,Edittime=getdate()
|
|||
|
|
// where YFId='YF2301060179'
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|