am_ajyjs.~pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:4k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit am_ajyjs;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, DB, ImgList, DBCtrlsEh, StdCtrls, DBCtrls, DBLookupEh, Mask,
- Buttons, ExtCtrls;
- type
- Tam_ajyj = class(TForm)
- Panel2: TPanel;
- Panel1: TPanel;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- Label10: TLabel;
- Label11: TLabel;
- Label12: TLabel;
- Label13: TLabel;
- Label14: TLabel;
- Label15: TLabel;
- Label16: TLabel;
- Label17: TLabel;
- Label18: TLabel;
- Label19: TLabel;
- Label20: TLabel;
- Label21: TLabel;
- Label22: TLabel;
- Label23: TLabel;
- Label24: TLabel;
- Label25: TLabel;
- DBEdit3: TDBEdit;
- DBEdit4: TDBEdit;
- DBEdit5: TDBEdit;
- DBEdit6: TDBEdit;
- DBEdit9: TDBEdit;
- DBEdit11: TDBEdit;
- DBEdit14: TDBEdit;
- DBEdit16: TDBEdit;
- DBEdit17: TDBEdit;
- DBLookupComboboxEh1: TDBLookupComboboxEh;
- DBLookupComboboxEh2: TDBLookupComboboxEh;
- DBLookupComboboxEh3: TDBLookupComboboxEh;
- DBMemo1: TDBMemo;
- DBMemo2: TDBMemo;
- DBMemo3: TDBMemo;
- DBEditEh1: TDBEditEh;
- DBEditEh3: TDBEditEh;
- DBEditEh4: TDBEditEh;
- DBEditEh5: TDBEditEh;
- DBEditEh6: TDBEditEh;
- DBLookupComboboxEh4: TDBLookupComboboxEh;
- DBLookupComboboxEh5: TDBLookupComboboxEh;
- ImageList1: TImageList;
- ds_ajgl: TDataSource;
- Panel3: TPanel;
- Label27: TLabel;
- Label29: TLabel;
- Label28: TLabel;
- DBEdit8: TDBEdit;
- Label30: TLabel;
- DBEdit10: TDBEdit;
- Label31: TLabel;
- DBEdit12: TDBEdit;
- DBMemo4: TDBMemo;
- Ds_Ajyj: TDataSource;
- Label26: TLabel;
- Label32: TLabel;
- Label33: TLabel;
- DBEditEh2: TDBEditEh;
- SpeedButton1: TSpeedButton;
- SpeedButton4: TSpeedButton;
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure FormCreate(Sender: TObject);
- procedure SpeedButton4Click(Sender: TObject);
- procedure SpeedButton1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- am_ajyj: Tam_ajyj;
- implementation
- uses dms,u_public,am_gdajs;
- {$R *.dfm}
- procedure Tam_ajyj.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- action:=cafree;
- am_ajyj:=Nil;
- end;
- //******************************************************************************
- procedure Tam_ajyj.FormCreate(Sender: TObject);
- begin
- dbediteh2.Text:=formatdatetime('yyyy-mm-dd',now);
- end;
- procedure Tam_ajyj.SpeedButton4Click(Sender: TObject);
- begin
- Close;
- end;
- procedure Tam_ajyj.SpeedButton1Click(Sender: TObject);
- var i,j:integer;
- s:string;
- begin
- if dbedit8.Text='' then
- begin
- application.MessageBox('接收单位不能为空','提示',mb_ok+mb_iconinformation);
- end;
- if dbedit10.Text='' then
- begin
- application.MessageBox('移交单位不能为空','提示',mb_ok+mb_iconinformation);
- end;
- if dbedit12.Text='' then
- begin
- application.MessageBox('移交人不能为空','提示',mb_ok+mb_iconinformation);
- end;
- dm.Am_Ajyj.FieldByName('ajyj_yjrq').AsString:=dbediteh2.Text;
- dm.Am_Ajyj.FieldByName('aj_xh').AsString:=dm.V_ajgd.fieldbyname('aj_xh').AsString;
- i:=dm.Am_Ajyj.ApplyUpdates(0);
- if i=0 then
- begin
- application.MessageBox('数据保存成功','提示',mb_ok+mb_iconinformation);
- close;
- end
- else
- begin
- application.MessageBox('数据保存失败','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- //----------将案卷状态改变
- s:=dm.v_ajgd.fieldbyname('aj_xh').AsString;
- dm.V_ajgd.Close;
- dm.V_ajgd.CommandText:='update v_ajgd set ajzt_mc=''移出案卷'',kw_dm=Null where aj_xh='+''''+s+''''+'';
- dm.V_ajgd.Execute;
- dm.V_AJGD.Close;
- dm.v_ajgd.CommandText:='select * from v_Ajgd where ajlb_dm='+''''+gdaj_s2+''''+'';
- dm.v_ajgd.Open;//案卷归档管理
- end;
- end.