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 FormClose(Sender: TObject; var Action: TCloseAction);
  65.     procedure SpeedButton1Click(Sender: TObject);
  66.     procedure SpeedButton2Click(Sender: TObject);
  67.     procedure SpeedButton3Click(Sender: TObject);
  68.   private
  69.     { Private declarations }
  70.   public
  71.     { Public declarations }
  72.   end;
  73. var
  74.   Am_Ajtz: TAm_Ajtz;
  75. implementation
  76. uses DMs, am_ajlb_xzs;
  77. {$R *.dfm}
  78. procedure TAm_Ajtz.FormClose(Sender: TObject; var Action: TCloseAction);
  79. begin
  80.   action:=cafree;
  81.   am_ajtz:=nil;
  82. end;
  83. procedure TAm_Ajtz.SpeedButton1Click(Sender: TObject);
  84. begin
  85.  if am_ajlb_xz=Nil then
  86.   begin
  87.     am_ajlb_xz:=Tam_ajlb_xz.create(application);
  88.     am_ajlb_xz.showmodal;
  89.   end;
  90. end;
  91. procedure TAm_Ajtz.SpeedButton2Click(Sender: TObject);
  92. var s_kwdm,s2,zcg_s:string;
  93. begin
  94.  zcg_s:=dm.Am_ajgl.fieldbyname('aj_xh').AsString;//取当前序号
  95.  s2:=dm.Am_ajgl.fieldbyname('ajlb_dm').AsString;//当前树节点的案卷类别代码
  96.  dm.am_ajgl.Edit;
  97.  if dm.Am_ajgl.ApplyUpdates(0)=0 then
  98.   begin
  99.     application.MessageBox('案卷调整成功','提示',mb_ok+mb_iconinformation);
  100.     dm.Am_ajgl.Close;
  101.     dm.am_ajgl.CommandText:='select * from am_ajgl';
  102.     dm.am_ajgl.Open;
  103.     dm.V_AJGD.Close;
  104.     dm.V_AJGD.CommandText:='select * from v_Ajgd where ajlb_dm='+''''+s2+''''+'';
  105.     dm.v_ajgd.Open;
  106.     close;
  107.   end
  108.  else
  109.   begin
  110.    application.MessageBox('案卷调整失败','提示',mb_ok+mb_iconinformation);
  111.    exit;
  112.   end;
  113. end;
  114. procedure TAm_Ajtz.SpeedButton3Click(Sender: TObject);
  115. begin
  116. Close; 
  117. end;
  118. end.