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

Delphi控件源码

开发平台:

Delphi

  1. unit am_ajxh_xhs;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, DB, DBCtrlsEh, StdCtrls, DBCtrls, Mask, ExtCtrls, Buttons;
  6. type
  7.   Tam_ajxh_xh = class(TForm)
  8.     btn_save: TSpeedButton;
  9.     btn_quit: TSpeedButton;
  10.     Panel1: TPanel;
  11.     Label1: TLabel;
  12.     Label2: TLabel;
  13.     Label3: TLabel;
  14.     Label4: TLabel;
  15.     DBEdit4: TDBEdit;
  16.     DBMemo1: TDBMemo;
  17.     DBMemo2: TDBMemo;
  18.     DBEditEh1: TDBEditEh;
  19.     DataSource1: TDataSource;
  20.     procedure btn_quitClick(Sender: TObject);
  21.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  22.     procedure FormCreate(Sender: TObject);
  23.     procedure btn_saveClick(Sender: TObject);
  24.   private
  25.     { Private declarations }
  26.   public
  27.     { Public declarations }
  28.   end;
  29. var
  30.   am_ajxh_xh: Tam_ajxh_xh;
  31. implementation
  32. uses dms,u_public, mainfrms;
  33. {$R *.dfm}
  34. procedure Tam_ajxh_xh.btn_quitClick(Sender: TObject);
  35. begin
  36.  close;
  37. end;
  38. procedure Tam_ajxh_xh.FormClose(Sender: TObject; var Action: TCloseAction);
  39. begin
  40.  action:=cafree;
  41.  am_ajxh_xh:=nil;
  42. end;
  43. procedure Tam_ajxh_xh.FormCreate(Sender: TObject);
  44. //var s:string;
  45. begin
  46.   //s:=dm.V_ajgl_dxh.fieldbyname('aj_xh').AsString;
  47.   //dm.am_ajxh.Close;
  48.   //dm.am_ajxh.CommandText:='select * from am_ajxh where aj_xh='+''''+s+''''+'';
  49.   //dm.am_ajxh.Open;
  50.   //dbedit4.Text:=dm.am_ajxh.fieldbyname('ajxh_jdr').AsString;
  51.   //鉴定人是否和销毁人一样
  52.   dbediteh1.Text:=formatdatetime('yyyy-mm-dd',now);
  53. end;
  54. procedure Tam_ajxh_xh.btn_saveClick(Sender: TObject);
  55. var i:integer;
  56.     s:string;
  57. begin
  58.    s:=dm.V_ajgl_dxh.fieldbyname('aj_xh').AsString;
  59.    dm.am_ajxh.ApplyUpdates(0);
  60.    i:=dm.am_ajxh.ApplyUpdates(0);
  61.    if i=0 then
  62.     begin
  63.       application.MessageBox('数据保存成功','提示',mb_ok+mb_iconinformation);
  64.       dm.V_ajgl_gd.Close;
  65.       dm.V_ajgl_gd.CommandText:='update v_ajgl_gd set ajzt_mc=''已销毁案卷'' where aj_xh='+''''+s+''''+'';
  66.       dm.V_ajgl_gd.Execute;
  67.       //dm.V_ajgl_gd.Close;
  68.       //dm.V_ajgl_gd.CommandText:='P_ajgl_dxh';//查找待销毁案卷
  69.       //dm.V_ajgl_gd.Open;
  70.       dm.V_ajgl_Dxh.Close;
  71.       dm.V_ajgl_Dxh.CommandText:='P_ajgl_dxh';
  72.       dm.v_ajgl_dxh.Open;
  73.       dm.V_ajgl_yxh.Close;
  74.       dm.V_ajgl_yxh.CommandText:='P_ajgl_yxh';//查找待销毁案卷
  75.       dm.V_ajgl_yxh.Open;
  76.       close;
  77.     end
  78.    else
  79.     begin
  80.       application.MessageBox('数据保存失败','提示',mb_ok+mb_iconinformation);
  81.       exit;
  82.     end;
  83. end;
  84. end.