U_djsh.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:6k
- unit U_djsh;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- DBCtrls, Buttons, StdCtrls, Mask, Grids, DBGrids, ExtCtrls, Db, DBClient,
- ComCtrls, variants;
- type
- TfrmDjsh = class(TForm)
- DS_CLSLD: TDataSource;
- DS_CLSLD_DETAIL: TDataSource;
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- TabSheet2: TTabSheet;
- ScrollBox2: TScrollBox;
- Panel1: TPanel;
- DBGrid1: TDBGrid;
- Panel4: TPanel;
- SPEED_4: TSpeedButton;
- SpeedButton1: TSpeedButton;
- DBNavigator1: TDBNavigator;
- Panel5: TPanel;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- Label10: TLabel;
- Label15: TLabel;
- DBEdit2: TDBEdit;
- DBEdit3: TDBEdit;
- DBEdit4: TDBEdit;
- DBEdit5: TDBEdit;
- DBEdit6: TDBEdit;
- DBEdit7: TDBEdit;
- DBEdit8: TDBEdit;
- DBEdit9: TDBEdit;
- DBEdit10: TDBEdit;
- DBEdit15: TDBEdit;
- DBEdit1: TDBEdit;
- Panel6: TPanel;
- Label11: TLabel;
- Label12: TLabel;
- Label13: TLabel;
- DBEdit11: TDBEdit;
- DBEdit12: TDBEdit;
- DBEdit13: TDBEdit;
- ScrollBox3: TScrollBox;
- Panel_BM_1: TPanel;
- DBGrid2: TDBGrid;
- Panel8: TPanel;
- SPEED_bm_4: TSpeedButton;
- SPEED_BM_6: TSpeedButton;
- DBNavigator2: TDBNavigator;
- Panel_BM_5: TPanel;
- Label28: TLabel;
- Label29: TLabel;
- Label30: TLabel;
- Label31: TLabel;
- Label32: TLabel;
- Label37: TLabel;
- Label38: TLabel;
- Label40: TLabel;
- DBEdit30: TDBEdit;
- DBEdit31: TDBEdit;
- DBEdit32: TDBEdit;
- DBEdit33: TDBEdit;
- DBEdit34: TDBEdit;
- DBEdit39: TDBEdit;
- DBCheckBox3: TDBCheckBox;
- DBComboBox2: TDBComboBox;
- Panel_BM_6: TPanel;
- Label33: TLabel;
- Label34: TLabel;
- Label35: TLabel;
- Label36: TLabel;
- DBEdit35: TDBEdit;
- DBEdit36: TDBEdit;
- DBEdit37: TDBEdit;
- DBEdit38: TDBEdit;
- DS_BMLLD: TDataSource;
- DS_BMLLD_DETAIL: TDataSource;
- Label14: TLabel;
- DBEdit14: TDBEdit;
- Label39: TLabel;
- DBCheckBox4: TDBCheckBox;
- Label41: TLabel;
- DBEdit40: TDBEdit;
- Label42: TLabel;
- DBEdit41: TDBEdit;
- Timer1: TTimer;
- StatusBar1: TStatusBar;
- StatusBar2: TStatusBar;
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure SPEED_4Click(Sender: TObject);
- procedure SPEED_BM_6Click(Sender: TObject);
- procedure SpeedButton1Click(Sender: TObject);
- procedure SPEED_bm_4Click(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- frmDjsh: TfrmDjsh;
- implementation
- uses U_mainform, U_djdw, U_Clsldjshkp, WzglDB, U_bmlldjshkp;
- {$R *.DFM}
- procedure TfrmDjsh.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- action := cafree;
- FrmDjsh := nil;
- end;
- procedure TfrmDjsh.SPEED_4Click(Sender: TObject);
- begin
- application.createform(TfrmDjdw, frmDjdw);
- try
- frmDjdw.showmodal;
- finally
- frmDjdw.free;
- end;
- end;
- procedure TfrmDjsh.SPEED_BM_6Click(Sender: TObject);
- begin
- application.createform(TfrmDjdw, frmDjdw);
- try
- frmDjdw.PageControl1.ActivePageIndex := 1;
- frmDjdw.showmodal;
- finally
- frmDjdw.free;
- end;
- end;
- procedure TfrmDjsh.SpeedButton1Click(Sender: TObject);
- begin
- if DM.CDS_CLSLD.FieldByName('是否审核').value = true then
- begin
- application.MessageBox('此单据已审核', '材料与计划管理系统', mb_iconinformation + mb_defbutton1);
- exit;
- end;
- if application.MessageBox('请确认是否审核通过', '材料与计划管理系统', mb_iconinformation + mb_yesno) = idyes then
- begin
- application.createform(TfrmClsldDjsh, frmClsldDjsh);
- try
- DM.CDS_CLSLD.edit;
- frmClsldDjsh.showmodal;
- finally
- frmClsldDjsh.free;
- end;
- end;
- end;
- procedure TfrmDjsh.SPEED_bm_4Click(Sender: TObject);
- begin
- if DM.CDS_BMLLD.FieldByName('是否审核').value = true then
- begin
- application.MessageBox('此单据已审核', '材料与计划管理系统', mb_iconinformation + mb_defbutton1);
- exit;
- end;
- if application.MessageBox('请确认是否审核通过', '材料与计划管理系统', mb_iconinformation + mb_yesno) = idyes then
- begin
- application.createform(TfrmBmlldDjsh, frmBmlldDjsh);
- try
- frmBmlldDjsh.showmodal;
- finally
- frmBmlldDjsh.free;
- end;
- end;
- end;
- procedure TfrmDjsh.Timer1Timer(Sender: TObject);
- begin
- statusbar1.Panels[2].text := '共有:' + inttostr(DM.CDS_CLSLD.recordcount) + '条记录';
- statusbar1.refresh;
- statusbar2.Panels[2].text := '共有:' + inttostr(DM.CDS_BMLLD.recordcount) + '条记录';
- statusbar2.refresh;
- if DM.CDS_CLSLD.fieldbyname('是否审核').value = true then
- begin
- statusbar1.panels[1].text := '此单据已审核';
- end;
- if (DM.CDS_CLSLD.fieldbyname('是否审核').value = null) or (DM.CDS_CLSLD.fieldbyname('是否审核').value = false) then
- begin
- statusbar1.panels[1].text := '此单据未审核';
- end;
- statusbar1.refresh;
- if DM.CDS_BMLLD.fieldbyname('是否审核').value = true then
- begin
- statusbar2.panels[1].text := '此单据已审核';
- end;
- if (DM.CDS_BMLLD.fieldbyname('是否审核').value = null) or (DM.CDS_BMLLD.fieldbyname('是否审核').value = false) then
- begin
- statusbar2.panels[1].text := '此单据未审核';
- end;
- statusbar2.refresh;
- end;
- procedure TfrmDjsh.FormCreate(Sender: TObject);
- begin
- with DM do
- begin
- CDS_CLSLD_DETAIL.Close;
- CDS_CLSLD.Close;
- CDS_BMLLD_DETAIL.Close;
- CDS_BMLLD.Close;
- CDS_CLSLD.Open;
- CDS_CLSLD_DETAIL.Open;
- CDS_BMLLD.Open;
- CDS_BMLLD_DETAIL.Open;
- end;
- end;
- end.