⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit7.~pas

📁 飞思科技的书不错
💻 ~PAS
字号:
unit Unit7;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;

type
  TForm_relation = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    MC_B: TMonthCalendar;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    ComboBox_Race: TComboBox;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Button1: TButton;
    Edit_Name: TEdit;
    Edit_Call: TEdit;
    Edit_Co: TEdit;
    Edit_Party: TEdit;
    Edit_Post: TEdit;
    Edit_Country: TEdit;
    Edit_Degree: TEdit;
    Edit_Res: TEdit;
    Label11: TLabel;
    Edit_Phone: TEdit;
    Label12: TLabel;
    Edit_Add: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_relation: TForm_relation;

implementation

uses Unit2, Unit6, Unit1;

{$R *.dfm}

procedure TForm_relation.Button1Click(Sender: TObject);
var
count_relation2: integer;
begin
with DM do
    begin
    Table_relation2.Active:=True;
    count_relation2:=Table_relation2.RecordCount;

    if Form1.Modify_relation then
        begin
        Form1.Modify_relation:=False;
        end
    else
        begin
        Table_relation2.Append;
        Table_relation2.FieldByName('序号').AsString:=IntToStr(count_relation2+1);
        end;
        
    Table_relation2.FieldByName('职工号').AsString:=Table_basic.FieldValues['职工号'];
    Table_relation2.FieldByName('姓名').AsString:=Edit_Name.Text;
    Table_relation2.FieldByName('政治面貌').AsString:=Edit_Party.Text;
    Table_relation2.FieldByName('称谓').AsString:=Edit_Call.Text;
    Table_relation2.FieldByName('出生日期').AsDateTime:=MC_B.Date;
    Table_relation2.FieldByName('国籍').AsString:=Edit_Country.Text;
    Table_relation2.FieldByName('民族').AsString:=ComboBox_Race.Items[ComboBox_Race.ItemIndex];
    Table_relation2.FieldByName('学历').AsString:=Edit_Degree.Text;
    Table_relation2.FieldByName('职务').AsString:=Edit_Res.Text;
    Table_relation2.FieldByName('单位').AsString:=Edit_Co.Text;
    Table_relation2.FieldByName('住址').AsString:=Edit_Add.Text;
    Table_relation2.FieldByName('电话').AsString:=Edit_Phone.Text;
    Table_relation2.FieldByName('邮编').AsString:=Edit_Post.Text;

    Table_relation2.Post;
    Table_relation2.Refresh;
    Table_relation2.Active:=False;
    Table_relation.Refresh;
    end;
    Form_relation.Hide;
end;

procedure TForm_relation.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
   with DM do
    begin
    Table_exp.Cancel;
    Table_exp.Refresh;
    end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -