U_yfdw.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:5k
源码类别:

Delphi/CppBuilder

开发平台:

Delphi

  1. unit U_yfdw;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   Db, DBClient, Menus, ImgList, ComCtrls, Grids, DBGrids, ExtCtrls, Buttons,
  6.   DBCtrls;
  7. type
  8.   TForm60 = class(TForm)
  9.     Panel2: TPanel;
  10.     DBGrid1: TDBGrid;
  11.     StatusBar1: TStatusBar;
  12.     ImageList1: TImageList;
  13.     PopupMenu1: TPopupMenu;
  14.     N3: TMenuItem;
  15.     N1: TMenuItem;
  16.     N4: TMenuItem;
  17.     N7: TMenuItem;
  18.     N2: TMenuItem;
  19.     N9: TMenuItem;
  20.     ClientDataSet1: TClientDataSet;
  21.     DataSource1: TDataSource;
  22.     ClientDataSet1ID: TIntegerField;
  23.     ClientDataSet1CDSDesigner: TStringField;
  24.     ClientDataSet1CDSDesigner2: TStringField;
  25.     ClientDataSet1CDSDesigner3: TStringField;
  26.     ClientDataSet1CDSDesigner4: TStringField;
  27.     ClientDataSet1CDSDesigner5: TStringField;
  28.     ClientDataSet1CDSDesigner6: TStringField;
  29.     ClientDataSet1CDSDesigner7: TStringField;
  30.     ClientDataSet1CDSDesigner8: TStringField;
  31.     ClientDataSet1CDSDesigner9: TStringField;
  32.     ClientDataSet1CDSDesigner10: TStringField;
  33.     ClientDataSet1CDSDesigner11: TStringField;
  34.     ClientDataSet1CDSDesigner12: TStringField;
  35.     ClientDataSet1Email: TStringField;
  36.     ClientDataSet1CDSDesigner13: TBooleanField;
  37.     ClientDataSet1CDSDesigner14: TDateTimeField;
  38.     ClientDataSet1CDSDesigner15: TDateTimeField;
  39.     ClientDataSet1CDSDesigner16: TBooleanField;
  40.     Panel1: TPanel;
  41.     Panel3: TPanel;
  42.     SpeedButton1: TSpeedButton;
  43.     SpeedButton2: TSpeedButton;
  44.     SpeedButton3: TSpeedButton;
  45.     SpeedButton4: TSpeedButton;
  46.     SpeedButton5: TSpeedButton;
  47.     Timer1: TTimer;
  48.     DBNavigator1: TDBNavigator;
  49.     procedure N3Click(Sender: TObject);
  50.     procedure N1Click(Sender: TObject);
  51.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  52.     procedure N4Click(Sender: TObject);
  53.     procedure SpeedButton1Click(Sender: TObject);
  54.     procedure SpeedButton2Click(Sender: TObject);
  55.     procedure SpeedButton3Click(Sender: TObject);
  56.     procedure SpeedButton5Click(Sender: TObject);
  57.     procedure SpeedButton4Click(Sender: TObject);
  58.     procedure Timer1Timer(Sender: TObject);
  59.     procedure N9Click(Sender: TObject);
  60.     procedure DBGrid1TitleClick(Column: TColumn);
  61.   private
  62.     { Private declarations }
  63.   public
  64.     { Public declarations }
  65.   end;
  66. var
  67.   Form60: TForm60;
  68. implementation
  69. uses u_yfdwkp, U_general_print, U_mainform;
  70. {$R *.DFM}
  71. procedure TForm60.N3Click(Sender: TObject);
  72. begin
  73.   clientdataset1.insert;
  74.   application.createform(Tform62, form62);
  75.   try
  76.     form62.showmodal;
  77.   finally
  78.     form62.free;
  79.   end;
  80. end;
  81. procedure TForm60.N1Click(Sender: TObject);
  82. begin
  83.   if clientdataset1.recordcount = 0 then
  84.   begin
  85.     application.MessageBox('没有记录可编辑', '物资管理系统', mb_iconinformation + mb_defbutton1);
  86.     exit;
  87.   end;
  88.   clientdataset1.edit;
  89.   application.createform(Tform62, form62);
  90.   try
  91.     form62.showmodal;
  92.   finally
  93.     form62.free;
  94.   end;
  95. end;
  96. procedure TForm60.FormClose(Sender: TObject; var Action: TCloseAction);
  97. begin
  98.   action := cafree;
  99.   form60 := nil;
  100. end;
  101. procedure TForm60.N4Click(Sender: TObject);
  102. begin
  103.   if clientdataset1.recordcount = 0 then
  104.   begin
  105.     application.MessageBox('已无记录可删除', '物资管理系统', mb_iconinformation + mb_defbutton1);
  106.     exit;
  107.   end;
  108.   if application.MessageBox('请确认是否要删除!', '物资管理系统', mb_iconinformation + mb_yesno) = idyes then
  109.   begin
  110.     clientdataset1.Delete;
  111.     clientdataset1.ApplyUpdates(0);
  112.   end;
  113. end;
  114. procedure TForm60.SpeedButton1Click(Sender: TObject);
  115. begin
  116.   n3.click;
  117. end;
  118. procedure TForm60.SpeedButton2Click(Sender: TObject);
  119. begin
  120.   n4.click;
  121. end;
  122. procedure TForm60.SpeedButton3Click(Sender: TObject);
  123. begin
  124.   n1.click;
  125. end;
  126. procedure TForm60.SpeedButton5Click(Sender: TObject);
  127. begin
  128.   n2.click;
  129. end;
  130. procedure TForm60.SpeedButton4Click(Sender: TObject);
  131. begin
  132.   n9.click;
  133. end;
  134. procedure TForm60.Timer1Timer(Sender: TObject);
  135. begin
  136. //记录总数提示
  137.   statusbar1.panels[2].text := '共有:' + inttostr(clientdataset1.recordcount) + ' 条记录';
  138.   statusbar1.refresh;
  139. end;
  140. procedure TForm60.N9Click(Sender: TObject);
  141. begin
  142.   application.createform(Tform80, form80);
  143.   form80.srclist.items.add('乙方单位编号');
  144.   form80.srclist.items.add('乙方单位名称');
  145.   form80.srclist.items.add('乙方单位简称');
  146.   form80.srclist.items.add('所属地区码');
  147.   form80.srclist.items.add('开户银行');
  148.   form80.srclist.items.add('银行帐号');
  149.   form80.srclist.items.add('法人');
  150.   form80.srclist.items.add('地址');
  151.   form80.srclist.items.add('邮政编码');
  152.   form80.srclist.items.add('联系电话');
  153.   form80.srclist.items.add('联系人');
  154.   form80.srclist.items.add('传真');
  155.   form80.srclist.items.add('E-mail地址');
  156.   form80.srclist.items.add('是否友好');
  157.   form80.srclist.items.add('发展日期');
  158.   form80.srclist.items.add('停用日期');
  159.   form80.srclist.items.add('是否停用');
  160.   vps_tablename := 'ht_yfdw';
  161.   vps_filter := clientdataset1.Filter;
  162.   vps_index := clientdataset1.IndexFieldNames;
  163.   Form80.Edit1.Text := '乙方单位打印';
  164.   try
  165.     form80.showmodal;
  166.   finally
  167.     form80.free;
  168.   end;
  169. end;
  170. procedure TForm60.DBGrid1TitleClick(Column: TColumn);
  171. begin
  172. form1.mysort(dbgrid1,column);
  173. end;
  174. end.