U_yfdw.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:5k
- unit U_yfdw;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Db, DBClient, Menus, ImgList, ComCtrls, Grids, DBGrids, ExtCtrls, Buttons,
- DBCtrls;
- type
- TForm60 = class(TForm)
- Panel2: TPanel;
- DBGrid1: TDBGrid;
- StatusBar1: TStatusBar;
- ImageList1: TImageList;
- PopupMenu1: TPopupMenu;
- N3: TMenuItem;
- N1: TMenuItem;
- N4: TMenuItem;
- N7: TMenuItem;
- N2: TMenuItem;
- N9: TMenuItem;
- ClientDataSet1: TClientDataSet;
- DataSource1: TDataSource;
- ClientDataSet1ID: TIntegerField;
- ClientDataSet1CDSDesigner: TStringField;
- ClientDataSet1CDSDesigner2: TStringField;
- ClientDataSet1CDSDesigner3: TStringField;
- ClientDataSet1CDSDesigner4: TStringField;
- ClientDataSet1CDSDesigner5: TStringField;
- ClientDataSet1CDSDesigner6: TStringField;
- ClientDataSet1CDSDesigner7: TStringField;
- ClientDataSet1CDSDesigner8: TStringField;
- ClientDataSet1CDSDesigner9: TStringField;
- ClientDataSet1CDSDesigner10: TStringField;
- ClientDataSet1CDSDesigner11: TStringField;
- ClientDataSet1CDSDesigner12: TStringField;
- ClientDataSet1Email: TStringField;
- ClientDataSet1CDSDesigner13: TBooleanField;
- ClientDataSet1CDSDesigner14: TDateTimeField;
- ClientDataSet1CDSDesigner15: TDateTimeField;
- ClientDataSet1CDSDesigner16: TBooleanField;
- Panel1: TPanel;
- Panel3: TPanel;
- SpeedButton1: TSpeedButton;
- SpeedButton2: TSpeedButton;
- SpeedButton3: TSpeedButton;
- SpeedButton4: TSpeedButton;
- SpeedButton5: TSpeedButton;
- Timer1: TTimer;
- DBNavigator1: TDBNavigator;
- procedure N3Click(Sender: TObject);
- procedure N1Click(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure N4Click(Sender: TObject);
- procedure SpeedButton1Click(Sender: TObject);
- procedure SpeedButton2Click(Sender: TObject);
- procedure SpeedButton3Click(Sender: TObject);
- procedure SpeedButton5Click(Sender: TObject);
- procedure SpeedButton4Click(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
- procedure N9Click(Sender: TObject);
- procedure DBGrid1TitleClick(Column: TColumn);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form60: TForm60;
- implementation
- uses u_yfdwkp, U_general_print, U_mainform;
- {$R *.DFM}
- procedure TForm60.N3Click(Sender: TObject);
- begin
- clientdataset1.insert;
- application.createform(Tform62, form62);
- try
- form62.showmodal;
- finally
- form62.free;
- end;
- end;
- procedure TForm60.N1Click(Sender: TObject);
- begin
- if clientdataset1.recordcount = 0 then
- begin
- application.MessageBox('没有记录可编辑', '物资管理系统', mb_iconinformation + mb_defbutton1);
- exit;
- end;
- clientdataset1.edit;
- application.createform(Tform62, form62);
- try
- form62.showmodal;
- finally
- form62.free;
- end;
- end;
- procedure TForm60.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- action := cafree;
- form60 := nil;
- end;
- procedure TForm60.N4Click(Sender: TObject);
- begin
- if clientdataset1.recordcount = 0 then
- begin
- application.MessageBox('已无记录可删除', '物资管理系统', mb_iconinformation + mb_defbutton1);
- exit;
- end;
- if application.MessageBox('请确认是否要删除!', '物资管理系统', mb_iconinformation + mb_yesno) = idyes then
- begin
- clientdataset1.Delete;
- clientdataset1.ApplyUpdates(0);
- end;
- end;
- procedure TForm60.SpeedButton1Click(Sender: TObject);
- begin
- n3.click;
- end;
- procedure TForm60.SpeedButton2Click(Sender: TObject);
- begin
- n4.click;
- end;
- procedure TForm60.SpeedButton3Click(Sender: TObject);
- begin
- n1.click;
- end;
- procedure TForm60.SpeedButton5Click(Sender: TObject);
- begin
- n2.click;
- end;
- procedure TForm60.SpeedButton4Click(Sender: TObject);
- begin
- n9.click;
- end;
- procedure TForm60.Timer1Timer(Sender: TObject);
- begin
- //记录总数提示
- statusbar1.panels[2].text := '共有:' + inttostr(clientdataset1.recordcount) + ' 条记录';
- statusbar1.refresh;
- end;
- procedure TForm60.N9Click(Sender: TObject);
- begin
- application.createform(Tform80, form80);
- form80.srclist.items.add('乙方单位编号');
- form80.srclist.items.add('乙方单位名称');
- form80.srclist.items.add('乙方单位简称');
- form80.srclist.items.add('所属地区码');
- form80.srclist.items.add('开户银行');
- form80.srclist.items.add('银行帐号');
- form80.srclist.items.add('法人');
- form80.srclist.items.add('地址');
- form80.srclist.items.add('邮政编码');
- form80.srclist.items.add('联系电话');
- form80.srclist.items.add('联系人');
- form80.srclist.items.add('传真');
- form80.srclist.items.add('E-mail地址');
- form80.srclist.items.add('是否友好');
- form80.srclist.items.add('发展日期');
- form80.srclist.items.add('停用日期');
- form80.srclist.items.add('是否停用');
- vps_tablename := 'ht_yfdw';
- vps_filter := clientdataset1.Filter;
- vps_index := clientdataset1.IndexFieldNames;
- Form80.Edit1.Text := '乙方单位打印';
- try
- form80.showmodal;
- finally
- form80.free;
- end;
- end;
- procedure TForm60.DBGrid1TitleClick(Column: TColumn);
- begin
- form1.mysort(dbgrid1,column);
- end;
- end.