556 lines
15 KiB
ObjectPascal
556 lines
15 KiB
ObjectPascal
unit U_BpRklist;
|
||
|
||
interface
|
||
|
||
uses
|
||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||
Dialogs, ComCtrls, ToolWin, StdCtrls, ExtCtrls, cxStyles, cxCustomData,
|
||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,
|
||
cxButtonEdit, cxDropDownEdit, cxGridLevel, cxGridCustomTableView,
|
||
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
|
||
cxGrid, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, cxPC,
|
||
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu;
|
||
|
||
type
|
||
TfrmBpRklist = class(TForm)
|
||
ToolBar1: TToolBar;
|
||
TBRafresh: TToolButton;
|
||
TBFind: TToolButton;
|
||
TBAdd: TToolButton;
|
||
TBEdit: TToolButton;
|
||
TBDel: TToolButton;
|
||
TBExport: TToolButton;
|
||
TBPrint: TToolButton;
|
||
TBClose: TToolButton;
|
||
Panel1: TPanel;
|
||
Label1: TLabel;
|
||
BegDate: TDateTimePicker;
|
||
EndDate: TDateTimePicker;
|
||
cxGrid1: TcxGrid;
|
||
Tv1: TcxGridDBTableView;
|
||
v1P_CodeName: TcxGridDBColumn;
|
||
v1P_SPEC: TcxGridDBColumn;
|
||
v1P_MF: TcxGridDBColumn;
|
||
v1P_KZ: TcxGridDBColumn;
|
||
v1RollNum: TcxGridDBColumn;
|
||
v1Qty: TcxGridDBColumn;
|
||
v1QtyUnit: TcxGridDBColumn;
|
||
v1Note: TcxGridDBColumn;
|
||
cxGrid1Level1: TcxGridLevel;
|
||
v1CRType: TcxGridDBColumn;
|
||
v1CRTime: TcxGridDBColumn;
|
||
v1Filler: TcxGridDBColumn;
|
||
v1FillTime: TcxGridDBColumn;
|
||
Label2: TLabel;
|
||
Label3: TLabel;
|
||
Label4: TLabel;
|
||
P_CodeName: TEdit;
|
||
P_Code: TEdit;
|
||
CRType: TComboBox;
|
||
Label5: TLabel;
|
||
ADOQueryCmd: TADOQuery;
|
||
ADOQueryTmp: TADOQuery;
|
||
DataSource1: TDataSource;
|
||
CDS_Main: TClientDataSet;
|
||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||
v1CPType: TcxGridDBColumn;
|
||
ckName: TComboBox;
|
||
Label6: TLabel;
|
||
v1P_Color: TcxGridDBColumn;
|
||
v1P_Code: TcxGridDBColumn;
|
||
v1INoutNo: TcxGridDBColumn;
|
||
Label7: TLabel;
|
||
ywy: TEdit;
|
||
v1ywy: TcxGridDBColumn;
|
||
v1Column1: TcxGridDBColumn;
|
||
kuwei: TEdit;
|
||
Label8: TLabel;
|
||
v1Column3: TcxGridDBColumn;
|
||
v1Column4: TcxGridDBColumn;
|
||
v1Column2: TcxGridDBColumn;
|
||
v1Column5: TcxGridDBColumn;
|
||
cxTabControl1: TcxTabControl;
|
||
v1editer: TcxGridDBColumn;
|
||
v1editTime: TcxGridDBColumn;
|
||
v1DefStr6: TcxGridDBColumn;
|
||
Label9: TLabel;
|
||
factoryName: TEdit;
|
||
P_Color: TEdit;
|
||
Label10: TLabel;
|
||
v1Column8: TcxGridDBColumn;
|
||
Label11: TLabel;
|
||
P_HX: TEdit;
|
||
Tchk: TToolButton;
|
||
Tnochk: TToolButton;
|
||
v1Column9: TcxGridDBColumn;
|
||
Tv1Column1: TcxGridDBColumn;
|
||
Tv1Column2: TcxGridDBColumn;
|
||
Tv1Column3: TcxGridDBColumn;
|
||
Tv1Column4: TcxGridDBColumn;
|
||
Label12: TLabel;
|
||
FromOrderNo: TEdit;
|
||
btnDelCX: TToolButton;
|
||
btnDelData: TToolButton;
|
||
Tv1Column5: TcxGridDBColumn;
|
||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||
procedure FormDestroy(Sender: TObject);
|
||
procedure TBAddClick(Sender: TObject);
|
||
procedure P_CodeNameChange(Sender: TObject);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure FormCreate(Sender: TObject);
|
||
procedure TBCloseClick(Sender: TObject);
|
||
procedure TBEditClick(Sender: TObject);
|
||
procedure TBDelClick(Sender: TObject);
|
||
procedure TBRafreshClick(Sender: TObject);
|
||
procedure TBPrintClick(Sender: TObject);
|
||
procedure TBExportClick(Sender: TObject);
|
||
procedure cxTabControl1Change(Sender: TObject);
|
||
procedure TchkClick(Sender: TObject);
|
||
procedure TnochkClick(Sender: TObject);
|
||
procedure btnDelDataClick(Sender: TObject);
|
||
procedure btnDelCXClick(Sender: TObject);
|
||
procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
||
private
|
||
procedure InitGrid();
|
||
procedure SetComboBox();
|
||
procedure Setstatus();
|
||
{ Private declarations }
|
||
public
|
||
fCKName: string;
|
||
canshu1: string;
|
||
{ Public declarations }
|
||
end;
|
||
|
||
var
|
||
frmBpRklist: TfrmBpRklist;
|
||
|
||
implementation
|
||
|
||
uses
|
||
U_DataLink, U_Fun10, U_ZDYHelp, U_BpRk, U_BpSmRk;
|
||
{$R *.dfm}
|
||
|
||
procedure TfrmBpRklist.SetStatus();
|
||
begin
|
||
TBedit.Visible := false;
|
||
Tbdel.Visible := false;
|
||
Tchk.Visible := false;
|
||
Tnochk.Visible := false;
|
||
btnDelData.Visible := false;
|
||
btnDelCX.Visible := false;
|
||
case cxTabControl1.TabIndex of
|
||
0:
|
||
begin
|
||
TBedit.Visible := true;
|
||
Tbdel.Visible := true;
|
||
if trim(canshu1) <> '' then
|
||
begin
|
||
Tchk.Visible := true;
|
||
end;
|
||
end;
|
||
1:
|
||
begin
|
||
if trim(canshu1) <> '' then
|
||
begin
|
||
Tnochk.Visible := true;
|
||
end;
|
||
end;
|
||
2:
|
||
begin
|
||
// tbcdel.Visible:=true;
|
||
end;
|
||
3:
|
||
begin
|
||
btnDelData.Visible := true;
|
||
btnDelCX.Visible := true;
|
||
end;
|
||
end;
|
||
|
||
end;
|
||
|
||
procedure TfrmBpRklist.SetComboBox();
|
||
begin
|
||
ckName.Items.Clear;
|
||
with adoQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select * from KH_ZDY where Type=''YPCK'' ');
|
||
if trim(fCKName) <> '' then
|
||
sql.Add('and zdyName=' + quotedstr(trim(fCKName)));
|
||
open;
|
||
while not eof do
|
||
begin
|
||
ckName.Items.Add(trim(fieldbyname('zdyName').AsString));
|
||
next;
|
||
end;
|
||
end;
|
||
if ckName.Items.Count > 0 then
|
||
ckName.ItemIndex := 0;
|
||
|
||
CRType.Items.Clear;
|
||
CRType.Items.Add('');
|
||
with adoQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select * from KH_ZDY where Type=''YPRKTYPE''');
|
||
if trim(fCKName) <> '' then
|
||
sql.Add('and note=' + quotedstr(trim(fCKName)));
|
||
open;
|
||
while not eof do
|
||
begin
|
||
CRType.Items.Add(trim(fieldbyname('zdyName').AsString));
|
||
next;
|
||
end;
|
||
end;
|
||
if CRType.Items.Count > 0 then
|
||
CRType.ItemIndex := 0;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.InitGrid();
|
||
begin
|
||
try
|
||
with adoqueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select A.* ');
|
||
sql.Add(',kHCPcode2=(select kHCPcode2 from cp_ydang b where b.cyno=a.P_Code)');
|
||
sql.Add('from YP_InOut A where CRTime>=''' + formatdateTime('yyyy-MM-dd', begdate.Date) + ''' ');
|
||
sql.Add('and CRTime<''' + formatdateTime('yyyy-MM-dd', enddate.Date + 1) + ''' ');
|
||
sql.Add('and CRFlag=''<27><><EFBFBD><EFBFBD>'' ');
|
||
// sql.Add('and valid=''Y'' ');
|
||
|
||
case cxTabControl1.TabIndex of
|
||
0:
|
||
begin
|
||
sql.Add('and valid=''Y'' and A.status=''0'' ');
|
||
end;
|
||
1:
|
||
begin
|
||
sql.Add('and valid=''Y'' and A.status=''1'' ');
|
||
end;
|
||
2:
|
||
begin
|
||
sql.Add('and valid=''Y'' ');
|
||
end;
|
||
3:
|
||
begin
|
||
sql.Add('and valid=''N'' ');
|
||
end;
|
||
|
||
end;
|
||
sql.add('order by filltime desc');
|
||
open;
|
||
end;
|
||
SCreateCDS20(adoqueryTmp, CDS_Main);
|
||
SInitCDSData20(adoqueryTmp, CDS_Main);
|
||
finally
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.FormClose(Sender: TObject; var Action: TCloseAction);
|
||
begin
|
||
|
||
Action := cafree;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.FormDestroy(Sender: TObject);
|
||
begin
|
||
frmBpRklist := nil;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.TBAddClick(Sender: TObject);
|
||
begin
|
||
frmbpRk := TfrmbpRk.create(self);
|
||
with frmbpRk do
|
||
begin
|
||
fkeyNo := '';
|
||
fType := 0;
|
||
fckName := self.fckName;
|
||
if showmodal = 1 then
|
||
begin
|
||
TBRafresh.Click;
|
||
self.CDS_Main.Locate('crNo', trim(fkeyNo), []);
|
||
end;
|
||
free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.P_CodeNameChange(Sender: TObject);
|
||
begin
|
||
if ADOQueryTmp.Active = False then
|
||
Exit;
|
||
SDofilter(ADOQueryTmp, SGetFilters(Panel1, 1, 2));
|
||
SCreateCDS20(ADOQueryTmp, CDS_Main);
|
||
SInitCDSData20(ADOQueryTmp, CDS_Main);
|
||
end;
|
||
|
||
procedure TfrmBpRklist.FormShow(Sender: TObject);
|
||
begin
|
||
readCxGrid(self.Caption, Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
SetComboBox();
|
||
SetStatus();
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmBpRklist.FormCreate(Sender: TObject);
|
||
begin
|
||
BegDate.Date := DServerDate - 7;
|
||
EndDate.Date := DServerDate;
|
||
cxGrid1.Align := alclient;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.TBCloseClick(Sender: TObject);
|
||
begin
|
||
writeCxGrid(self.Caption, Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
||
close;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.TBEditClick(Sender: TObject);
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
Exit;
|
||
|
||
frmbpRk := TfrmbpRk.create(self);
|
||
with frmbpRk do
|
||
begin
|
||
fkeyNo := self.cds_main.fieldbyname('CRNO').AsString;
|
||
fType := 1;
|
||
fckName := self.fckName;
|
||
if showmodal = 1 then
|
||
begin
|
||
TBRafresh.Click;
|
||
self.CDS_Main.Locate('crNo', trim(fkeyNo), []);
|
||
end;
|
||
free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.TBDelClick(Sender: TObject);
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
Exit;
|
||
|
||
if Application.MessageBox('<27>Ƿ<EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
||
Exit;
|
||
|
||
try
|
||
ADOQueryCmd.Connection.BeginTrans;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('update YP_InOut SET valid=''N'' ');
|
||
sql.Add(',editer=' + quotedstr(trim(DName)));
|
||
sql.Add(',edittime=getdate()');
|
||
SQL.Add('where CRID=' + quotedstr(CDS_Main.fieldbyname('CRID').AsString));
|
||
execsql;
|
||
end;
|
||
// with ADOQueryCmd do
|
||
// begin
|
||
// Close;
|
||
// sql.Clear;
|
||
// sql.Add('exec P_YP_Judge_KC ');
|
||
// Open;
|
||
// end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('select sum(A.Qty*A.CRQtyFlag)SL FROM YP_InOut A ');
|
||
|
||
sql.Add('where Valid=''Y'' AND isnull(FROMOrderno,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('FROMOrderno').AsString)));
|
||
sql.Add('and isnull(frommainid,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('frommainid').AsString)));
|
||
sql.Add('and isnull(fromsubid,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('fromsubid').AsString)));
|
||
sql.Add('and isnull(ywy,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('ywy').AsString)));
|
||
sql.Add('and isnull(Price,0)=' + Trim(CDS_Main.fieldbyname('Price').AsString));
|
||
sql.Add('and isnull(factoryname,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('factoryname').AsString)));
|
||
sql.Add('and isnull(P_Code,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('P_Code').AsString)));
|
||
sql.Add('and isnull(P_codename,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('P_codename').AsString)));
|
||
sql.Add('and isnull(P_spec,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('P_spec').AsString)));
|
||
sql.Add('and isnull(P_cf,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('P_cf').AsString)));
|
||
sql.Add('and isnull(P_Color,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('P_Color').AsString)));
|
||
sql.Add('and isnull(P_HX,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('P_HX').AsString)));
|
||
sql.Add('and isnull(QtyUnit,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('QtyUnit').AsString)));
|
||
sql.Add('and isnull(shazhi,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('shazhi').AsString)));
|
||
sql.Add('and isnull(kuwei,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('kuwei').AsString)));
|
||
sql.Add('and isnull(P_SKZ,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('P_SKZ').AsString)));
|
||
sql.Add('and isnull(YPCFD,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('YPCFD').AsString)));
|
||
sql.Add('and isnull(JuanHao,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('JuanHao').AsString)));
|
||
sql.Add('and isnull(ISCGPZ,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('ISCGPZ').AsString)));
|
||
sql.Add('and isnull(YPType,'''')=' + quotedstr(Trim(CDS_Main.fieldbyname('YPType').AsString)));
|
||
SQL.Add(' group by FROMOrderno ,frommainid,fromsubid,isnull(A.ywy,''''),A.Price,A.factoryname,A.P_Code,A.P_codename,A.P_spec,A.P_cf,A.P_Color,A.P_HX,A.QtyUnit,A.shazhi,A.kuwei,A.P_SMF,A.P_SKZ,YPCFD,JuanHao,ISCGPZ,YPType');
|
||
// ShowMessage(SQL.Text);
|
||
Open;
|
||
end;
|
||
if ADOQueryCmd.IsEmpty = false then
|
||
begin
|
||
if ADOQueryCmd.FieldByName('SL').VALUE < 0 then
|
||
begin
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
||
exit;
|
||
end;
|
||
end;
|
||
|
||
// if Trim(ADOQueryCmd.FieldByName('msg').AsString) = '<27>쳣' then
|
||
// begin
|
||
// ADOQueryCmd.Connection.RollbackTrans;
|
||
// Application.MessageBox('<27>Ѳ<EFBFBD><D1B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>', '<27><>ʾ', 0);
|
||
// exit;
|
||
// end;
|
||
|
||
ADOQueryCmd.Connection.CommitTrans;
|
||
CDS_Main.Delete;
|
||
except
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.TBRafreshClick(Sender: TObject);
|
||
begin
|
||
initGrid();
|
||
end;
|
||
|
||
procedure TfrmBpRklist.TBPrintClick(Sender: TObject);
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
Exit;
|
||
TcxGridToExcel(self.Caption, cxgrid1);
|
||
end;
|
||
|
||
procedure TfrmBpRklist.TBExportClick(Sender: TObject);
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
Exit;
|
||
TcxGridToExcel(self.Caption, cxgrid1);
|
||
end;
|
||
|
||
procedure TfrmBpRklist.cxTabControl1Change(Sender: TObject);
|
||
begin
|
||
SetStatus();
|
||
initGrid();
|
||
end;
|
||
|
||
procedure TfrmBpRklist.TchkClick(Sender: TObject);
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
exit;
|
||
try
|
||
with ADOQueryCmd do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('update YP_InOut SET status=''1'' ');
|
||
sql.Add('where CRNO=' + quotedstr(trim(CDS_Main.fieldbyname('CRNO').AsString)));
|
||
execsql;
|
||
end;
|
||
application.MessageBox('<27><><EFBFBD>˳ɹ<CBB3><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
||
TBRafresh.Click;
|
||
except
|
||
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.TnochkClick(Sender: TObject);
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
exit;
|
||
try
|
||
with ADOQueryCmd do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('update YP_InOut SET status=''0'' ');
|
||
sql.Add('where CRNO=' + quotedstr(trim(CDS_Main.fieldbyname('CRNO').AsString)));
|
||
execsql;
|
||
end;
|
||
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳ɹ<CBB3><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
||
TBRafresh.Click;
|
||
except
|
||
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.btnDelDataClick(Sender: TObject);
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
Exit;
|
||
|
||
if Application.MessageBox('<27>Ƿ<EFBFBD>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
||
Exit;
|
||
|
||
try
|
||
ADOQueryCmd.Connection.BeginTrans;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('delete YP_InOut where CRID=' + quotedstr(CDS_Main.fieldbyname('CRID').AsString));
|
||
execsql;
|
||
end;
|
||
|
||
ADOQueryCmd.Connection.CommitTrans;
|
||
CDS_Main.Delete;
|
||
except
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.btnDelCXClick(Sender: TObject);
|
||
begin
|
||
if CDS_Main.IsEmpty then
|
||
Exit;
|
||
|
||
if Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
||
Exit;
|
||
|
||
try
|
||
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
|
||
sql.Add('update YP_InOut SET valid=''Y'' ');
|
||
sql.Add(',editer=' + quotedstr(trim(DName)));
|
||
sql.Add(',edittime=getdate()');
|
||
SQL.Add('where CRNO=''' + Trim(CDS_Main.fieldbyname('CRNO').AsString) + ''' ');
|
||
|
||
execsql;
|
||
end;
|
||
TBRafresh.Click;
|
||
except
|
||
Application.MessageBox('<27><><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>ɾ<EFBFBD><C9BE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmBpRklist.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
||
var
|
||
FValue: string;
|
||
FBounds: TRect;
|
||
begin
|
||
FBounds := AViewInfo.Bounds;
|
||
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
|
||
begin
|
||
ACanvas.FillRect(FBounds);
|
||
ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1);
|
||
FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1);
|
||
InflateRect(FBounds, -1, -1); //Platform specific. May not work on Linux.
|
||
ACanvas.Font.Color := clBlack;
|
||
ACanvas.Brush.Style := bsClear;
|
||
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
|
||
ADone := True;
|
||
end;
|
||
end;
|
||
|
||
end.
|
||
|