This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-10-22 16:19:33 +08:00
parent 0d61f072db
commit be0311af2d
251 changed files with 656 additions and 21775 deletions

View File

@ -1,371 +0,0 @@
object frmSCPersonColor: TfrmSCPersonColor
Left = 632
Top = 123
Width = 1011
Height = 676
Caption = #25968#25454#36873#25321
Color = clBtnFace
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnClose = FormClose
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 12
object ScrollBox1: TScrollBox
Left = 0
Top = 0
Width = 995
Height = 637
Align = alClient
TabOrder = 0
object btn58: TSpeedButton
Left = 23
Top = 15
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn9: TSpeedButton
Left = 215
Top = 15
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn10: TSpeedButton
Left = 407
Top = 15
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn11: TSpeedButton
Left = 599
Top = 15
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn12: TSpeedButton
Left = 791
Top = 15
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn59: TSpeedButton
Left = 23
Top = 159
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn16: TSpeedButton
Left = 215
Top = 159
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn17: TSpeedButton
Left = 407
Top = 159
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn18: TSpeedButton
Left = 599
Top = 159
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn19: TSpeedButton
Left = 791
Top = 159
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn60: TSpeedButton
Left = 23
Top = 302
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn23: TSpeedButton
Left = 215
Top = 302
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn24: TSpeedButton
Left = 407
Top = 302
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn25: TSpeedButton
Left = 599
Top = 302
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn26: TSpeedButton
Left = 791
Top = 302
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn61: TSpeedButton
Left = 23
Top = 446
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn30: TSpeedButton
Left = 215
Top = 446
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn31: TSpeedButton
Left = 407
Top = 446
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn32: TSpeedButton
Left = 599
Top = 446
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object btn33: TSpeedButton
Left = 791
Top = 446
Width = 180
Height = 120
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
OnClick = btn1Click
end
object Label27: TLabel
Left = 434
Top = 589
Width = 78
Height = 21
Caption = #24403#21069#39029':'
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label1: TLabel
Left = 528
Top = 588
Width = 12
Height = 21
Caption = '1'
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -21
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Button3: TButton
Left = 587
Top = 585
Width = 148
Height = 29
Caption = #19979#19968#39029
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
OnClick = Button3Click
end
object Button1: TButton
Left = 258
Top = 585
Width = 148
Height = 29
Caption = #19978#19968#39029
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
OnClick = Button1Click
end
end
object ADOTmp: TADOQuery
Connection = DataLink_TradeManage.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 856
Top = 504
end
end

View File

@ -1,223 +0,0 @@
unit U_SCPersonColor;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, DB, ADODB, StdCtrls;
type
TfrmSCPersonColor = class(TForm)
ScrollBox1: TScrollBox;
btn58: TSpeedButton;
btn9: TSpeedButton;
btn10: TSpeedButton;
btn11: TSpeedButton;
btn12: TSpeedButton;
btn59: TSpeedButton;
btn16: TSpeedButton;
btn17: TSpeedButton;
btn18: TSpeedButton;
btn19: TSpeedButton;
btn60: TSpeedButton;
btn23: TSpeedButton;
btn24: TSpeedButton;
btn25: TSpeedButton;
btn26: TSpeedButton;
btn61: TSpeedButton;
btn31: TSpeedButton;
btn32: TSpeedButton;
btn33: TSpeedButton;
ADOTmp: TADOQuery;
Label27: TLabel;
Label1: TLabel;
Button3: TButton;
Button1: TButton;
procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
CPage: Integer;
procedure InitPerson(page: Integer);
{ Private declarations }
public
FlagStr: string;
FName, FSJZL, FType: string;
{ Public declarations }
end;
var
frmSCPersonColor: TfrmSCPersonColor;
implementation
uses
U_DataLink;
{$R *.dfm}
procedure TfrmSCPersonColor.FormDestroy(Sender: TObject);
begin
frmSCPersonColor := nil;
end;
procedure TfrmSCPersonColor.InitPerson(page: Integer);
type
FdDy = record
inc: integer;
FDdys: string[32];
FdDysName: string[32];
end;
var
BB: array[0..500] of FdDy;
i, j: Integer;
begin
with ADOTmp do
begin
Close;
sql.Clear;
if FTYPE = 'KH' then
begin
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT zdyname as name,note from kh_zdy where type=''CustomerNoName'')AA');
// sql.Add('select ZDYName from KH_Zdy where Type=''' + flag + ''' order by ZDYNO ');
end
else if FTYPE = 'PM' then
begin
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT zdyname as name,note from kh_zdy where type=''PRTCodeName'')AA');
end
else if FTYPE = 'YS' then
begin
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT zdyname as name,note from kh_zdy where type=''PRTColor'')AA');
end
else if FTYPE = 'HX' then
begin
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT zdyname as name,note from kh_zdy where type=''PRTHX'')AA');
end
else if FTYPE = 'SH' then
begin
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT zdyname as name,note from kh_zdy where type=''SOrddefstr1'')AA');
end;
// showmessage(sql.text);
Open;
end;
if ADOTmp.IsEmpty then
begin
Application.MessageBox('没有定义数据!', '提示', 0);
Exit;
end;
j := (StrToInt(Label1.Caption) - 1) * 20 + 1;
for i := 0 to 19 do
begin
with ScrollBox1 do
begin
if ADOTmp.locate('keyNo', j + i, []) then
begin
// application.MessageBox(pchar(CDS_Kuang.FieldByName('ZDYName').AsString), '提示信息', 0);
TSpeedButton(Controls[i]).Visible := True;
TSpeedButton(Controls[i]).Caption := Trim(ADOTmp.FieldByName('name').AsString);
if FTYPE = '挡车工' then
begin
TSpeedButton(Controls[i]).hint := Trim(ADOTmp.FieldByName('note').AsString);
end;
end
else
begin
TSpeedButton(Controls[i]).Visible := False;
// application.MessageBox(pchar('没找到' + inttostr(i)), '提示信息', 0);
end;
end;
end;
// with ADOTmp do
// begin
// First;
// i := 0;
// while not Eof do
// begin
// BB[i].inc := i;
// BB[i].FdDysName := Trim(fieldbyname('name').AsString);
// i := i + 1;
// Next;
// end;
// end;
// i := i - 1;
// if i > 19 then
// begin
// i := 19;
// end;
// for j := 0 to 19 do
// begin
// with ScrollBox1 do
// begin
// TSpeedButton(Controls[j]).Visible := false;
// TSpeedButton(Controls[j]).Caption := '';
// TSpeedButton(Controls[j]).Hint := '';
// end;
// end;
// for j := 0 to i do
// begin
// with ScrollBox1 do
// begin
// TSpeedButton(Controls[j]).Visible := True;
// TSpeedButton(Controls[j]).Caption := BB[j].FdDysName;
// end;
// end;
end;
procedure TfrmSCPersonColor.FormShow(Sender: TObject);
begin
InitPerson(1);
CPage := 1;
end;
procedure TfrmSCPersonColor.btn1Click(Sender: TObject);
begin
FName := Trim(TSpeedButton(Sender).Caption);
ModalResult := 1;
end;
procedure TfrmSCPersonColor.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caHide;
end;
procedure TfrmSCPersonColor.Button1Click(Sender: TObject);
begin
if CPage <= 1 then
begin
Label1.Caption := '1';
InitPerson(1);
end
else
begin
CPage := CPage - 1;
Label1.Caption := IntToStr(CPage);
InitPerson(CPage);
end;
end;
procedure TfrmSCPersonColor.Button3Click(Sender: TObject);
begin
CPage := CPage + 1;
Label1.Caption := IntToStr(CPage);
InitPerson(CPage);
end;
end.

File diff suppressed because it is too large Load Diff

View File

@ -1,940 +0,0 @@
unit U_ZDYHelp12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, DB, cxDBData, ToolWin, ComCtrls, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls,
cxGridCustomView, cxGrid, DBClient, ADODB, ImgList, StdCtrls, ExtCtrls,
cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels,
cxLookAndFeelPainters, cxNavigator, Buttons;
type
TfrmZDYHelp12 = class(TForm)
TV1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid1: TcxGrid;
V1Code: TcxGridDBColumn;
V1Name: TcxGridDBColumn;
ToolBar1: TToolBar;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
ADOQueryCmd: TADOQuery;
DataSource1: TDataSource;
ClientDataSet1: TClientDataSet;
TBAdd: TToolButton;
TBSave: TToolButton;
TBDel: TToolButton;
TBClose: TToolButton;
ToolButton1: TToolButton;
TBEdit: TToolButton;
V1Note: TcxGridDBColumn;
V1OrderNo: TcxGridDBColumn;
ADOConnection1: TADOConnection;
Panel1: TPanel;
Label1: TLabel;
ZDYName: TEdit;
ThreeImgList: TImageList;
cxGridPopupMenu1: TcxGridPopupMenu;
V1ZdyFlag: TcxGridDBColumn;
V1HelpType: TcxGridDBColumn;
V1note1: TcxGridDBColumn;
cxStyleRepository1: TcxStyleRepository;
cxStyle1: TcxStyle;
ScrollBox1: TScrollBox;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton7: TSpeedButton;
SpeedButton8: TSpeedButton;
SpeedButton9: TSpeedButton;
SpeedButton10: TSpeedButton;
SpeedButton11: TSpeedButton;
SpeedButton12: TSpeedButton;
SpeedButton13: TSpeedButton;
SpeedButton14: TSpeedButton;
SpeedButton15: TSpeedButton;
SpeedButton16: TSpeedButton;
SpeedButton17: TSpeedButton;
SpeedButton18: TSpeedButton;
SpeedButton19: TSpeedButton;
SpeedButton20: TSpeedButton;
SpeedButton21: TSpeedButton;
SpeedButton22: TSpeedButton;
SpeedButton23: TSpeedButton;
SpeedButton24: TSpeedButton;
SpeedButton25: TSpeedButton;
SpeedButton26: TSpeedButton;
SpeedButton27: TSpeedButton;
SpeedButton28: TSpeedButton;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBAddClick(Sender: TObject);
procedure TBSaveClick(Sender: TObject);
procedure TBDelClick(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure TBEditClick(Sender: TObject);
procedure TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
procedure ZDYNameChange(Sender: TObject);
procedure V1NamePropertiesEditValueChanged(Sender: TObject);
procedure V1OrderNoPropertiesEditValueChanged(Sender: TObject);
procedure V1NotePropertiesEditValueChanged(Sender: TObject);
procedure V1Column1PropertiesEditValueChanged(Sender: TObject);
procedure V1HelpTypePropertiesEditValueChanged(Sender: TObject);
procedure V1note1PropertiesEditValueChanged(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure SpeedButton1DblClick(Sender: TObject);
private
procedure InitGrid();
procedure InitJP();
{ Private declarations }
public
flag, flagname, snote, MainType, FHX: string;
fnote, forderno, fZdyFlag, ViewFlag, fnote1, fHelpType, FZDYStr1: Boolean;
PPSTE: integer;
{ Public declarations }
end;
var
frmZDYHelp12: TfrmZDYHelp12;
implementation
uses
U_DataLink, U_Fun10, U_ZDYHelp;
{$R *.dfm}
procedure TfrmZDYHelp12.FormCreate(Sender: TObject);
begin
try
cxGrid1.Align := alClient;
with ADOConnection1 do
begin
Connected := false;
ConnectionString := DConString;
//ConnectionString:='';
Connected := true;
end;
except
{if Application.MessageBox('网络连接失败,是否要再次连接?','提示',32+4)=IDYES then
begin
try
with ADOConnection1 do
begin
Connected:=false;
ConnectionString:=DConString;
//ConnectionString:='23242';
Connected:=true;
end;
except
end;
end; }
frmZDYHelp12.Free;
end;
end;
procedure TfrmZDYHelp12.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ZDYName.SetFocus;
Action := caFree;
end;
procedure TfrmZDYHelp12.InitGrid();
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Close;
sql.Clear;
sql.Add('select A.*,ZJM=dbo.getPinYin(A.ZdyName) from KH_ZDY A where A.Type=''' + flag + '''');
if Trim(MainType) <> '' then
begin
sql.Add(' and A.MainType=''' + Trim(MainType) + '''');
end;
Open;
end;
SCreateCDS20(ADOQueryMain, ClientDataSet1);
SInitCDSData20(ADOQueryMain, ClientDataSet1);
finally
ADOQueryMain.EnableControls;
end;
end;
procedure TfrmZDYHelp12.TBAddClick(Sender: TObject);
var
i: Integer;
begin
ZDYName.SetFocus;
TV1.OptionsData.Editing := True;
TV1.OptionsSelection.CellSelect := True;
for i := 0 to 5 do
begin
with ClientDataSet1 do
begin
Append;
Post;
end;
end;
end;
procedure TfrmZDYHelp12.TBSaveClick(Sender: TObject);
var
maxno: string;
begin
if ClientDataSet1.IsEmpty then
Exit;
ZDYName.SetFocus;
if ClientDataSet1.Locate('ZDYName', null, []) then
begin
Application.MessageBox('名称不能为空!', '提示', 0);
Exit;
end;
if ClientDataSet1.Locate('ZDYName', '', []) then
begin
Application.MessageBox('名称不能为空!', '提示', 0);
Exit;
end;
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryTemp do
begin
Close;
SQL.Clear;
SQL.Add('select * from KH_ZDY where ZdyNo=''' + Trim(flag) + '''');
open;
end;
if ADOQueryTemp.IsEmpty then
begin
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from KH_ZDY where 1=2');
open;
ADOQueryCmd.Append;
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(flag);
ADOQueryCmd.FieldByName('ZDYName').Value := trim(flagname);
ADOQueryCmd.FieldByName('Type').Value := 'Main';
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
ADOQueryCmd.Post;
{ sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
Parameters.ParamByName('ZDYNo').Value:=Trim(flag);
Parameters.ParamByName('ZDYName').Value:=Trim(flagname);
Parameters.ParamByName('Type').Value:='Main';
Parameters.ParamByName('MainType').Value:=Trim(MainType);
ExecSQL; }
end;
end;
with ADOQueryCmd do
begin
ClientDataSet1.DisableControls;
with ClientDataSet1 do
begin
First;
while not eof do
begin
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
ClientDataSet1.EnableControls;
Application.MessageBox('取最大编号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxno := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
end;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.add('select * from KH_Zdy where Type=''' + Trim(flag) + '''');
if Trim(MainType) <> '' then
SQL.Add(' and MainType=''' + Trim(MainType) + '''');
sql.Add(' and ZdyName=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
Open;
end;
if ADOQueryTemp.IsEmpty = False then
begin
if ADOQueryTemp.RecordCount > 1 then
begin
ADOQueryCmd.Connection.RollbackTrans;
ClientDataSet1.EnableControls;
Application.MessageBox('名称重复!', '提示', 0);
Exit;
end;
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) = '' then
begin
ADOQueryCmd.Connection.RollbackTrans;
ClientDataSet1.EnableControls;
Application.MessageBox('名称重复!', '提示', 0);
Exit;
end
else
begin
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString) <> Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
begin
ADOQueryCmd.Connection.RollbackTrans;
ClientDataSet1.EnableControls;
Application.MessageBox('名称重复!', '提示', 0);
Exit;
end;
end;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
SQL.Add('delete KH_ZDY where ZDYNO=''' + Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString) + '''');
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from KH_ZDY where 1<>1');
Open;
end;
ADOQueryCmd.Append;
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(maxno);
ADOQueryCmd.FieldByName('ZDYName').Value := ClientDataSet1.fieldbyname('ZDYName').Value;
ADOQueryCmd.FieldByName('note').Value := Trim(snote);
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
ADOQueryCmd.FieldByName('Type').Value := flag;
ADOQueryCmd.FieldByName('valid').Value := 'Y';
if Trim(MainType) <> '' then
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
//ADOQueryCmd.FieldByName('sel').Value:=0;
ADOQueryCmd.Post;
ClientDataSet1.Edit;
ClientDataSet1.FieldByName('ZDYNo').Value := Trim(maxno);
ClientDataSet1.Post;
Next;
end;
end;
ClientDataSet1.EnableControls;
end;
ADOQueryCmd.Connection.CommitTrans;
Application.MessageBox('保存成功!', '提示', 0);
TV1.OptionsData.Editing := False;
TV1.OptionsSelection.CellSelect := False;
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
procedure TfrmZDYHelp12.TBDelClick(Sender: TObject);
begin
if ClientDataSet1.IsEmpty then
Exit;
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString) <> '') or (Trim(ClientDataSet1.FieldByName('ZDYname').AsString) <> '') then
begin
if application.MessageBox('确定要删除吗?', '提示信息', 1) = 2 then
exit;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete KH_ZDY where ZDYNo=''' + Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString) + '''');
SQL.Add(' and Type=''' + Trim(flag) + '''');
ExecSQL;
end;
end;
ClientDataSet1.Delete;
end;
procedure TfrmZDYHelp12.TBCloseClick(Sender: TObject);
begin
ModalResult := 2;
ZDYName.SetFocus;
WriteCxGrid('自定义' + Trim(flag), TV1, '自定义数据');
Close;
end;
procedure TfrmZDYHelp12.FormShow(Sender: TObject);
var
fsj, fsj1: string;
begin
{if PPSTE=1 then
begin
Application.Terminate;
Exit;
end; }
InitGrid();
fsj := Trim(flag) + '01';
fsj1 := Trim(flagname) + '01';
{if ClientDataSet1.IsEmpty then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('insert into KH_ZDY(ZDYNo,ZDYname,Type,note)');
sql.Add('select '''+Trim(fsj)+'''');
sql.Add(','''+Trim(fsj1)+'''');
SQL.Add(','''+Trim(flag)+'''');
sql.Add(','''+Trim(snote)+'''');
ExecSQL;
end;
InitGrid();
end;}
//frmZDYHelp.Caption:=Trim(flagname)+'<'+Trim(flag)+'>';
//ReadCxGrid('自定义',TV1,'自定义数据');
ReadCxGrid('自定义' + Trim(flag), TV1, '自定义数据');
frmZDYHelp12.Caption := Trim(flagname);
V1Note.Visible := fnote;
V1ZdyFlag.Visible := fZdyFlag;
V1OrderNo.Visible := forderno;
v1note1.Visible := fnote1;
V1HelpType.Visible := fHelpType;
InitJP();
Label1.Caption := Trim(flagname);
if ViewFlag = True then
begin
TBAdd.Visible := False;
TBSave.Visible := False;
TBDel.Visible := False;
TBEdit.Visible := False;
//Label2.Visible:=False;
end;
end;
procedure TfrmZDYHelp12.InitJP();
var
AA: array[0..100] of string;
i, j: Integer;
begin
with ADOQueryMain do
begin
Close;
sql.Clear;
sql.Add('select ZDYName from KH_Zdy where Type=''' + Trim(flag) + ''' order by ZDYNO ');
//showmessage(sql.text);
Open;
end;
if ADOQueryMain.IsEmpty then
begin
Application.MessageBox('没有定义''+Trim(flagname)+''', '提示', 0);
Exit;
end;
with ADOQueryMain do
begin
First;
i := 0;
while not Eof do
begin
AA[i] := Trim(fieldbyname('ZDYName').AsString);
i := i + 1;
Next;
end;
end;
i := i - 1;
if i > 59 then
begin
i := 59;
end;
for j := 0 to i do
begin
with ScrollBox1 do
begin
TSpeedButton(Controls[j]).Visible := True;
TSpeedButton(Controls[j]).Hint := AA[j];
if Length(AA[j]) > 4 then
begin
TSpeedButton(Controls[j]).Caption := Copy(Trim(AA[j]), 1, 4) + #13 + Copy(Trim(AA[j]), 5, Length(AA[j]) - 4);
end
else
TSpeedButton(Controls[j]).Caption := AA[j];
end;
end;
end;
procedure TfrmZDYHelp12.ToolButton1Click(Sender: TObject);
begin
ZDYName.SetFocus;
// WriteCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
ModalResult := 1;
end;
procedure TfrmZDYHelp12.TBEditClick(Sender: TObject);
begin
TV1.OptionsData.Editing := True;
TV1.OptionsSelection.CellSelect := True;
end;
procedure TfrmZDYHelp12.TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
if TV1.OptionsData.Editing = False then
begin
ModalResult := 1;
end;
end;
procedure TfrmZDYHelp12.ZDYNameChange(Sender: TObject);
var
fsj: string;
begin
if Trim(ZDYName.Text) <> '' then
begin
fsj := ' zdyname like ''' + '%' + Trim(ZDYName.Text) + '%' + '''' + ' or Note like ''' + '%' + Trim(ZDYName.Text) + '%' + '''' + ' or ZJM like ''' + '%' + Trim(ZDYName.Text) + '%' + '''';
end;
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, fsj);
SCreateCDS20(ADOQueryMain, ClientDataSet1);
SInitCDSData20(ADOQueryMain, ClientDataSet1);
end;
end;
procedure TfrmZDYHelp12.V1NamePropertiesEditValueChanged(Sender: TObject);
var
maxno, mvalue: string;
begin
mvalue := TcxTextEdit(Sender).EditingText;
if Trim(mvalue) = '' then
begin
//Application.MessageBox('名称不能为空!','提示',0);
Exit;
end;
with ClientDataSet1 do
begin
Edit;
FieldByName('ZdyName').Value := Trim(mvalue);
//Post;
end;
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryTemp do
begin
Close;
SQL.Clear;
SQL.Add('select * from KH_ZDY where ZdyNo=''' + Trim(flag) + '''');
open;
end;
if ADOQueryTemp.IsEmpty then
begin
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from KH_ZDY where 1=2');
open;
ADOQueryCmd.Append;
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(flag);
ADOQueryCmd.FieldByName('ZDYName').Value := trim(flagname);
ADOQueryCmd.FieldByName('Type').Value := 'Main';
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
ADOQueryCmd.Post;
end;
end;
with ADOQueryCmd do
begin
//ClientDataSet1.DisableControls;
//with ClientDataSet1 do
//begin
//First;
//while not eof do
//begin
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
//ClientDataSet1.EnableControls;
Application.MessageBox('取最大编号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxno := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
end;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.add('select * from KH_Zdy where Type=''' + Trim(flag) + '''');
if Trim(MainType) <> '' then
SQL.Add(' and MainType=''' + Trim(MainType) + '''');
sql.Add(' and ZdyName=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
sql.Add(' and note=''' + Trim(ClientDataSet1.fieldbyname('note').AsString) + '''');
Open;
end;
if ADOQueryTemp.IsEmpty = False then
begin
if ADOQueryTemp.RecordCount > 1 then
begin
ADOQueryCmd.Connection.RollbackTrans;
//ClientDataSet1.EnableControls;
Application.MessageBox('名称重复!', '提示', 0);
Exit;
end;
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) = '' then
begin
ADOQueryCmd.Connection.RollbackTrans;
//ClientDataSet1.EnableControls;
Application.MessageBox('名称重复!', '提示', 0);
Exit;
end
else
begin
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString) <> Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
begin
ADOQueryCmd.Connection.RollbackTrans;
//ClientDataSet1.EnableControls;
Application.MessageBox('名称重复!', '提示', 0);
Exit;
end;
end;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
SQL.Add('delete KH_ZDY where ZDYNO=''' + Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString) + '''');
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from KH_ZDY where 1<>1');
Open;
end;
ADOQueryCmd.Append;
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(maxno);
ADOQueryCmd.FieldByName('ZDYName').Value := ClientDataSet1.fieldbyname('ZDYName').AsString;
ADOQueryCmd.FieldByName('note').Value := Trim(snote);
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
ADOQueryCmd.FieldByName('Type').Value := flag;
ADOQueryCmd.FieldByName('valid').Value := 'Y';
if Trim(MainType) <> '' then
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
//ADOQueryCmd.FieldByName('sel').Value:=0;
ADOQueryCmd.Post;
ClientDataSet1.Edit;
ClientDataSet1.FieldByName('ZDYNo').Value := Trim(maxno);
//ClientDataSet1.Post;
// Next;
//end;
//end;
// ClientDataSet1.EnableControls;
end;
ADOQueryCmd.Connection.CommitTrans;
//Application.MessageBox('保存成功!','提示',0);
//TV1.OptionsData.Editing:=False;
//TV1.OptionsSelection.CellSelect:=False;
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
procedure TfrmZDYHelp12.V1OrderNoPropertiesEditValueChanged(Sender: TObject);
var
mvalue: string;
begin
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
begin
Application.MessageBox('名称不能为空!', '提示', 0);
Exit;
end;
mvalue := TcxTextEdit(Sender).EditingText;
if Trim(mvalue) = '' then
begin
mvalue := '0';
end;
with ClientDataSet1 do
begin
Edit;
FieldByName('OrderNo').Value := mvalue;
Post;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('Update KH_Zdy Set OrderNo=' + mvalue);
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
ExecSQL;
end;
end;
procedure TfrmZDYHelp12.V1NotePropertiesEditValueChanged(Sender: TObject);
var
mvalue: string;
begin
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
begin
Application.MessageBox('名称不能为空!', '提示', 0);
Exit;
end;
mvalue := TcxTextEdit(Sender).EditingText;
if Trim(mvalue) = '' then
begin
mvalue := '0';
end;
with ClientDataSet1 do
begin
Edit;
FieldByName('Note').Value := mvalue;
Post;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('Update KH_Zdy Set Note=''' + Trim(mvalue) + '''');
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
ExecSQL;
end;
end;
procedure TfrmZDYHelp12.V1Column1PropertiesEditValueChanged(Sender: TObject);
var
mvalue: string;
fieldname: string;
begin
fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
begin
Application.MessageBox('名称不能为空!', '提示', 0);
Exit;
end;
mvalue := TcxTextEdit(Sender).EditingText;
if Trim(mvalue) = '' then
begin
mvalue := '0';
end;
with ClientDataSet1 do
begin
Edit;
FieldByName(fieldname).Value := StrToInt(mvalue);
Post;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('Update KH_Zdy Set ' + fieldname + '=' + Trim(mvalue));
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
ExecSQL;
end;
end;
procedure TfrmZDYHelp12.V1HelpTypePropertiesEditValueChanged(Sender: TObject);
var
mvalue: string;
begin
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
begin
Application.MessageBox('名称不能为空!', '提示', 0);
Exit;
end;
mvalue := TcxTextEdit(Sender).EditingText;
if Trim(mvalue) = '' then
begin
mvalue := '0';
end;
with ClientDataSet1 do
begin
Edit;
FieldByName('HelpType').Value := mvalue;
Post;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('Update KH_Zdy Set HelpType=''' + Trim(mvalue) + '''');
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
ExecSQL;
end;
end;
procedure TfrmZDYHelp12.V1note1PropertiesEditValueChanged(Sender: TObject);
var
mvalue: string;
fieldname: string;
begin
fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
begin
Application.MessageBox('名称不能为空!', '提示', 0);
Exit;
end;
mvalue := TcxTextEdit(Sender).EditingText;
with ClientDataSet1 do
begin
Edit;
FieldByName(fieldname).Value := mvalue;
Post;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('Update KH_Zdy Set ' + fieldname + '=' + quotedstr(Trim(mvalue)));
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
ExecSQL;
end;
end;
//procedure TfrmZDYHelp12.Button1Click(Sender: TObject);
//var
// maxno: string;
//begin
//
// if ZDYName.Text = '' then
// begin
// Application.MessageBox('请输入''+Trim(flagname)+''', '提示', 0);
// Exit;
// end;
// try
// ADOQueryMain.Connection.BeginTrans;
// with ADOQueryMain do
// begin
// Close;
// SQL.Clear;
// SQL.Add('select * from KH_ZDY where Type=''' + Trim(flag) + '''');
// SQL.Add(' and ZDYName =''' + Trim(ZDYName.Text) + '''');
// open;
// end;
// if ADOQueryMain.IsEmpty = False then
// begin
// Application.MessageBox(PChar(Trim(flagname) + '已存在'), '提示', 0);
// ADOQueryMain.Connection.RollbackTrans;
// Exit;
// end
// else
// begin
// with ADOQueryMain do
// begin
// Append;
// if Trim(ADOQueryMain.FieldByName('ZDYNO').AsString) = '' then
// begin
// if GetLSNo(ADOQueryMain, maxno, 'SY', 'KH_ZDY', 3, 1) = False then
// begin
// ADOQueryMain.Connection.RollbackTrans;
// Application.MessageBox('取最大编号失败!', '提示', 0);
// Exit;
// end;
// end
// else
// begin
// maxno := Trim(ADOQueryMain.fieldbyname('ZDYNo').AsString);
// end;
// FieldByName('ZDYNo').Value := Trim(maxno);
// FieldByName('ZDYName').Value := Trim(ZDYName.Text);
// FieldByName('Type').Value := flag;
// FieldByName('valid').Value := 'Y';
// Post;
// end;
// end;
// Application.MessageBox('保存成功!', '提示', 0);
// except
// ADOQueryMain.Connection.RollbackTrans;
// Application.MessageBox('保存失败!', '提示', 0);
// end;
//end;
procedure TfrmZDYHelp12.Button1Click(Sender: TObject);
var
maxno: string;
begin
if ZDYName.Text = '' then
begin
Application.MessageBox('请输入''+Trim(flagname)+''', '提示', 0);
Exit;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('select * from KH_ZDY where Type=''' + Trim(flag) + '''');
SQL.Add(' and ZDYName =''' + Trim(ZDYName.Text) + '''');
open;
end;
if ADOQueryCmd.IsEmpty = False then
begin
Application.MessageBox(PChar(Trim(flagname) + '已存在'), '提示', 0);
Exit;
end;
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryCmd do
begin
Close;
sql.Clear;
SQL.Add('select * from KH_ZDY where Type=''' + Trim(flag) + '''');
SQL.Add(' and ZDYName =''' + Trim(ZDYName.Text) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(ADOQueryCmd.FieldByName('ZDYNO').AsString) = '' then
begin
// Append;
if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('取最大编号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxno := ADOQueryCmd.fieldbyname('ZDYNo').AsString;
Edit;
end;
close;
sql.Clear;
sql.Add('select * from KH_ZDY where 1=2');
open;
ADOQueryCmd.Append;
FieldByName('ZDYNo').Value := Trim(maxno);
FieldByName('ZDYName').Value := Trim(ZDYName.Text);
FieldByName('Type').Value := flag;
FieldByName('valid').Value := 'Y';
ADOQueryCmd.Post;
end;
ADOQueryCmd.Connection.CommitTrans;
Application.MessageBox('保存成功!', '提示', 0);
InitJP();
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('保存失败!', '提示', 0);
end;
end;
procedure TfrmZDYHelp12.SpeedButton1DblClick(Sender: TObject);
begin
FHX := TSpeedButton(Sender).caption;
ModalResult := 1;
end;
end.

View File

@ -101,7 +101,7 @@ DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=D:\打卷店模板\打卷店\复合\复合检验管理\testDll.exe
HostApplication=D:\Dp7Repo\项目代码\D7DJhaoye\打卷检验管理\testDll.exe
Launcher=
UseLauncher=0
DebugCWD=

View File

@ -2,7 +2,7 @@ library TradeManage;
uses
SysUtils,
classes,
forms,
forms,
WinTypes,
WinProcs,
U_DataLink in 'U_DataLink.pas' {DataLink_TradeManage: TDataModule},

View File

@ -557,7 +557,7 @@ begin
tv2.Controller.EditingController.ShowEdit();
tv3.Controller.EditingController.ShowEdit();
end;
if CheckBox1.Checked then
if CheckBox1.Checked = true then
begin
if (Rolls = strtointdef(trim(ComboBox3.Text), 0)) and (strtointdef(trim(ComboBox3.Text), 0) > 0) then
begin
@ -987,9 +987,11 @@ begin
if check_bz.Checked then
begin
if Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) <> '' then
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) + '.rmf'
// fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) + '.rmf'
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('NLBName').AsString)
else
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\관깃푯.rmf';
// fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\관깃푯.rmf';
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\관깃푯';
if not FileExists(fPrintFile) then
begin
Application.MessageBox(PChar('ûÓÐÕÒ' + fPrintFile), 'Ìáʾ', 0);
@ -1104,6 +1106,7 @@ begin
CDSTM.Post;
end;
CDSMJID.Delete;
Rolls := Rolls - 1;
end;
end;

Some files were not shown because too many files have changed in this diff Show More