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

Delphi/CppBuilder

开发平台:

Delphi

  1. unit U_djsh;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   DBCtrls, Buttons, StdCtrls, Mask, Grids, DBGrids, ExtCtrls, Db, DBClient,
  6.   ComCtrls, variants;
  7. type
  8.   TfrmDjsh = class(TForm)
  9.     DS_CLSLD: TDataSource;
  10.     DS_CLSLD_DETAIL: TDataSource;
  11.     PageControl1: TPageControl;
  12.     TabSheet1: TTabSheet;
  13.     TabSheet2: TTabSheet;
  14.     ScrollBox2: TScrollBox;
  15.     Panel1: TPanel;
  16.     DBGrid1: TDBGrid;
  17.     Panel4: TPanel;
  18.     SPEED_4: TSpeedButton;
  19.     SpeedButton1: TSpeedButton;
  20.     DBNavigator1: TDBNavigator;
  21.     Panel5: TPanel;
  22.     Label1: TLabel;
  23.     Label2: TLabel;
  24.     Label3: TLabel;
  25.     Label4: TLabel;
  26.     Label5: TLabel;
  27.     Label6: TLabel;
  28.     Label7: TLabel;
  29.     Label8: TLabel;
  30.     Label9: TLabel;
  31.     Label10: TLabel;
  32.     Label15: TLabel;
  33.     DBEdit2: TDBEdit;
  34.     DBEdit3: TDBEdit;
  35.     DBEdit4: TDBEdit;
  36.     DBEdit5: TDBEdit;
  37.     DBEdit6: TDBEdit;
  38.     DBEdit7: TDBEdit;
  39.     DBEdit8: TDBEdit;
  40.     DBEdit9: TDBEdit;
  41.     DBEdit10: TDBEdit;
  42.     DBEdit15: TDBEdit;
  43.     DBEdit1: TDBEdit;
  44.     Panel6: TPanel;
  45.     Label11: TLabel;
  46.     Label12: TLabel;
  47.     Label13: TLabel;
  48.     DBEdit11: TDBEdit;
  49.     DBEdit12: TDBEdit;
  50.     DBEdit13: TDBEdit;
  51.     ScrollBox3: TScrollBox;
  52.     Panel_BM_1: TPanel;
  53.     DBGrid2: TDBGrid;
  54.     Panel8: TPanel;
  55.     SPEED_bm_4: TSpeedButton;
  56.     SPEED_BM_6: TSpeedButton;
  57.     DBNavigator2: TDBNavigator;
  58.     Panel_BM_5: TPanel;
  59.     Label28: TLabel;
  60.     Label29: TLabel;
  61.     Label30: TLabel;
  62.     Label31: TLabel;
  63.     Label32: TLabel;
  64.     Label37: TLabel;
  65.     Label38: TLabel;
  66.     Label40: TLabel;
  67.     DBEdit30: TDBEdit;
  68.     DBEdit31: TDBEdit;
  69.     DBEdit32: TDBEdit;
  70.     DBEdit33: TDBEdit;
  71.     DBEdit34: TDBEdit;
  72.     DBEdit39: TDBEdit;
  73.     DBCheckBox3: TDBCheckBox;
  74.     DBComboBox2: TDBComboBox;
  75.     Panel_BM_6: TPanel;
  76.     Label33: TLabel;
  77.     Label34: TLabel;
  78.     Label35: TLabel;
  79.     Label36: TLabel;
  80.     DBEdit35: TDBEdit;
  81.     DBEdit36: TDBEdit;
  82.     DBEdit37: TDBEdit;
  83.     DBEdit38: TDBEdit;
  84.     DS_BMLLD: TDataSource;
  85.     DS_BMLLD_DETAIL: TDataSource;
  86.     Label14: TLabel;
  87.     DBEdit14: TDBEdit;
  88.     Label39: TLabel;
  89.     DBCheckBox4: TDBCheckBox;
  90.     Label41: TLabel;
  91.     DBEdit40: TDBEdit;
  92.     Label42: TLabel;
  93.     DBEdit41: TDBEdit;
  94.     Timer1: TTimer;
  95.     StatusBar1: TStatusBar;
  96.     StatusBar2: TStatusBar;
  97.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  98.     procedure SPEED_4Click(Sender: TObject);
  99.     procedure SPEED_BM_6Click(Sender: TObject);
  100.     procedure SpeedButton1Click(Sender: TObject);
  101.     procedure SPEED_bm_4Click(Sender: TObject);
  102.     procedure Timer1Timer(Sender: TObject);
  103.     procedure FormCreate(Sender: TObject);
  104.   private
  105.     { Private declarations }
  106.   public
  107.     { Public declarations }
  108.   end;
  109. var
  110.   frmDjsh: TfrmDjsh;
  111. implementation
  112. uses U_mainform, U_djdw, U_Clsldjshkp, WzglDB, U_bmlldjshkp;
  113. {$R *.DFM}
  114. procedure TfrmDjsh.FormClose(Sender: TObject; var Action: TCloseAction);
  115. begin
  116.   action := cafree;
  117.   FrmDjsh := nil;
  118. end;
  119. procedure TfrmDjsh.SPEED_4Click(Sender: TObject);
  120. begin
  121.   application.createform(TfrmDjdw, frmDjdw);
  122.   try
  123.     frmDjdw.showmodal;
  124.   finally
  125.     frmDjdw.free;
  126.   end;
  127. end;
  128. procedure TfrmDjsh.SPEED_BM_6Click(Sender: TObject);
  129. begin
  130.   application.createform(TfrmDjdw, frmDjdw);
  131.   try
  132.     frmDjdw.PageControl1.ActivePageIndex := 1;
  133.     frmDjdw.showmodal;
  134.   finally
  135.     frmDjdw.free;
  136.   end;
  137. end;
  138. procedure TfrmDjsh.SpeedButton1Click(Sender: TObject);
  139. begin
  140.   if DM.CDS_CLSLD.FieldByName('是否审核').value = true then
  141.   begin
  142.     application.MessageBox('此单据已审核', '材料与计划管理系统', mb_iconinformation + mb_defbutton1);
  143.     exit;
  144.   end;
  145.   if application.MessageBox('请确认是否审核通过', '材料与计划管理系统', mb_iconinformation + mb_yesno) = idyes then
  146.   begin
  147.     application.createform(TfrmClsldDjsh, frmClsldDjsh);
  148.     try
  149.       DM.CDS_CLSLD.edit;
  150.       frmClsldDjsh.showmodal;
  151.     finally
  152.       frmClsldDjsh.free;
  153.     end;
  154.   end;
  155. end;
  156. procedure TfrmDjsh.SPEED_bm_4Click(Sender: TObject);
  157. begin
  158.   if DM.CDS_BMLLD.FieldByName('是否审核').value = true then
  159.   begin
  160.     application.MessageBox('此单据已审核', '材料与计划管理系统', mb_iconinformation + mb_defbutton1);
  161.     exit;
  162.   end;
  163.   if application.MessageBox('请确认是否审核通过', '材料与计划管理系统', mb_iconinformation + mb_yesno) = idyes then
  164.   begin
  165.     application.createform(TfrmBmlldDjsh, frmBmlldDjsh);
  166.     try
  167.       frmBmlldDjsh.showmodal;
  168.     finally
  169.       frmBmlldDjsh.free;
  170.     end;
  171.   end;
  172. end;
  173. procedure TfrmDjsh.Timer1Timer(Sender: TObject);
  174. begin
  175.   statusbar1.Panels[2].text := '共有:' + inttostr(DM.CDS_CLSLD.recordcount) + '条记录';
  176.   statusbar1.refresh;
  177.   statusbar2.Panels[2].text := '共有:' + inttostr(DM.CDS_BMLLD.recordcount) + '条记录';
  178.   statusbar2.refresh;
  179.   if DM.CDS_CLSLD.fieldbyname('是否审核').value = true then
  180.   begin
  181.     statusbar1.panels[1].text := '此单据已审核';
  182.   end;
  183.   if (DM.CDS_CLSLD.fieldbyname('是否审核').value = null) or (DM.CDS_CLSLD.fieldbyname('是否审核').value = false) then
  184.   begin
  185.     statusbar1.panels[1].text := '此单据未审核';
  186.   end;
  187.   statusbar1.refresh;
  188.   if DM.CDS_BMLLD.fieldbyname('是否审核').value = true then
  189.   begin
  190.     statusbar2.panels[1].text := '此单据已审核';
  191.   end;
  192.   if (DM.CDS_BMLLD.fieldbyname('是否审核').value = null) or (DM.CDS_BMLLD.fieldbyname('是否审核').value = false) then
  193.   begin
  194.     statusbar2.panels[1].text := '此单据未审核';
  195.   end;
  196.   statusbar2.refresh;
  197. end;
  198. procedure TfrmDjsh.FormCreate(Sender: TObject);
  199. begin
  200.   with DM do
  201.   begin
  202.     CDS_CLSLD_DETAIL.Close;
  203.     CDS_CLSLD.Close;
  204.     CDS_BMLLD_DETAIL.Close;
  205.     CDS_BMLLD.Close;
  206.     CDS_CLSLD.Open;
  207.     CDS_CLSLD_DETAIL.Open;
  208.     CDS_BMLLD.Open;
  209.     CDS_BMLLD_DETAIL.Open;
  210.   end;
  211. end;
  212. end.