rs_amendunit.pas

来自「DELPHI 编写的人事管理系统,根据职工查询各种信息」· PAS 代码 · 共 63 行

PAS
63
字号
unit RS_AmendUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, StdCtrls, Grids, DBGrids, ADODB;

type
  TRS_AmendForm = class(TForm)
    GroupBox1: TGroupBox;
    DBGrid1: TDBGrid;
    GroupBox2: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    ComboBox1: TComboBox;
    Edit1: TEdit;
    Button1: TButton;
    ADOTable1: TADOTable;
    DataSource1: TDataSource;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  RS_AmendForm: TRS_AmendForm;

implementation
uses Login_Unit,RS_InUnit;
{$R *.dfm}

procedure TRS_AmendForm.Button1Click(Sender: TObject);
begin
if combobox1.Text='职工编号' then
  begin
      if RS_Inform.ADOTable1.Locate('职工编号',edit1.Text,[locaseinsensitive])then
       begin
         RS_Inform.Show; RS_Inform.DBNavigator1.Enabled:=false;
         RS_Inform.ADOTable1.Edit;
         RS_Inform.ADOTable1.Post;
       end
       else
         messagebox(RS_Amendform.Handle,'没有符合条件的记录','错误提示',mb_iconerror);
  end;
if combobox1.text='职工姓名'then
  begin
      if RS_Inform.ADOTable1.Locate('职工姓名',edit1.Text,[locaseinsensitive])then
       begin
         RS_Inform.Show; RS_Inform.DBNavigator1.Enabled:=false;
         RS_Inform.ADOTable1.Edit;
         RS_Inform.ADOTable1.Post;
         RS_Inform.DBEdit2.SetFocus;
       end
       else
         messagebox(RS_Amendform.Handle,'没有符合条件的记录','错误提示',mb_iconerror);
  end;
end;

end.

⌨️ 快捷键说明

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