U_htgd.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:5k
- unit U_htgd;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ExtCtrls, ComCtrls, Db, DBClient, Grids, DBGrids, Buttons, Menus,
- ImgList, ToolWin;
- type
- TForm51 = class(TForm)
- Panel1: TPanel;
- Panel2: TPanel;
- StatusBar1: TStatusBar;
- Splitter1: TSplitter;
- DBGrid1: TDBGrid;
- ClientDataSet1: TClientDataSet;
- DataSource1: TDataSource;
- DBGrid2: TDBGrid;
- ToolBar1: TToolBar;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ImageList1: TImageList;
- PopupMenu3: TPopupMenu;
- N2: TMenuItem;
- N1: TMenuItem;
- A1: TMenuItem;
- ClientDataSet1ID: TIntegerField;
- ClientDataSet1CDSDesigner: TStringField;
- ClientDataSet1CDSDesigner2: TStringField;
- ClientDataSet1CDSDesigner3: TStringField;
- ClientDataSet1CDSDesigner4: TStringField;
- ClientDataSet1CDSDesigner5: TDateTimeField;
- ClientDataSet1Z2: TStringField;
- ClientDataSet1z3: TStringField;
- ClientDataSet1z4: TStringField;
- ClientDataSet1z5: TStringField;
- ClientDataSet1z6: TStringField;
- ClientDataSet1z7: TStringField;
- ClientDataSet1z8: TStringField;
- ClientDataSet1z9: TStringField;
- ClientDataSet1z10: TStringField;
- ClientDataSet1z11: TStringField;
- ClientDataSet1z12: TStringField;
- ClientDataSet1z13: TStringField;
- ClientDataSet1CDSDesigner6: TStringField;
- ClientDataSet1CDSDesigner7: TStringField;
- ClientDataSet1CDSDesigner8: TStringField;
- ClientDataSet1CDSDesigner9: TStringField;
- ClientDataSet1CDSDesigner10: TStringField;
- ClientDataSet1CDSDesigner11: TStringField;
- ClientDataSet1CDSDesigner12: TStringField;
- ClientDataSet1CDSDesigner13: TStringField;
- ClientDataSet1CDSDesigner14: TStringField;
- ClientDataSet1CDSDesigner15: TStringField;
- ClientDataSet1CDSDesigner16: TStringField;
- ClientDataSet1CDSDesigner17: TStringField;
- ClientDataSet1CDSDesigner18: TStringField;
- ClientDataSet1CDSDesigner19: TStringField;
- ClientDataSet1CDSDesigner20: TStringField;
- ClientDataSet1CDSDesigner21: TStringField;
- ClientDataSet1CDSDesigner22: TStringField;
- ClientDataSet1CDSDesigner23: TStringField;
- ClientDataSet1CDSDesigner24: TStringField;
- ClientDataSet1CDSDesigner25: TStringField;
- ClientDataSet1CDSDesigner26: TStringField;
- ClientDataSet1CDSDesigner27: TDateTimeField;
- ClientDataSet1CDSDesigner28: TBooleanField;
- ClientDataSet1CDSDesigner29: TStringField;
- ClientDataSet1CDSDesigner30: TDateTimeField;
- ClientDataSet1Q_CGHT_JTCL: TDataSetField;
- procedure ToolButton1Click(Sender: TObject);
- procedure N2Click(Sender: TObject);
- procedure N1Click(Sender: TObject);
- procedure A1Click(Sender: TObject);
- procedure FormShow(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
- DataCol: Integer; Column: TColumn; State: TGridDrawState);
- procedure DBGrid2DrawColumnCell(Sender: TObject; const Rect: TRect;
- DataCol: Integer; Column: TColumn; State: TGridDrawState);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form51: TForm51;
- implementation
- uses U_mainform, U_htgdxx;
- {$R *.DFM}
- procedure TForm51.ToolButton1Click(Sender: TObject);
- begin
- if clientdataset1.RecordCount=0 then
- begin
- application.messagebox('请选择具体合同','物资管理系统',mb_iconinformation+mb_defbutton1);
- exit;
- end;
- if clientdataset1.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(Tform52,form52);
- try
- form52.showmodal;
- finally
- form52.free;
- end;
- end;
- end;
- procedure TForm51.N2Click(Sender: TObject);
- begin
- clientdataset1.filter:='是否归档=0 or 是否归档=null';
- clientdataset1.filtered:=true;
- statusbar1.Panels[1].text:='显示未归档';
- statusbar1.refresh;
- end;
- procedure TForm51.N1Click(Sender: TObject);
- begin
- clientdataset1.filter:='是否归档=1';
- clientdataset1.filtered:=true;
- statusbar1.Panels[1].text:='显示已归档';
- statusbar1.refresh;
- end;
- procedure TForm51.A1Click(Sender: TObject);
- begin
- clientdataset1.filtered:=false;
- statusbar1.Panels[1].text:='显示全部';
- statusbar1.refresh;
- end;
- procedure TForm51.FormShow(Sender: TObject);
- begin
- clientdataset1.filter:='是否归档=0 or 是否归档=null';
- clientdataset1.filtered:=true;
- statusbar1.panels[1].text:='显示未归档';
- statusbar1.Refresh;
- end;
- procedure TForm51.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- action:=cafree;
- end;
- procedure TForm51.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
- DataCol: Integer; Column: TColumn; State: TGridDrawState);
- begin
- if clientdataset1.FieldByName('是否归档').value=1 then
- dbgrid1.Canvas.Font.Color:=clsilver;
- dbgrid1.DefaultDrawDataCell(rect,column.field,state);
- end;
- procedure TForm51.DBGrid2DrawColumnCell(Sender: TObject; const Rect: TRect;
- DataCol: Integer; Column: TColumn; State: TGridDrawState);
- begin
- if clientdataset1.FieldByName('是否归档').value=1 then
- dbgrid2.Canvas.Font.Color:=clsilver;
- dbgrid2.DefaultDrawDataCell(rect,column.field,state);
- end;
- end.