xt_yhz_ms.pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:4k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit xt_yhz_ms;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ComCtrls, ToolWin, Grids, DBGridEh, StdCtrls, ExtCtrls, DB,
- DBClient, DBGrids, XPBarMenu, PrnDbgeh;
- type
- Txt_yhz = class(TForm)
- CoolBar1: TCoolBar;
- ToolBar1: TToolBar;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- DataSource1: TDataSource;
- ToolButton6: TToolButton;
- ToolButton7: TToolButton;
- DataSource2: TDataSource;
- DataSource3: TDataSource;
- XPBarMenu1: TXPBarMenu;
- GroupBox1: TGroupBox;
- DBGridEh1: TDBGridEh;
- PrintDBGridEh1: TPrintDBGridEh;
- procedure ToolButton1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure ToolButton2Click(Sender: TObject);
- procedure ToolButton3Click(Sender: TObject);
- procedure ToolButton4Click(Sender: TObject);
- procedure ToolButton7Click(Sender: TObject);
- procedure DBGridEh1TitleClick(Column: TColumnEh);
- procedure DBGridEh1DblClick(Sender: TObject);
- procedure ToolButton6Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- xt_yhz: Txt_yhz;
- implementation
- uses yhz_bjs,dms,u_public;
- {$R *.dfm}
- procedure Txt_yhz.ToolButton1Click(Sender: TObject);
- begin
- //DM.xt_yhz.Append;
- dm.xt_yhz.Close;
- dm.xt_yhz.CommandText:='select * from xt_UserGroup where yhz_dm='+''''+''''+'';
- dm.xt_yhz.Open;
- yhz_bj:=Tyhz_bj.create(application);
- yhz_bj.showmodal;
- yhz_bj.Label1.Caption:='增加用户组';
- end;
- procedure Txt_yhz.FormCreate(Sender: TObject);
- begin
- DM.xt_yhz.Active:=true;
- Dm.xt_js.Active:=true;
- Dm.ug_js.Active:=true;
- // dm.xt_yhz.MasterSource:=datasource2;
- // dm.xt_yhz.MasterFields:='js_dm';
- end;
- procedure Txt_yhz.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- action:=cafree;
- xt_yhz:=nil;
- end;
- procedure Txt_yhz.ToolButton2Click(Sender: TObject);
- var s:string;
- begin
- s:=dm.ug_js.fieldbyname('yhz_dm').AsString;
- yhz_bj:=Tyhz_bj.create(self);
- yhz_bj.Label1.Caption:='修改用户组';
- Dm.xt_yhz.Close;
- dm.XT_yhz.CommandText:='select * from xt_UserGroup where yhz_dm='+''''+s+''''+'';
- dm.xt_yhz.Open;
- DM.xt_yhz.Edit;
- yhz_bj.showmodal;
- end;
- procedure Txt_yhz.ToolButton3Click(Sender: TObject);
- var s:string;
- begin
- s:=dm.ug_js.fieldbyname('yhz_dm').AsString;
- if Dm.xt_yhz.RecordCount=0 then
- begin
- application.MessageBox('表中没有数据不能删除!','提示',mb_iconinformation+mb_defbutton1);
- Abort;
- end
- else
- if application.MessageBox('你确定删除吗?','警告',mb_okcancel+mb_iconquestion)=idok then
- begin
- {Dm.xt_yhz.Close;
- dm.XT_yhz.CommandText:='select * from xt_UserGroup where yhz_dm='+''''+s+''''+'';
- dm.xt_yhz.Open;
- Dm.xt_yhz.Delete;
- Dm.xt_yhz.ApplyUpdates(0);}
- Dm.xt_yhz.Close;
- dm.XT_yhz.CommandText:='delete xt_UserGroup where yhz_dm='+''''+s+''''+'';
- dm.xt_yhz.Execute;
- Dm.xt_yhz.Close;
- dm.XT_yhz.CommandText:='select * from xt_UserGroup';
- dm.xt_yhz.Open;
- toolbutton4.Click;
- end;
- end;
- procedure Txt_yhz.ToolButton4Click(Sender: TObject);
- begin
- dm.ug_js.Close;
- dm.ug_js.CommandText:='select * from ug_js';
- dm.ug_js.Open;
- end;
- procedure Txt_yhz.ToolButton7Click(Sender: TObject);
- begin
- close;
- end;
- procedure Txt_yhz.DBGridEh1TitleClick(Column: TColumnEh);
- begin
- // Dm.xt_yhz.IndexFieldNames:=Column.Field.FieldName;
- end;
- procedure Txt_yhz.DBGridEh1DblClick(Sender: TObject);
- begin
- toolbutton2.Click;
- end;
- procedure Txt_yhz.ToolButton6Click(Sender: TObject);
- begin
- PrintDBGridEh1.Preview;
- end;
- end.