1249 lines
35 KiB
ObjectPascal
1249 lines
35 KiB
ObjectPascal
|
|
unit U_CaiWuHuilV;
|
|||
|
|
|
|||
|
|
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;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmCaiWuHuiLV = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
V1BegDate: TcxGridDBColumn;
|
|||
|
|
V1XXPrice: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
begdate: TDateTimePicker;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DS_HZ: TDataSource;
|
|||
|
|
CDS_HZ: TClientDataSet;
|
|||
|
|
v2ssel: TcxGridDBColumn;
|
|||
|
|
Edit1: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Button1: TButton;
|
|||
|
|
TADD: TToolButton;
|
|||
|
|
TDel: TToolButton;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
TSel: TToolButton;
|
|||
|
|
v2Filler: TcxGridDBColumn;
|
|||
|
|
v2Note: TcxGridDBColumn;
|
|||
|
|
TSave: TToolButton;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
v2TeXing: TcxGridDBColumn;
|
|||
|
|
v2BNo: TcxGridDBColumn;
|
|||
|
|
v2SLv: 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 ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure FactoryNameChange(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn8PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn5PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn1PropertiesEditValueChanged(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 v2T_PricePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2OrderNOPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure v2ComTaiTouPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure v2P_ColorPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure TADDClick(Sender: TObject);
|
|||
|
|
procedure TDelClick(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure v2KPTypePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxTabControl2Change(Sender: TObject);
|
|||
|
|
procedure TSelClick(Sender: TObject);
|
|||
|
|
procedure HuiLVChange(Sender: TObject);
|
|||
|
|
procedure TSaveClick(Sender: TObject);
|
|||
|
|
procedure GSTypeChange(Sender: TObject);
|
|||
|
|
procedure begdateChange(Sender: TObject);
|
|||
|
|
procedure v2TeXingPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure v2BNoPropertiesButtonClick(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
|
|||
|
|
frmCaiWuHuiLV: TfrmCaiWuHuiLV;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_Fun,U_ZDYHelp, U_ProductOrderList, U_ProductOrderNewList,
|
|||
|
|
U_PbProductList, U_ZdyAttachGYS, U_SXCKNewList, U_ProductOrderListSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' select A.*');
|
|||
|
|
sql.Add(' from JYOrder_HuiLV A');
|
|||
|
|
sql.Add(' where 1=1 ');
|
|||
|
|
if begdate.Checked=true then
|
|||
|
|
begin
|
|||
|
|
sql.add(' and convert(varchar(7),A.BegDate,120)='''+FormatDateTime('yyyy-MM',begdate.DateTime)+''' ');
|
|||
|
|
end;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.InitGridHZ();
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmCaiWuHuiLV:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action:=caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ',Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
procedure TfrmCaiWuHuiLV.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ',Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
begdate.DateTime:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
toolbar1.SetFocus;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.ToolButton2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
sql:string;
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.FactoryNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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('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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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);
|
|||
|
|
{if FFieldName='MaoQty' then
|
|||
|
|
begin
|
|||
|
|
if Trim(mvalue)<>'0' then
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.FieldByName('JZQty').AsFloat>strtofloat(mvalue)-CDS_HZ.FieldByName('ps').AsFloat*0.3 then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('ë<>ز<EFBFBD><D8B2><EFBFBD>С<EFBFBD>ھ<EFBFBD><DABE>ؼ<EFBFBD>ֽ<EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ');
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value:=NULL;
|
|||
|
|
end;
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;}
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value:=Trim(mvalue);
|
|||
|
|
if Trim(DParameters2)='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('HuiLv').Value:=1;
|
|||
|
|
end;
|
|||
|
|
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';
|
|||
|
|
|
|||
|
|
{FBBMoney:=Trim(CDS_HZ.fieldbyname('BBMoney').AsString);
|
|||
|
|
if Trim(FBBMoney)='' then FBBMoney:='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='+FMoney);
|
|||
|
|
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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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>ժҪ';
|
|||
|
|
if Trim(DParameters3)='<27><>Ŀ<EFBFBD>ֿ<EFBFBD>' then
|
|||
|
|
MainType:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then Exit;
|
|||
|
|
SelExportData(Tv2,ADOQueryMain,'Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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;
|
|||
|
|
FieldByName(FFieldName).Value:=Trim(mvalue);
|
|||
|
|
if FFieldName='GCPrice' then
|
|||
|
|
fieldbyname('GCMoney').Value:=fieldbyname('GCPrice').Value*fieldbyname('Qty').AsFloat;
|
|||
|
|
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 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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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('MainId').Value:=Trim(frmProductOrderNewList.Order_Main.fieldbyname('MainId').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);
|
|||
|
|
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(' ,P_CodeName='''+Trim(frmProductOrderListSel.Order_Main.fieldbyname('MPrtCodeName').AsString)+'''');
|
|||
|
|
sql.Add(' ,P_Spec='''+Trim(frmProductOrderListSel.Order_Main.fieldbyname('Mprtspec').AsString)+'''');
|
|||
|
|
SQL.Add(',Editer='''+Trim(DName)+'''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId='''+Trim(CDS_HZ.fieldbyname('YFId').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmProductOrderListSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.TADDClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
append;
|
|||
|
|
fieldbyname('filler').AsString:=trim(DName);
|
|||
|
|
fieldbyname('begdate').AsDateTime:=SGetServerDate(ADOQuery1);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.TDelClick(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 application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD>','<27><>ʾ',1)=2 then exit;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if FieldByName('Ssel').AsBoolean=True then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from JYOrder_HuiLV ');
|
|||
|
|
sql.Add('where HLID ='+quotedstr(trim(CDS_HZ.fieldbyname('HLID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
CDS_HZ.Delete;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_HZ,true);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_HZ,false);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.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 TfrmCaiWuHuiLV.cxTabControl2Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.TSelClick(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><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
Modalresult:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.HuiLVChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.TSaveClick(Sender: TObject);
|
|||
|
|
var maxid:string;
|
|||
|
|
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 fieldbyname('Ssel').AsBoolean=true then
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('HLID').AsString='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQueryCmd,maxId,'HL','JYOrder_HuiLV',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
maxid:=trim(fieldbyname('HLID').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from JYOrder_HuiLV ');
|
|||
|
|
sql.add('where HLID='''+Trim(maxid)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
if isempty then
|
|||
|
|
begin
|
|||
|
|
append;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
end;
|
|||
|
|
fieldbyname('HLID').AsString:=trim(maxID);
|
|||
|
|
fieldbyname('filltime').AsDateTime:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv2,CDS_HZ,'JYOrder_HuiLV',2);
|
|||
|
|
fieldbyname('XXPrice').Value:=CDS_HZ.fieldbyname('XXPrice').AsFloat;
|
|||
|
|
fieldbyname('SLv').Value:=CDS_HZ.fieldbyname('SLv').AsFloat;
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR set XXPrice='''+trim(CDS_HZ.fieldbyname('XXPrice').AsString)+'''');
|
|||
|
|
sql.Add(' where CRType=''Ӧ<>տ<EFBFBD><D5BF>Ǽ<EFBFBD>'' and convert(varchar(7),CRTime,120)='''+trim(FormatDateTime('yyyy-MM',begdate.Date))+''' ');
|
|||
|
|
// sql.add(' and isnull(YFType,'''')=''<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add(' and JSType='''+trim(CDS_HZ.fieldbyname('TeXing').AsString)+'''');
|
|||
|
|
sql.Add(' and P_CodeName='''+trim(CDS_HZ.fieldbyname('BNo').AsString)+'''');
|
|||
|
|
sql.Add(' and isnull(Status,''0'')=''0'' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>
|
|||
|
|
//<2F><><EFBFBD>½<EFBFBD><C2BD>㵥<EFBFBD><E3B5A5>
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Update YF_Money_CR Set Price=XXPrice*(1-isnull(XFBFB,0)*0.01)+isnull(OtherPrice,0)+isnull(KSFee,0)');//+isnull(KSFee,0)
|
|||
|
|
sql.Add(' where CRType=''Ӧ<>տ<EFBFBD><D5BF>Ǽ<EFBFBD>'' and convert(varchar(7),CRTime,120)='''+trim(FormatDateTime('yyyy-MM',begdate.Date))+''' ');
|
|||
|
|
//sql.add(' and isnull(YFType,'''')=''<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add(' and JSType='''+trim(CDS_HZ.fieldbyname('TeXing').AsString)+'''');
|
|||
|
|
sql.Add(' and P_CodeName='''+trim(CDS_HZ.fieldbyname('BNo').AsString)+'''');
|
|||
|
|
sql.Add(' and isnull(GuDingPrice,0)=0');
|
|||
|
|
sql.Add(' and isnull(Status,''0'')=''0'' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
//<2F><><EFBFBD>½<EFBFBD><C2BD>㵥<EFBFBD><E3B5A5>
|
|||
|
|
//<2F><><EFBFBD>½<EFBFBD><C2BD><EFBFBD>
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Update YF_Money_CR Set Money=Qty*Price+isnull(BengSongFee,0),BBMoney=Qty*Price+isnull(BengSongFee,0)');
|
|||
|
|
sql.Add(' where CRType=''Ӧ<>տ<EFBFBD><D5BF>Ǽ<EFBFBD>'' and convert(varchar(7),CRTime,120)='''+trim(FormatDateTime('yyyy-MM',begdate.Date))+''' ');
|
|||
|
|
//sql.add(' and isnull(YFType,'''')=''<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add(' and JSType='''+trim(CDS_HZ.fieldbyname('TeXing').AsString)+'''');
|
|||
|
|
sql.Add(' and P_CodeName='''+trim(CDS_HZ.fieldbyname('BNo').AsString)+'''');
|
|||
|
|
sql.Add(' and isnull(GuDingPrice,0)=0');
|
|||
|
|
sql.Add(' and isnull(Status,''0'')=''0'' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
//<2F><><EFBFBD>½<EFBFBD><C2BD><EFBFBD>
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
|||
|
|
initgrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.GSTypeChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Toolbutton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.begdateChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
initgrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.v2TeXingPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:='TeXing';
|
|||
|
|
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('TeXing').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCaiWuHuiLV.v2BNoPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:='BNo';
|
|||
|
|
flagname:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('BNo').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|