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

Delphi/CppBuilder

开发平台:

Delphi

  1. unit U_bmda_fzlr;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  5.   Grids, DBGrids, Db, DBClient, ExtCtrls, Buttons;
  6. type
  7.   TfrmBmda_fzlr = class(TForm)
  8.     Panel1: TPanel;
  9.     Panel2: TPanel;
  10.     DataSource1: TDataSource;
  11.     DBGrid: TDBGrid;
  12.     SpeedButton1: TSpeedButton;
  13.     SpeedButton2: TSpeedButton;
  14.     procedure SpeedButton1Click(Sender: TObject);
  15.     procedure SpeedButton2Click(Sender: TObject);
  16.     procedure FormActivate(Sender: TObject);
  17.     procedure DBGridTitleClick(Column: TColumn);
  18.     procedure FormCreate(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24. var
  25.   frmBmda_fzlr: TfrmBmda_fzlr;
  26.   pub_Bmmc: string;
  27. implementation
  28. uses U_mainform, U_zgda, WzglDB, u_public;
  29. {$R *.DFM}
  30. procedure TfrmBmda_fzlr.SpeedButton1Click(Sender: TObject);
  31. begin
  32.   if DM.CDS_BMDA_INDEX.recordcount = 0 then
  33.   begin
  34.     application.messagebox('请选择具体部门', '物资管理系统', mb_iconinformation + mb_defbutton1);
  35.     exit;
  36.   end;
  37.   pub_Bmmc := DM.CDS_BMDA_INDEX.fieldbyname('部门名称').asstring;
  38.   close;
  39. end;
  40. procedure TfrmBmda_fzlr.SpeedButton2Click(Sender: TObject);
  41. begin
  42.   close;
  43. end;
  44. procedure TfrmBmda_fzlr.FormActivate(Sender: TObject);
  45. begin
  46.   DM.CDS_BMDA_INDEX.IndexFieldNames := '部门编码';
  47. end;
  48. procedure TfrmBmda_fzlr.DBGridTitleClick(Column: TColumn);
  49. begin
  50.   DBGridSort(dbgrid, column);
  51. end;
  52. procedure TfrmBmda_fzlr.FormCreate(Sender: TObject);
  53. begin
  54.   DM.CDS_BMDA_INDEX.Active := True;
  55. end;
  56. end.