Am_Ajtzs.~pas
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:3k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit Am_Ajtzs;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, DB, ImgList, DBCtrlsEh, StdCtrls, DBCtrls, DBLookupEh, Mask,
  6.   Buttons, ExtCtrls;
  7. type
  8.   TAm_Ajtz = class(TForm)
  9.     Panel2: TPanel;
  10.     Panel1: TPanel;
  11.     Label1: TLabel;
  12.     Label2: TLabel;
  13.     Label3: TLabel;
  14.     Label4: TLabel;
  15.     Label5: TLabel;
  16.     Label6: TLabel;
  17.     Label7: TLabel;
  18.     Label8: TLabel;
  19.     Label9: TLabel;
  20.     Label10: TLabel;
  21.     Label11: TLabel;
  22.     Label12: TLabel;
  23.     Label13: TLabel;
  24.     Label14: TLabel;
  25.     Label15: TLabel;
  26.     Label16: TLabel;
  27.     Label17: TLabel;
  28.     Label18: TLabel;
  29.     Label19: TLabel;
  30.     Label20: TLabel;
  31.     Label21: TLabel;
  32.     Label22: TLabel;
  33.     Label23: TLabel;
  34.     Label24: TLabel;
  35.     Label25: TLabel;
  36.     DBEdit3: TDBEdit;
  37.     DBEdit4: TDBEdit;
  38.     DBEdit5: TDBEdit;
  39.     DBEdit6: TDBEdit;
  40.     DBEdit9: TDBEdit;
  41.     DBEdit11: TDBEdit;
  42.     DBEdit14: TDBEdit;
  43.     DBEdit16: TDBEdit;
  44.     DBEdit17: TDBEdit;
  45.     DBLookupComboboxEh1: TDBLookupComboboxEh;
  46.     DBLookupComboboxEh2: TDBLookupComboboxEh;
  47.     DBLookupComboboxEh3: TDBLookupComboboxEh;
  48.     DBMemo1: TDBMemo;
  49.     DBMemo2: TDBMemo;
  50.     DBMemo3: TDBMemo;
  51.     DBEditEh1: TDBEditEh;
  52.     DBEditEh3: TDBEditEh;
  53.     DBEditEh4: TDBEditEh;
  54.     DBEditEh5: TDBEditEh;
  55.     DBEditEh2: TDBEditEh;
  56.     DBEditEh6: TDBEditEh;
  57.     ImageList1: TImageList;
  58.     ds_ajgl: TDataSource;
  59.     DBLookupComboboxEh4: TDBLookupComboboxEh;
  60.     SpeedButton1: TSpeedButton;
  61.     DBEditEh7: TDBEditEh;
  62.     SpeedButton2: TSpeedButton;
  63.     SpeedButton3: TSpeedButton;
  64.     procedure QuitClick(Sender: TObject);
  65.     procedure SaveClick(Sender: TObject);
  66.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  67.     procedure SpeedButton1Click(Sender: TObject);
  68.     procedure SpeedButton2Click(Sender: TObject);
  69.     procedure SpeedButton3Click(Sender: TObject);
  70.   private
  71.     { Private declarations }
  72.   public
  73.     { Public declarations }
  74.   end;
  75. var
  76.   Am_Ajtz: TAm_Ajtz;
  77. implementation
  78. uses DMs, am_ajlb_xzs;
  79. {$R *.dfm}
  80. procedure TAm_Ajtz.FormClose(Sender: TObject; var Action: TCloseAction);
  81. begin
  82.   action:=cafree;
  83.   am_ajtz:=nil;
  84. end;
  85. procedure TAm_Ajtz.SpeedButton1Click(Sender: TObject);
  86. begin
  87.  if am_ajlb_xz=Nil then
  88.   begin
  89.     am_ajlb_xz:=Tam_ajlb_xz.create(application);
  90.     am_ajlb_xz.showmodal;
  91.   end;
  92. end;
  93. procedure TAm_Ajtz.SpeedButton2Click(Sender: TObject);
  94. var s_kwdm,s2,zcg_s:string;
  95. begin
  96.  zcg_s:=dm.Am_ajgl.fieldbyname('aj_xh').AsString;//取当前序号
  97.  s2:=dm.Am_ajgl.fieldbyname('ajlb_dm').AsString;//当前树节点的案卷类别代码
  98.  dm.am_ajgl.Edit;
  99.  if dm.Am_ajgl.ApplyUpdates(0)=0 then
  100.   begin
  101.     application.MessageBox('案卷调整成功','提示',mb_ok+mb_iconinformation);
  102.     dm.Am_ajgl.Close;
  103.     dm.am_ajgl.CommandText:='select * from am_ajgl';
  104.     dm.am_ajgl.Open;
  105.     dm.V_AJGD.Close;
  106.     dm.V_AJGD.CommandText:='select * from v_Ajgd where ajlb_dm='+''''+s2+''''+'';
  107.     dm.v_ajgd.Open;
  108.     close;
  109.   end
  110.  else
  111.   begin
  112.    application.MessageBox('案卷调整失败','提示',mb_ok+mb_iconinformation);
  113.    exit;
  114.   end;
  115. end;
  116. procedure TAm_Ajtz.SpeedButton3Click(Sender: TObject);
  117. begin
  118. Close; 
  119. end;
  120. end.