951 lines
29 KiB
ObjectPascal
951 lines
29 KiB
ObjectPascal
unit U_CKProductBCPOutList;
|
||
|
||
interface
|
||
|
||
uses
|
||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||
cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
||
cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
|
||
cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
|
||
ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
|
||
cxDropDownEdit, RM_Common, RM_Class, RM_e_Xls, RM_Dataset, RM_System,
|
||
RM_GridReport, cxCheckBox, Menus, MovePanel, RM_E_llPDF, cxCalendar, Math,
|
||
Clipbrd, cxPC, cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
|
||
dxBarBuiltInMenu, cxContainer, dxCore, cxDateUtils, cxMaskEdit, dxSkinsCore,
|
||
dxSkinsDefaultPainters, dxSkinscxPCPainter, dxSkinBlack, dxSkinBlue,
|
||
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,
|
||
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
||
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
||
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
||
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
||
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
||
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
||
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
||
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
||
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
|
||
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinValentine, dxSkinVS2010,
|
||
dxSkinWhiteprint, dxSkinXmas2008Blue;
|
||
|
||
type
|
||
TfrmCKProductBCPOutList = class(TForm)
|
||
ToolBar1: TToolBar;
|
||
TBRafresh: TToolButton;
|
||
TBExport: TToolButton;
|
||
TBClose: TToolButton;
|
||
Panel1: TPanel;
|
||
ADOQueryCmd: TADOQuery;
|
||
ADOQueryMain: TADOQuery;
|
||
ADOQueryTemp: TADOQuery;
|
||
DataSource1: TDataSource;
|
||
Label2: TLabel;
|
||
CDS_Main: TClientDataSet;
|
||
Tv1: TcxGridDBTableView;
|
||
cxGrid2Level1: TcxGridLevel;
|
||
cxGrid2: TcxGrid;
|
||
cxgrdMPRTCodeName: TcxGridDBColumn;
|
||
cxgrdPRTColor: TcxGridDBColumn;
|
||
cxgrdKGQty: TcxGridDBColumn;
|
||
cxgrdQty: TcxGridDBColumn;
|
||
v1Column1: TcxGridDBColumn;
|
||
v1Column2: TcxGridDBColumn;
|
||
cxgrdQtyUnit: TcxGridDBColumn;
|
||
v1Column6: TcxGridDBColumn;
|
||
cxgrdMPRTMF: TcxGridDBColumn;
|
||
cxgrdMPRTKZ: TcxGridDBColumn;
|
||
v1Column3: TcxGridDBColumn;
|
||
RMXLSExport1: TRMXLSExport;
|
||
v1Column4: TcxGridDBColumn;
|
||
v1Column5: TcxGridDBColumn;
|
||
cxgrdMPRTSpec: TcxGridDBColumn;
|
||
TBCKCX: TToolButton;
|
||
v1Column11: TcxGridDBColumn;
|
||
PopupMenu1: TPopupMenu;
|
||
N1: TMenuItem;
|
||
N2: TMenuItem;
|
||
MovePanel2: TMovePanel;
|
||
DS_JuanPRT: TDataSource;
|
||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||
cxgrdNETKGQty: TcxGridDBColumn;
|
||
cxgrdKuangHao: TcxGridDBColumn;
|
||
v1Column19: TcxGridDBColumn;
|
||
v1Column20: TcxGridDBColumn;
|
||
cxgrdAPID: TcxGridDBColumn;
|
||
v1Column22: TcxGridDBColumn;
|
||
begtime: TDateTimePicker;
|
||
endTime: TDateTimePicker;
|
||
ADOQueryPrint: TADOQuery;
|
||
RMDB_Main: TRMDBDataSet;
|
||
v1rkplace: TcxGridDBColumn;
|
||
RMDBHZ: TRMDBDataSet;
|
||
CDS_HZ: TClientDataSet;
|
||
RM3: TRMGridReport;
|
||
v1Column24: TcxGridDBColumn;
|
||
RMDBPRT: TRMDBDataSet;
|
||
CDS_PRT: TClientDataSet;
|
||
lblKHName: TLabel;
|
||
KHName: TEdit;
|
||
cxgrdCustomerNoName: TcxGridDBColumn;
|
||
IsJYTime: TCheckBox;
|
||
v1Column13: TcxGridDBColumn;
|
||
ToolButton2: TToolButton;
|
||
ToolButton1: TToolButton;
|
||
ComboBox1: TComboBox;
|
||
lblAPID: TLabel;
|
||
APID: TEdit;
|
||
lblMPRTCodeName: TLabel;
|
||
lblorderNo: TLabel;
|
||
lblMJID: TLabel;
|
||
lblCPType: TLabel;
|
||
lblPRTColor: TLabel;
|
||
lblMPRTSpec: TLabel;
|
||
lblRKplace: TLabel;
|
||
lblConNo: TLabel;
|
||
lblJYXH: TLabel;
|
||
Label14: TLabel;
|
||
MPRTCodeName: TEdit;
|
||
orderNo: TEdit;
|
||
MJID: TEdit;
|
||
CPType: TComboBox;
|
||
RKplace: TEdit;
|
||
PRTColor: TEdit;
|
||
MPRTSpec: TEdit;
|
||
ConNo: TEdit;
|
||
JYXH: TEdit;
|
||
CustomerNoName: TEdit;
|
||
cxgrdJQty: TcxGridDBColumn;
|
||
N3: TMenuItem;
|
||
Panel2: TPanel;
|
||
Panel3: TPanel;
|
||
cxTabControl1: TcxTabControl;
|
||
Panel6: TPanel;
|
||
Label31: TLabel;
|
||
LBCPAP: TLabel;
|
||
BTLP: TButton;
|
||
BTNP: TButton;
|
||
TCBNOR: TComboBox;
|
||
Label1: TLabel;
|
||
CKOrdNo: TEdit;
|
||
v1Column7: TcxGridDBColumn;
|
||
Label3: TLabel;
|
||
YWY: TEdit;
|
||
VC_LCKNote: TcxGridDBColumn;
|
||
Panel5: TPanel;
|
||
Edit1: TEdit;
|
||
Panel4: TPanel;
|
||
Edit2: TEdit;
|
||
Tv1Column1: TcxGridDBColumn;
|
||
Tv1Column2: TcxGridDBColumn;
|
||
Tv1Column3: TcxGridDBColumn;
|
||
Tv1Column4: TcxGridDBColumn;
|
||
BegDate: TcxDateEdit;
|
||
EndDate: TcxDateEdit;
|
||
Tv1Column5: TcxGridDBColumn;
|
||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||
procedure FormCreate(Sender: TObject);
|
||
procedure TBRafreshClick(Sender: TObject);
|
||
procedure ConNoMChange(Sender: TObject);
|
||
procedure TBCloseClick(Sender: TObject);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure TBExportClick(Sender: TObject);
|
||
procedure N1Click(Sender: TObject);
|
||
procedure N2Click(Sender: TObject);
|
||
procedure TBCKCXClick(Sender: TObject);
|
||
procedure orderNoKeyPress(Sender: TObject; var Key: Char);
|
||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||
procedure Tv1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||
procedure BTNPClick(Sender: TObject);
|
||
procedure BTLPClick(Sender: TObject);
|
||
procedure TCBNORChange(Sender: TObject);
|
||
procedure CPTypeChange(Sender: TObject);
|
||
procedure ToolButton2Click(Sender: TObject);
|
||
procedure ToolButton1Click(Sender: TObject);
|
||
procedure cxTabControl1Change(Sender: TObject);
|
||
procedure N3Click(Sender: TObject);
|
||
procedure CustomerNoNameKeyPress(Sender: TObject; var Key: Char);
|
||
procedure EndDateChange(Sender: TObject);
|
||
procedure BegDateChange(Sender: TObject);
|
||
procedure v1Column8PropertiesEditValueChanged(Sender: TObject);
|
||
private
|
||
FLeft, FTop: Integer;
|
||
FAPID: string;
|
||
CurrentPage, RecordsNumber: Integer;
|
||
procedure InitGrid();
|
||
procedure SetStatus();
|
||
{ Private declarations }
|
||
public
|
||
canshu1: string;
|
||
fkhname: string;
|
||
{ Public declarations }
|
||
end;
|
||
|
||
//var
|
||
// frmCKProductBCPOutList: TfrmCKProductBCPOutList;
|
||
|
||
implementation
|
||
|
||
uses
|
||
U_DataLink, U_Fun, U_SysLogHelp;
|
||
|
||
{$R *.dfm}
|
||
procedure TfrmCKProductBCPOutList.SetStatus();
|
||
var
|
||
i: Integer;
|
||
begin
|
||
TBCKCX.Visible := false;
|
||
VC_LCKNote.Visible := false;
|
||
ToolButton1.Enabled := False;
|
||
case cxTabControl1.TabIndex of
|
||
0:
|
||
begin
|
||
Panel6.Visible := False;
|
||
ClearOrHideControls(Panel1, '0', True, True);
|
||
ClearOrHideControls(Panel1, '1', True, False);
|
||
ClearOrHideControls(Panel1, '2', True, False);
|
||
|
||
for i := 0 to tv1.ColumnCount - 1 do
|
||
begin
|
||
tv1.Columns[i].Visible := false;
|
||
end;
|
||
IsVisibleTV(Panel1, TV1, '0', True);
|
||
cxgrdJQty.Visible := True;
|
||
cxgrdKGQty.Visible := True;
|
||
cxgrdNETKGQty.Visible := True;
|
||
cxgrdQty.Visible := True;
|
||
cxgrdQtyUnit.Visible := True;
|
||
Tv1Column5.Visible := True;
|
||
end;
|
||
1:
|
||
begin
|
||
Panel6.Visible := False;
|
||
ClearOrHideControls(Panel1, '0', false, True);
|
||
ClearOrHideControls(Panel1, '1', True, True);
|
||
ClearOrHideControls(Panel1, '2', True, False);
|
||
|
||
for i := 0 to tv1.ColumnCount - 1 do
|
||
begin
|
||
tv1.Columns[i].Visible := false;
|
||
end;
|
||
IsVisibleTV(Panel1, TV1, '0', True);
|
||
IsVisibleTV(Panel1, TV1, '1', True);
|
||
cxgrdJQty.Visible := True;
|
||
cxgrdKGQty.Visible := True;
|
||
cxgrdNETKGQty.Visible := True;
|
||
cxgrdQty.Visible := True;
|
||
cxgrdQtyUnit.Visible := True;
|
||
v1Column2.Visible := True;
|
||
VC_LCKNote.Visible := True;
|
||
Tv1Column5.Visible := True;
|
||
end;
|
||
2:
|
||
begin
|
||
for i := 0 to tv1.ColumnCount - 1 do
|
||
begin
|
||
tv1.Columns[i].Visible := True;
|
||
end;
|
||
cxgrdJQty.Visible := false;
|
||
|
||
ClearOrHideControls(Panel1, '0', False, True);
|
||
ClearOrHideControls(Panel1, '1', False, True);
|
||
ClearOrHideControls(Panel1, '2', False, True);
|
||
if canshu1 = '<27><><EFBFBD><EFBFBD>' then
|
||
begin
|
||
TBCKCX.Visible := true;
|
||
ToolButton2.Visible := True;
|
||
end;
|
||
|
||
Panel6.Visible := True;
|
||
ToolButton1.Enabled := true;
|
||
end;
|
||
end;
|
||
if cxTabControl1.TabIndex = 0 then
|
||
begin
|
||
ReadCxGrid(trim(self.Caption) + '1', Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
end
|
||
else if cxTabControl1.TabIndex = 1 then
|
||
begin
|
||
ReadCxGrid(trim(self.Caption) + '2', Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
end
|
||
else
|
||
begin
|
||
ReadCxGrid(trim(self.Caption) + '3', Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
end;
|
||
if canshu1 = '<27>ͻ<EFBFBD><CDBB><EFBFBD>ѯ' then
|
||
begin
|
||
CustomerNoName.Text := fkhname;
|
||
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||
begin
|
||
Action := caFree;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.FormCreate(Sender: TObject);
|
||
begin
|
||
// EndDate.DateTime := SGetServerDateTime(ADOQueryTemp);
|
||
// BegDate.DateTime := EndDate.DateTime - 20;
|
||
|
||
EndDate.Text := FormatDateTime('yyyy-MM-dd', SGetServerDate10(ADOQueryTemp) + 1) + ' 06:00:00';
|
||
BegDate.Text := FormatDateTime('yyyy-MM-dd', SGetServerDate10(ADOQueryTemp)) + ' 06:00:00';
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.InitGrid();
|
||
var
|
||
fwhere, Pwhere: string;
|
||
begin
|
||
MovePanel2.Left := (self.Width - MovePanel2.Width) div 2;
|
||
MovePanel2.Visible := True;
|
||
MovePanel2.Refresh;
|
||
Pwhere := SGetFilters(Panel1, 1, 2);
|
||
|
||
try
|
||
ADOQueryMain.DisableControls;
|
||
with ADOQueryMain do
|
||
begin
|
||
Filtered := False;
|
||
Close;
|
||
sql.Clear;
|
||
case cxTabControl1.TabIndex of
|
||
0:
|
||
begin
|
||
if trim(Pwhere) <> '' then
|
||
fwhere := fwhere + ' where ' + trim(Pwhere);
|
||
sql.Add('select * from ( ');
|
||
sql.Add('select SUM(A.KGQty) KGQty,SUM(A.Qty) Qty,SUM(A.NetKGQty) NETKGQty,count(A.MJID) JQty,A.QtyUnit ');
|
||
sql.Add(',B.CustomerNoName,sum(Qty-a.kongjia)jinchang');
|
||
sql.Add('from CK_BanCP_CR A inner join JYOrder_Main B on A.MainId=B.MainId ');
|
||
sql.Add('inner join JYOrder_Sub C on A.SubId=C.SubId where A.CRFlag=''<27><><EFBFBD><EFBFBD>'' ');
|
||
sql.Add(' and A.CRTime>=' + quotedstr(FormatDateTime('yyyy-MM-dd HH:mm:ss', StrToDateTime(BegDate.text))));
|
||
sql.Add(' and A.CRTime<' + quotedstr(FormatDateTime('yyyy-MM-dd HH:mm:ss', StrToDateTime(endDate.text))));
|
||
sql.Add(' group by B.CustomerNoName,A.QtyUnit');
|
||
sql.Add(' ) AA ' + fwhere);
|
||
SQL.Add(' ORDER BY DBO.getPinYin(CustomerNoName) ');
|
||
end;
|
||
1:
|
||
begin
|
||
if trim(Pwhere) <> '' then
|
||
fwhere := fwhere + ' where ' + trim(Pwhere);
|
||
sql.Add('select * from ( ');
|
||
sql.Add('select convert(varchar(10),A.CRTime,120) CRTime,sum(a.Qty-a.kongjia)jinchang,SUM(A.KGQty) KGQty,SUM(A.Qty) Qty,SUM(A.NetKGQty) NetKGQty,count(A.MJID) JQty,A.QtyUnit,A.ganghao ');
|
||
sql.Add(' ,B.CustomerNoName,B.ConNo,B.YWY,B.OrderNo,B.MPRTCode,B.MPRTCodeName,B.MPRTSpec,PRTColor=isnull(jycolor,PRTColor) ');
|
||
sql.Add(' ,a.mainid,A.MJMF,A.MJKZ,A.APID,A.CKOrdNo ');
|
||
sql.Add(' ,D.LCKNote ');
|
||
sql.Add('from CK_BanCP_CR A inner join JYOrder_Main B on A.MainId=B.MainId ');
|
||
sql.Add('inner join JYOrder_Sub C on A.SubId=C.SubId ');
|
||
sql.Add('inner join JYOrder_Car D on D.CarNo=A.APID ');
|
||
sql.Add(' where A.CRFlag=''<27><><EFBFBD><EFBFBD>'' ');
|
||
sql.Add(' and A.CRTime>=' + quotedstr(FormatDateTime('yyyy-MM-dd HH:mm:ss', StrToDateTime(BegDate.text))));
|
||
sql.Add(' and A.CRTime<' + quotedstr(FormatDateTime('yyyy-MM-dd HH:mm:ss', StrToDateTime(endDate.text))));
|
||
sql.Add(' group by a.mainid,convert(varchar(10),A.CRTime,120),B.CustomerNoName,D.LCKNote,A.QtyUnit,A.ganghao,B.ConNo,B.YWY,B.OrderNo,B.MPRTCode,B.MPRTCodeName ,A.MJMF,A.MJKZ ,B.MPRTSpec,isnull(jycolor,PRTColor) ,A.APID,A.CKOrdNo ');
|
||
sql.Add(' ) AA ' + fwhere);
|
||
SQL.Add(' ORDER BY DBO.getPinYin(CustomerNoName) ');
|
||
end;
|
||
|
||
2:
|
||
begin
|
||
if IsJYTime.Checked then
|
||
begin
|
||
fwhere := ' where CRTime>=' + quotedstr(FormatDateTime('yyyy-MM-dd HH:mm:ss', StrToDateTime(BegDate.text)));
|
||
fwhere := fwhere + ' and CRTime<' + quotedstr(FormatDateTime('yyyy-MM-dd HH:mm:ss', StrToDateTime(endDate.text)));
|
||
if trim(Pwhere) <> '' then
|
||
fwhere := fwhere + ' and ' + trim(Pwhere);
|
||
end
|
||
else
|
||
begin
|
||
if trim(Pwhere) <> '' then
|
||
fwhere := fwhere + ' where ' + trim(Pwhere);
|
||
end;
|
||
|
||
sql.Add('exec P_Page_FinishClothCK ');
|
||
sql.Add('@pageIndex=' + inttostr(CurrentPage));
|
||
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
||
sql.Add(',@criteria= ' + quotedstr(fwhere));
|
||
end;
|
||
end;
|
||
// ShowMessage(sql.Text);
|
||
Open;
|
||
end;
|
||
SCreateCDS20(ADOQueryMain, CDS_Main);
|
||
SInitCDSData20(ADOQueryMain, CDS_Main);
|
||
if cxTabControl1.TabIndex = 1 then
|
||
CDS_Main.Locate('APID', FAPID, []);
|
||
if cxTabControl1.TabIndex = 2 then
|
||
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(CDS_Main.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
||
MovePanel2.Visible := false;
|
||
finally
|
||
ADOQueryMain.EnableControls;
|
||
MovePanel2.Visible := false;
|
||
end;
|
||
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.TBRafreshClick(Sender: TObject);
|
||
begin
|
||
CurrentPage := 1;
|
||
SetStatus();
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.ConNoMChange(Sender: TObject);
|
||
begin
|
||
if ADOQueryMain.Active then
|
||
begin
|
||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.TBCloseClick(Sender: TObject);
|
||
begin
|
||
if cxTabControl1.TabIndex = 0 then
|
||
begin
|
||
WriteCxGrid(trim(self.Caption) + '1', Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
end
|
||
else if cxTabControl1.TabIndex = 1 then
|
||
begin
|
||
WriteCxGrid(trim(self.Caption) + '2', Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
end
|
||
else
|
||
begin
|
||
WriteCxGrid(trim(self.Caption) + '3', Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
end;
|
||
Close;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.FormShow(Sender: TObject);
|
||
begin
|
||
|
||
CurrentPage := 1;
|
||
RecordsNumber := 500;
|
||
if canshu1 = '<27>ͻ<EFBFBD><CDBB><EFBFBD>ѯ' then
|
||
begin
|
||
with ADOQueryTemp do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('SELECT * FROM Company WHERE COTYPE=''<27>ͻ<EFBFBD>'' and valid=''Y'' and isnull(cohrname,coname)=' + QuotedStr(Trim(DName)));
|
||
Open;
|
||
end;
|
||
if ADOQueryTemp.IsEmpty = False then
|
||
begin
|
||
CustomerNoName.Text := ADOQueryTemp.FIELDBYNAME('coNAME').AsString;
|
||
fkhname := ADOQueryTemp.FIELDBYNAME('coNAME').AsString;
|
||
CustomerNoName.Enabled := False;
|
||
end;
|
||
end;
|
||
SetStatus();
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.TBExportClick(Sender: TObject);
|
||
begin
|
||
if ADOQueryMain.IsEmpty then
|
||
exit;
|
||
SelExportData(Tv1, ADOQueryMain, '');
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.N1Click(Sender: TObject);
|
||
begin
|
||
SelOKNo(CDS_Main, True);
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.N2Click(Sender: TObject);
|
||
begin
|
||
SelOKNo(CDS_Main, False);
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.TBCKCXClick(Sender: TObject);
|
||
var
|
||
FFMainId, FPrice, strsql, wsql: string;
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
Exit;
|
||
if cxTabControl1.TabIndex <> 2 then
|
||
Exit;
|
||
if CDS_Main.Locate('SSel', True, []) = False then
|
||
begin
|
||
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
// with CDS_Main do
|
||
// begin
|
||
// while CDS_Main.Locate('SSel', True, []) = True do
|
||
// begin
|
||
// if wsql <> '' then
|
||
// begin
|
||
// wsql := wsql + ',' + QuotedStr(Trim(CDS_Main.fieldbyname('CKOrdNo').AsString));
|
||
// end
|
||
// else
|
||
// begin
|
||
// wsql := QuotedStr(Trim(CDS_Main.fieldbyname('CKOrdNo').AsString));
|
||
// end;
|
||
//// CDS_Main.Delete;
|
||
// end;
|
||
//
|
||
// end;
|
||
// with ADOQueryTemp do
|
||
// begin
|
||
// Close;
|
||
// sql.Clear;
|
||
// SQL.Add('SELECT * FROM YF_MONEY_CR_SUB b WHERE YFPZNO in (' + wsql + ')');
|
||
// Open;
|
||
// end;
|
||
// if ADOQueryTemp.IsEmpty = FALSE then
|
||
// begin
|
||
// Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD>ֹɾ<D6B9><C9BE><EFBFBD><EFBFBD>', '<27><>ʾ', 0);
|
||
// Exit;
|
||
// end;
|
||
if Application.MessageBox('ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
||
Exit;
|
||
MovePanel2.Visible := True;
|
||
MovePanel2.Refresh;
|
||
|
||
try
|
||
ADOQueryCmd.Connection.BeginTrans;
|
||
CDS_Main.DisableControls;
|
||
with CDS_Main do
|
||
begin
|
||
while CDS_Main.Locate('SSel', True, []) = True do
|
||
begin
|
||
begin
|
||
if CDS_Main.fieldbyname('iscw').AsBoolean = True then
|
||
begin
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>', '<27><>ʾ', 0);
|
||
MovePanel2.Visible := False;
|
||
CDS_Main.EnableControls;
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
Exit;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('Update CK_BanCP_CR Set CRFlag=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',CRType='''',CRTime=NULL,CRNote='''',CKOrdNo='''',PRICE=0 ');
|
||
sql.Add(' where MJID=''' + Trim(CDS_Main.fieldbyname('MJID').AsString) + '''');
|
||
sql.Add(' and CRFlag=''<27><><EFBFBD><EFBFBD>''');
|
||
|
||
sql.Add(' UPdate CK_BanCP_KC Set KCValid=''Y'' ');
|
||
SQL.Add(' where MJID=''' + Trim(CDS_Main.fieldbyname('MJID').AsString) + '''');
|
||
|
||
sql.Add(' Update WFB_MJJY Set MJStr2=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' where MJID=''' + Trim(CDS_Main.fieldbyname('MJID').AsString) + ''' ');
|
||
|
||
ExecSQL;
|
||
end;
|
||
|
||
strsql := '<27><>ID<49><44>' + trim(CDS_Main.FieldByName('MJID').AsString) + ' <20><><EFBFBD>ⵥ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('CKOrdNo').AsString);
|
||
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
||
sql.Add(' ' + quotedstr(trim(DName)));
|
||
sql.Add(',getdate() ');
|
||
sql.Add(',' + quotedstr(trim(self.Caption)));
|
||
sql.Add(',' + quotedstr(trim('<27><><EFBFBD><EFBFBD><E2B3B7>')));
|
||
sql.Add(',' + quotedstr(trim(strsql)));
|
||
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
||
sql.Add(')');
|
||
ExecSQL;
|
||
end;
|
||
|
||
// with ADOQueryCmd do
|
||
// begin
|
||
// Close;
|
||
// sql.Clear;
|
||
// sql.Add('exec P_Update_FHSQ @CKOrdNo=' + quotedstr(trim(CDS_Main.FieldByName('CKOrdNo').AsString)));
|
||
// ExecSQL;
|
||
// end;
|
||
CDS_Main.Delete;
|
||
end;
|
||
end;
|
||
end;
|
||
CDS_Main.EnableControls;
|
||
|
||
ADOQueryCmd.Connection.CommitTrans;
|
||
MovePanel2.Visible := False;
|
||
Exit;
|
||
except
|
||
MovePanel2.Visible := False;
|
||
CDS_Main.EnableControls;
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
||
end;
|
||
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.orderNoKeyPress(Sender: TObject; var Key: Char);
|
||
begin
|
||
if Key = #13 then
|
||
begin
|
||
CurrentPage := 1;
|
||
InitGrid();
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||
var
|
||
Tabint: integer;
|
||
begin
|
||
Tabint := cxTabControl1.TabIndex;
|
||
case Tabint of
|
||
0:
|
||
begin
|
||
AssignmentControls(Panel1, CDS_Main, '0');
|
||
cxTabControl1.TabIndex := 1;
|
||
end;
|
||
1:
|
||
begin
|
||
FAPID := CDS_Main.fieldbyname('APID').AsString;
|
||
// AssignmentControls(Panel1, CDS_Main, '1');
|
||
CKOrdNo.Text := CDS_Main.fieldbyname('CKORDNO').AsString;
|
||
cxTabControl1.TabIndex := 2;
|
||
end;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.Tv1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||
begin
|
||
FLeft := X;
|
||
FTop := Y;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.BTNPClick(Sender: TObject);
|
||
begin
|
||
if CurrentPage < CDS_Main.FieldByName('TotalCount').AsInteger / RecordsNumber then
|
||
CurrentPage := CurrentPage + 1;
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.BTLPClick(Sender: TObject);
|
||
begin
|
||
if CurrentPage > 1 then
|
||
CurrentPage := CurrentPage - 1;
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.TCBNORChange(Sender: TObject);
|
||
begin
|
||
RecordsNumber := StrToInt(TCBNOR.Text);
|
||
CurrentPage := 1;
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.CPTypeChange(Sender: TObject);
|
||
begin
|
||
CurrentPage := 1;
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.ToolButton2Click(Sender: TObject);
|
||
begin
|
||
frmSysLogHelp := TfrmSysLogHelp.create(self);
|
||
with frmSysLogHelp do
|
||
begin
|
||
fModel := self.caption;
|
||
// facction:='<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>ɾ<EFBFBD><C9BE>';
|
||
showmodal;
|
||
free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.ToolButton1Click(Sender: TObject);
|
||
var
|
||
fPrintFile: string;
|
||
Txt, fImagePath: string;
|
||
Moudle: THandle;
|
||
Makebar: TMakebar;
|
||
Mixtext: TMixtext;
|
||
fckorderno: string;
|
||
// kj,kjw:DOUBLE;
|
||
begin
|
||
|
||
if CDS_Main.IsEmpty then
|
||
Exit;
|
||
// if cxTabControl1.TabIndex = 0 then
|
||
// begin
|
||
// application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD>ӡ<EFBFBD>뵥<EFBFBD><EBB5A5>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
||
// exit;
|
||
// end;
|
||
ExportFtErpFile(ComboBox1.Text + '.rmf', ADOQueryTemp);
|
||
|
||
with CDS_Main do
|
||
begin
|
||
|
||
if (ComboBox1.Text = '<27>ֿ<EFBFBD><D6BF>뵥<EFBFBD><D7BA><CDB9><EFBFBD>') then
|
||
begin
|
||
with ADOQueryPrint do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add(' exec P_Print_CKMDWSQ2F_5 ');
|
||
SQL.Add(' @CKOrdNO=''' + Trim(Trim(CDS_Main.fieldbyname('CKOrdNO').AsString)) + '''');
|
||
SQL.Add(' ,@kj=' + FloatToStr(StrToFloatDef(Edit1.text, 0)));
|
||
SQL.Add(' ,@kjw=' + FloatToStr(StrToFloatDef(Edit2.text, 0)));
|
||
// ShowMessage(SQL.text);
|
||
Open;
|
||
end;
|
||
end;
|
||
|
||
if (ComboBox1.Text = '<27>ֿ<EFBFBD><D6BF>뵥<EFBFBD><EBB5A5><EFBFBD><EFBFBD>') or (ComboBox1.Text = '<27>ֿ<EFBFBD><D6BF>뵥<EFBFBD><EBB5A5><EFBFBD><EFBFBD>') then
|
||
begin
|
||
with ADOQueryPrint do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add(' exec P_Print_CKMDWSQ2F_10 ');
|
||
SQL.Add(' @CKOrdNO=''' + Trim(Trim(CDS_Main.fieldbyname('CKOrdNO').AsString)) + '''');
|
||
SQL.Add(' ,@kj=' + FloatToStr(StrToFloatDef(Edit1.text, 0)));
|
||
SQL.Add(' ,@kjw=' + FloatToStr(StrToFloatDef(Edit2.text, 0)));
|
||
|
||
Open;
|
||
end;
|
||
end;
|
||
if (ComboBox1.Text = '<27>ֿ<EFBFBD><D6BF>뵥<EFBFBD><EBB5A5><EFBFBD><EFBFBD>(16<31><36>)') or (ComboBox1.Text = '<27>ֿ<EFBFBD><D6BF>뵥<EFBFBD><EBB5A5><EFBFBD><EFBFBD>(16<31><36>)') then
|
||
begin
|
||
with ADOQueryPrint do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add(' exec P_Print_CKMD16 ');
|
||
SQL.Add(' @CKOrdNO=''' + Trim(Trim(CDS_Main.fieldbyname('CKOrdNO').AsString)) + '''');
|
||
|
||
Open;
|
||
end;
|
||
end;
|
||
if (ComboBox1.Text = '<27>ֿ<EFBFBD><D6BF>뵥<EFBFBD><D7BA><CDB9><EFBFBD>(16<31><36>)') then
|
||
begin
|
||
with ADOQueryPrint do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add(' exec P_Print_CKMD16_5 ');
|
||
SQL.Add(' @CKOrdNO=''' + Trim(Trim(CDS_Main.fieldbyname('CKOrdNO').AsString)) + '''');
|
||
|
||
Open;
|
||
end;
|
||
end;
|
||
if (ComboBox1.Text = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵥') or (ComboBox1.Text = '<27><><EFBFBD><EFBFBD>ë<EFBFBD><C3AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵥') or (ComboBox1.Text = '<27><><EFBFBD><EFBFBD>ë<EFBFBD><C3AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵥') then
|
||
begin
|
||
with ADOQueryPrint do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add(' exec P_PRINT_CKMD_H ');
|
||
SQL.Add(' @Filtration=''' + Trim(Trim(CDS_Main.fieldbyname('CKOrdNO').AsString)) + '''');
|
||
|
||
Open;
|
||
end;
|
||
end;
|
||
if (ComboBox1.Text = '<27><><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD><EBB5A5><EFBFBD>ֲ<EFBFBD>Ʒ') then
|
||
begin
|
||
with ADOQueryPrint do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add(' exec P_PRINT_CKMD_H2 ');
|
||
SQL.Add(' @Filtration=''' + Trim(Trim(CDS_Main.fieldbyname('CKOrdNO').AsString)) + '''');
|
||
|
||
Open;
|
||
end;
|
||
end;
|
||
|
||
try
|
||
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
||
@Makebar := GetProcAddress(Moudle, 'Make');
|
||
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
||
Txt := Trim(ADOQueryPrint.fieldbyname('CKOrdNO').AsString);
|
||
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
||
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
||
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
||
if FileExists(fImagePath) then
|
||
DeleteFile(fImagePath);
|
||
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
||
except
|
||
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
||
exit;
|
||
end;
|
||
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + ComboBox1.Text + '.rmf';
|
||
if FileExists(fPrintFile) then
|
||
begin
|
||
RMVariables['QRBARCODE'] := fImagePath;
|
||
RMVariables['DMR'] := Trim(DName);
|
||
|
||
RMVariables['RKOrdID'] := Trim(CDS_Main.fieldbyname('CKOrdNO').AsString);
|
||
RM3.LoadFromFile(fPrintFile);
|
||
|
||
RM3.ShowReport;
|
||
end
|
||
else
|
||
begin
|
||
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
|
||
end;
|
||
|
||
//var
|
||
// fPrintFile, fPrintFile10, FMainID, FKHName, FFPNo: string;
|
||
//begin
|
||
// if CDS_Main.IsEmpty then
|
||
// Exit;
|
||
// if cxTabControl1.TabIndex <> 2 then
|
||
// Exit;
|
||
// ExportFtErpFile(trim(ComboBox1.Text) + '.rmf', ADOQueryTemp);
|
||
//
|
||
// if trim(ComboBox1.Text) = '<27><><EFBFBD><EFBFBD><EFBFBD>뵥1' then
|
||
// begin
|
||
// with ADOQueryTemp do
|
||
// begin
|
||
//
|
||
// Close;
|
||
// sql.Clear;
|
||
// sql.add('exec P_Print_CKMDWSQ1 ');
|
||
// sql.add('@CKOrdNo=' + quotedstr(Trim(Trim(CDS_Main.fieldbyname('CKOrdNo').AsString))));
|
||
//// showmessage(SQL.Text);
|
||
// Open;
|
||
// end;
|
||
// SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
||
// SInitCDSData20(ADOQueryTemp, CDS_PRT);
|
||
// end;
|
||
// if trim(ComboBox1.Text) = '<27><>ˮ<EFBFBD>뵥2' then
|
||
// begin
|
||
// with ADOQueryTemp do
|
||
// begin
|
||
//
|
||
// Close;
|
||
// sql.Clear;
|
||
// sql.add('exec P_Print_CKMDWSQ2 ');
|
||
// sql.add('@CKOrdNo=' + quotedstr(Trim(Trim(CDS_Main.fieldbyname('CKOrdNo').AsString))));
|
||
// Open;
|
||
// end;
|
||
// SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
||
// SInitCDSData20(ADOQueryTemp, CDS_PRT);
|
||
// end;
|
||
// if trim(ComboBox1.Text) = '<27><><EFBFBD><EFBFBD><EFBFBD>뵥' then
|
||
// begin
|
||
// with ADOQueryTemp do
|
||
// begin
|
||
//
|
||
// Close;
|
||
// sql.Clear;
|
||
// sql.add('exec P_Print_CKMDWSQ3 ');
|
||
// sql.add('@CKOrdNo=' + quotedstr(Trim(Trim(CDS_Main.fieldbyname('CKOrdNo').AsString))));
|
||
// Open;
|
||
// end;
|
||
// SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
||
// SInitCDSData20(ADOQueryTemp, CDS_PRT);
|
||
// end;
|
||
// if trim(ComboBox1.Text) = '<27><>ɫ<EFBFBD>뵥' then
|
||
// begin
|
||
// with ADOQueryTemp do
|
||
// begin
|
||
//
|
||
// Close;
|
||
// sql.Clear;
|
||
// sql.add('exec P_Print_CKMDWSQ4 ');
|
||
// sql.add('@CKOrdNo=' + quotedstr(Trim(Trim(CDS_Main.fieldbyname('CKOrdNo').AsString))));
|
||
// Open;
|
||
// end;
|
||
// SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
||
// SInitCDSData20(ADOQueryTemp, CDS_PRT);
|
||
// end;
|
||
// if (trim(ComboBox1.Text) = '<27><><EFBFBD><EFBFBD><EFBFBD>뵥') or (trim(ComboBox1.Text) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵥') then
|
||
// begin
|
||
// with ADOQueryTemp do
|
||
// begin
|
||
//
|
||
// Close;
|
||
// sql.Clear;
|
||
// sql.add('exec P_Print_CKMDWSQ5 ');
|
||
// sql.add('@CKOrdNo=' + quotedstr(Trim(Trim(CDS_Main.fieldbyname('CKOrdNo').AsString))));
|
||
// Open;
|
||
// end;
|
||
// SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
||
// SInitCDSData20(ADOQueryTemp, CDS_PRT);
|
||
// end;
|
||
// if trim(ComboBox1.Text) = '<27><><EFBFBD><EFBFBD><EFBFBD>뵥' then
|
||
// begin
|
||
// with ADOQueryTemp do
|
||
// begin
|
||
// Close;
|
||
// sql.Clear;
|
||
// sql.add('exec P_Print_CKMDWSQ6 ');
|
||
// sql.add('@CKOrdNo=' + quotedstr(Trim(Trim(CDS_Main.fieldbyname('CKOrdNo').AsString))));
|
||
// Open;
|
||
// end;
|
||
// SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
||
// SInitCDSData20(ADOQueryTemp, CDS_PRT);
|
||
// end;
|
||
// fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ComboBox1.Text) + '.rmf';
|
||
// if FileExists(fPrintFile) then
|
||
// begin
|
||
// RM3.LoadFromFile(fPrintFile);
|
||
// RMVariables['Filler'] := trim(DName);
|
||
// RM3.ShowReport;
|
||
// end
|
||
// else
|
||
// begin
|
||
// Application.MessageBox(PChar('û<><C3BB><EFBFBD>ҵ<EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
||
// end;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.cxTabControl1Change(Sender: TObject);
|
||
begin
|
||
SetStatus();
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.N3Click(Sender: TObject);
|
||
begin
|
||
Clipboard.SetTextBuf(PChar(Trim(CDS_Main.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString)));
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.CustomerNoNameKeyPress(Sender: TObject; var Key: Char);
|
||
begin
|
||
if Key = #13 then
|
||
begin
|
||
CurrentPage := 1;
|
||
InitGrid();
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.EndDateChange(Sender: TObject);
|
||
begin
|
||
CurrentPage := 1;
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.BegDateChange(Sender: TObject);
|
||
begin
|
||
CurrentPage := 1;
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmCKProductBCPOutList.v1Column8PropertiesEditValueChanged(Sender: TObject);
|
||
var
|
||
mvalue, FFieldName: string;
|
||
begin
|
||
|
||
mvalue := TcxTextEdit(Sender).EditingText;
|
||
FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||
with CDS_Main do
|
||
begin
|
||
Edit;
|
||
FieldByName(FFieldName).Value := mvalue;
|
||
Post;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add('update JYOrder_Car set ' + FFieldName + '=' + quotedstr(Trim(mvalue)));
|
||
sql.Add('where CarNo=' + quotedstr(Trim(CDS_Main.fieldbyname('APID').AsString)));
|
||
ExecSQL;
|
||
end;
|
||
Tv1.Controller.EditingController.ShowEdit();
|
||
end;
|
||
|
||
end.
|
||
|