📄 untpartyinfo.pas
字号:
unit UntPartyInfo;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, RzDBGrid, ExtCtrls, UntExcSQL, Menus, ImgList;
type
TFrmPartyInfo = class(TForm)
Panel1: TPanel;
RzDBGrid1: TRzDBGrid;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
ImageList1: TImageList;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
private
{ Private declarations }
public
Excparty:TExcSQL;
{ Public declarations }
end;
var
FrmPartyInfo: TFrmPartyInfo;
ExcDel:TExcSQL;
implementation
uses UntAppMDIConsts, UntPartyEditAdd;
{$R *.dfm}
procedure TFrmPartyInfo.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:=CaFree;
end;
procedure TFrmPartyInfo.FormCreate(Sender: TObject);
begin
ExcParty:=TExcSQL.Create ;
ExcDel:=TExcSQL.Create;
RzDBGrid1.DataSource:=ExcParty.DataSource;
end;
procedure TFrmPartyInfo.FormShow(Sender: TObject);
begin
Excparty.SQL:='Select PartyBaseInfo.* ,PartyBranch.Name as 党支部,PartyMain.Name as 党总支,Depart.Name as 部门,Duty.Name as 职称 ';
Excparty.SQL:=Excparty.SQL+' from PartyBaseInfo,PartyBranch,PartyMainBranch,PartyMain,Depart,Duty';
Excparty.SQL:=Excparty.SQL+' where PartyBaseInfo.PartyID=PartyMainBranch.PartyID and PartyMainBranch.BranchID=PartyBranch.ID and PartyMainBranch.MainID=PartyMain.ID ' ;
Excparty.SQL:=Excparty.SQL+' and PartyMainBranch.DepartId=Depart.ID and PartyMainBranch.DutyID=Duty.ID ';
ExcParty.ExcSQL(ExcParty.SQL,'Search');
end;
procedure TFrmPartyInfo.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
ExcParty.Free;
ExcDel.Free;
end;
procedure TFrmPartyInfo.N1Click(Sender: TObject);
begin
Try
Application.CreateForm(TFrmPartyEditAdd,FrmPartyEditAdd);
FrmPartyEditAdd.NewEdit:=False;
FrmPartyEditAdd.ShowModal;
FreeAndNil(FrmPartyEditAdd);
Except
end;
end;
procedure TFrmPartyInfo.N2Click(Sender: TObject);
begin
Try
Application.CreateForm(TFrmPartyEditAdd,FrmPartyEditAdd);
FrmPartyEditAdd.NewEdit:=True;
FrmPartyEditAdd.ShowModal;
FreeAndNil(FrmPartyEditAdd);
Except
end;
end;
procedure TFrmPartyInfo.N3Click(Sender: TObject);
begin
if Messagebox(handle,'您确定要删除该党员信息吗?','询问',MB_YESNO+MB_ICONQUESTION)=IDYES then
begin
Try
ExcDel.SQL:='Delete From PartyMainBranch where PartyID="'+ExcParty.ADOQuery.FieldByName('PartyID').AsString+'"';
ExcDel.ExcSQL(ExcDel.SQL,'Mod');
ExcDel.SQL:='Delete From PartyReMent Where PartyID="'+ExcParty.ADOQuery.FieldByName('PartyID').AsString+'"';
ExcDel.ExcSQL(ExcDel.SQL,'Mod');
ExcParty.ADOQuery.Delete;
except
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -