544 lines
14 KiB
ObjectPascal
544 lines
14 KiB
ObjectPascal
|
|
unit U_JYXX;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
|||
|
|
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
|
|||
|
|
Vcl.ComCtrls, Vcl.ToolWin, cxGraphics, cxControls, cxLookAndFeels,
|
|||
|
|
cxLookAndFeelPainters, cxStyles, dxSkinsCore, dxSkinsDefaultPainters,
|
|||
|
|
cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, cxNavigator,
|
|||
|
|
dxDateRanges, Data.DB, cxDBData, cxCheckBox, cxTextEdit, cxGridLevel,
|
|||
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
|||
|
|
cxGridCustomView, cxGrid, dxBarBuiltInMenu, Data.Win.ADODB,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, Datasnap.DBClient, Vcl.StdCtrls,
|
|||
|
|
BtnEdit, dxSkinOffice2013White, dxSkinWXI, dxScrollbarAnnotations;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
Tfrmjyxx = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ScrollBox1: TScrollBox;
|
|||
|
|
ToolBar3: TToolBar;
|
|||
|
|
ToolButton6: TToolButton;
|
|||
|
|
ToolButton7: TToolButton;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
TV2: TcxGridDBTableView;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
DSLXR: TDataSource;
|
|||
|
|
CDS_LXR: TClientDataSet;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
TV2Column1: TcxGridDBColumn;
|
|||
|
|
TV2Column2: TcxGridDBColumn;
|
|||
|
|
TV2Column3: TcxGridDBColumn;
|
|||
|
|
TV2Column4: TcxGridDBColumn;
|
|||
|
|
TV2Column5: TcxGridDBColumn;
|
|||
|
|
TV2Column6: TcxGridDBColumn;
|
|||
|
|
TV2Column7: TcxGridDBColumn;
|
|||
|
|
TV2Column8: TcxGridDBColumn;
|
|||
|
|
TV2Column9: TcxGridDBColumn;
|
|||
|
|
TV2Column10: TcxGridDBColumn;
|
|||
|
|
TV2Column11: TcxGridDBColumn;
|
|||
|
|
TV2Column12: TcxGridDBColumn;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
state: TEdit;
|
|||
|
|
KDNumber: TEdit;
|
|||
|
|
addressee: TEdit;
|
|||
|
|
country: TEdit;
|
|||
|
|
Phone: TEdit;
|
|||
|
|
Zip: TEdit;
|
|||
|
|
Fulladdress: TEdit;
|
|||
|
|
Feeinformation: TEdit;
|
|||
|
|
exchangerate: TEdit;
|
|||
|
|
RMBamount: TEdit;
|
|||
|
|
YPexpenses: TEdit;
|
|||
|
|
freight: TEdit;
|
|||
|
|
JYdate: TDateTimePicker;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
TV2Column13: TcxGridDBColumn;
|
|||
|
|
ADOCmd: TADOQuery;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
numbering: TEdit;
|
|||
|
|
remark: TMemo;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
ADOTemp: TADOQuery;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
Service: TBtnEditC;
|
|||
|
|
client: TBtnEditC;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
procedure ToolButton6Click(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure ToolButton7Click(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure ServiceBtnDnClick(Sender: TObject);
|
|||
|
|
procedure ServiceBtnUpClick(Sender: TObject);
|
|||
|
|
procedure clientBtnDnClick(Sender: TObject);
|
|||
|
|
procedure clientBtnUpClick(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
procedure SetXH();
|
|||
|
|
function SaveData(): Boolean;
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
PState: string;
|
|||
|
|
Fmainid: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmjyxx: Tfrmjyxx;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun, U_ZDYHelp, U_CompanySel, U_ClothInfoSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
function Tfrmjyxx.SaveData(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxno: string;
|
|||
|
|
fconNO, fmxType, fDate: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////
|
|||
|
|
if Trim(Fmainid) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOTemp, maxno, 'CM', 'BS_JYGL_Main', 3, 1) = False then
|
|||
|
|
raise Exception.Create('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|||
|
|
|
|||
|
|
// fDate := FormatDateTime('yy', SGetServerDate(ADOTemp));
|
|||
|
|
// if trim(ConNo.Text) = '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
// begin
|
|||
|
|
if GetLSNo(ADOTemp, fconNO, 'YP', 'BS_JYGL_Main', 3, 1) = False then
|
|||
|
|
// if GetLSNo1(ADOTemp, fconNO, 'YS', 'BS_Contract_Main', 2, 1) = False then
|
|||
|
|
raise Exception.Create('ȡ<><C8A1><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|||
|
|
numbering.Text := fconNO;
|
|||
|
|
// end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxno := Trim(Fmainid);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from BS_JYGL_Main where mainid=''' + Trim(Fmainid) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(Fmainid) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
// FieldByName('status').Value := '0';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Updater').Value := Trim(DName);
|
|||
|
|
FieldByName('GXdate').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
FieldByName('mainid').Value := Trim(maxno);
|
|||
|
|
RTSetsavedata(ADOCmd, 'BS_JYGL_Main', ScrollBox1, 2);
|
|||
|
|
// FieldByName('BuyNo').Value := Trim(BuyName.TxtCode);
|
|||
|
|
// FieldByName('SellNo').Value := Sellname.TxtCode;
|
|||
|
|
// FieldByName('MiddleNo').Value := MiddleName.TxtCode;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
// with ADOCmd do
|
|||
|
|
// begin
|
|||
|
|
// Close;
|
|||
|
|
// sql.Clear;
|
|||
|
|
// sql.Add('select * from BS_Contract_Main where ConNo=''' + Trim(ConNo.Text) + '''');
|
|||
|
|
// Open;
|
|||
|
|
// end;
|
|||
|
|
// if ADOCmd.RecordCount > 1 then
|
|||
|
|
// raise Exception.Create('<27><>ͬ<EFBFBD><CDAC><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>');
|
|||
|
|
|
|||
|
|
Fmainid := Trim(maxno);
|
|||
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////
|
|||
|
|
///
|
|||
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> //////////////////////
|
|||
|
|
with CDS_LXR do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
maxno := Trim(CDS_LXR.fieldbyname('subid').AsString);
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from BS_JYGL_sub where subid=''' + Trim(maxno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if ADOCmd.IsEmpty then
|
|||
|
|
Append
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
RTSetSaveDataCDS(ADOCmd, Tv2, CDS_LXR, 'BS_JYGL_sub', 0);
|
|||
|
|
FieldByName('mainid').Value := Trim(Fmainid);
|
|||
|
|
FieldByName('subid').Value := Trim(maxno);
|
|||
|
|
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with CDS_LXR do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('subid').Value := Trim(maxno);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
|
|||
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
|
|||
|
|
Result := False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.ServiceBtnDnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBtnEditC(Sender).Text := '';
|
|||
|
|
TBtnEditC(Sender).TxtCode := '';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.ServiceBtnUpClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := self.Service.TxtCode;
|
|||
|
|
flagname := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.SetXH();
|
|||
|
|
var
|
|||
|
|
i: Integer;
|
|||
|
|
begin
|
|||
|
|
with CDS_LXR do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
i := 1;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
with CDS_LXR do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('XHNoTemp').Value := i;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
i := i + 1;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with CDS_LXR do
|
|||
|
|
begin
|
|||
|
|
CDS_LXR.IndexFieldNames := '';
|
|||
|
|
First;
|
|||
|
|
i := 1;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
with CDS_LXR do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('XH').Value := FieldByName('XHNoTemp').AsInteger;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
i := i + 1;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
CDS_LXR.IndexFieldNames := 'XH';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.clientBtnDnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBtnEditC(Sender).Text := '';
|
|||
|
|
TBtnEditC(Sender).TxtCode := '';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.clientBtnUpClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmCompanySel := TfrmCompanySel.Create(Application);
|
|||
|
|
with frmCompanySel do
|
|||
|
|
begin
|
|||
|
|
FCoType := '<27>ͻ<EFBFBD>';
|
|||
|
|
FCY := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
// if Self.FAuthority = '¼<><C2BC>' then
|
|||
|
|
// FAuthority := '<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
self.client.TxtCode := Trim(frmCompanySel.CDS_1.fieldbyname('CoCode').AsString);
|
|||
|
|
self.client.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoAbbrName').AsString);
|
|||
|
|
// self.SHfirmContact.Text := Trim(frmCompanySel.CDS_1.fieldbyname('Contacts').AsString);
|
|||
|
|
self.Phone.Text := Trim(frmCompanySel.CDS_1.fieldbyname('Phone').AsString);
|
|||
|
|
self.addressee.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoAddress').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
finally
|
|||
|
|
frmCompanySel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmjyxx := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.FormShow(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
maxno: string;
|
|||
|
|
begin
|
|||
|
|
readCxGrid(trim(Self.Caption) + 'tv2', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ');
|
|||
|
|
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' select * from BS_JYGL_Sub ');
|
|||
|
|
sql.Add('where mainid=''' + Trim(Fmainid) + '''');
|
|||
|
|
// sql.Add(' order by SerialNo ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS(ADOTemp, CDS_LXR);
|
|||
|
|
SInitCDSData(ADOTemp, CDS_LXR);
|
|||
|
|
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from BS_JYGL_Main where mainid=''' + Trim(Fmainid) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHData(ADOTemp, ScrollBox1, 2);
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
// with ADOQuery1 do
|
|||
|
|
// begin
|
|||
|
|
// Close;
|
|||
|
|
// SQL.Clear;
|
|||
|
|
// sql.Add(' select * from BS_JYGL_Sub ');
|
|||
|
|
// Open;
|
|||
|
|
// end;
|
|||
|
|
// SCreateCDS(ADOQuery1, CDS_LXR);
|
|||
|
|
// SInitCDSData(ADOQuery1, CDS_LXR);
|
|||
|
|
|
|||
|
|
if PState = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
JYdate.DateTime := SGetServerDateTime(ADOTemp);
|
|||
|
|
// DlyDate.DateTime := ConDate.DateTime;
|
|||
|
|
// ZDDate.DateTime := ConDate.DateTime;
|
|||
|
|
// ConNo.Text := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
// if PState = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
// begin
|
|||
|
|
//
|
|||
|
|
// PState := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
// Fmainid := '';
|
|||
|
|
//// ConNo.Text := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
//
|
|||
|
|
// with CDS_LXR do
|
|||
|
|
// begin
|
|||
|
|
// First;
|
|||
|
|
// while not Eof do
|
|||
|
|
// begin
|
|||
|
|
// if GetLSNo(ADOCmd, maxno, 'CS', 'BS_JYGL_sub', 4, 1) = False then
|
|||
|
|
// begin
|
|||
|
|
// Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
// Exit;
|
|||
|
|
// end;
|
|||
|
|
// Edit;
|
|||
|
|
// FieldByName('mainid').Value := '';
|
|||
|
|
// FieldByName('subid').Value := maxno;
|
|||
|
|
// Post;
|
|||
|
|
// Next;
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
// writeCxGrid(trim(Self.Caption) + 'tv1', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
writeCxGrid(trim(Self.Caption) + 'tv2', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.ToolButton2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
S: Integer;
|
|||
|
|
maxno: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmClothInfoSel := TfrmClothInfoSel.Create(Application);
|
|||
|
|
with frmClothInfoSel do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
S := self.CDS_LXR.RecordCount;
|
|||
|
|
while CDS_1.locate('SSel', true, []) do
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd, maxno, 'CS', 'BS_JYGL_sub', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
S := S + 1;
|
|||
|
|
with self.CDS_LXR do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('SSel').value := false;
|
|||
|
|
Fieldbyname('XH').value := S;
|
|||
|
|
FieldByName('subid').Value := maxno;
|
|||
|
|
|
|||
|
|
CDS_LXR.fieldbyname('ProductNO').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Code').asstring;
|
|||
|
|
CDS_LXR.fieldbyname('Productname').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Name').asstring;
|
|||
|
|
CDS_LXR.fieldbyname('specification').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Spec').asstring;
|
|||
|
|
CDS_LXR.fieldbyname('color').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Color').asstring;
|
|||
|
|
CDS_LXR.fieldbyname('Width').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Width').asstring;
|
|||
|
|
CDS_LXR.fieldbyname('Gramweight').Value := frmClothInfoSel.CDS_1.fieldbyname('C_GramWeight').asstring;
|
|||
|
|
CDS_LXR.fieldbyname('ingredients').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Composition').asstring;
|
|||
|
|
CDS_LXR.fieldbyname('Fabric').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Fabric').asstring;
|
|||
|
|
CDS_LXR.fieldbyname('Price').Value := frmClothInfoSel.CDS_1.fieldbyname('Price').asstring;
|
|||
|
|
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
CDS_1.Edit;
|
|||
|
|
CDS_1.fieldbyname('SSel').value := false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmClothInfoSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.ToolButton3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.ToolButton6Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
i: Integer;
|
|||
|
|
maxno: string;
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd, maxno, 'CS', 'BS_JYGL_sub', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Tv2.Columns[0].FocusWithSelection;
|
|||
|
|
if Trim(client.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
i := CDS_LXR.RecordCount; //<2F><>ǰ<EFBFBD><C7B0>dataset<65>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>м<EFBFBD>¼
|
|||
|
|
i := i + 1;
|
|||
|
|
CopyAddRow(Tv2, CDS_LXR);
|
|||
|
|
with CDS_LXR do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('XH').Value := IntToStr(i);
|
|||
|
|
FieldByName('subid').Value := maxno;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
SetXH();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure Tfrmjyxx.ToolButton7Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_LXR.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
while CDS_LXR.Locate('SSel', True, []) do
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_LXR.fieldbyname('subid').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete BS_JYGL_sub where subid=''' + Trim(CDS_LXR.fieldbyname('subid').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
CDS_LXR.Delete;
|
|||
|
|
end;
|
|||
|
|
SetXH();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|