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

📄 windiploma.pas

📁 考勤管理 考勤管理 考勤管理
💻 PAS
📖 第 1 页 / 共 3 页
字号:
  InitializeComponent;
  //
  // TODO: Add any constructor code after InitializeComponent call
  //
end;
//****************************************************************
//*  窗体加载 [Load]
//*
//*  [参数]
//*      1:系统参数                  
//*      2:系统参数
//*  [返回]
//*      无
//****************************************************************
procedure TWindiploma.TWindiploma_Load(sender: System.Object; e: System.EventArgs);
begin
  try
      clsmain.Windiplomashowfla:=true;
      item_clear();
      ToolBar1.Buttons[2].Enabled := false;  //保存按钮不可用
      RefreshEnabled(false,false);
  except
    on ex:Exception do
    begin
      messagebox.Show(' TWindiploma.TWindiploma_load: (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;
//****************************************************************
//*  窗体卸载 [Closed]
//*
//*  [参数]
//*      1:系统参数
//*      2:系统参数
//*  [返回]
//*      无
//****************************************************************
procedure TWindiploma.TWindiploma_Closed(sender: System.Object; e: System.EventArgs);
begin
  try
    clsmain.Windiplomashowfla:=false;
  except
    on ex:Exception do
    begin
      messagebox.Show('TWindiploma.TWindiploma_closed: (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;
//****************************************************************
//*  TWinUser_KeyDown
//*
//*  [参数]
//*      1:系统参数
//*      2:系统参数
//*  [返回]
//*      无
//****************************************************************
procedure TWindiploma.TWindiploma_KeyDown(sender: System.Object; e: System.Windows.Forms.KeyEventArgs);
begin
  try
    Case e.KeyCode of
    //--- F7 按下=焦点移动到"信息维护"选项卡页
    Keys.F7:
      begin
        e.Handled := False;
        TabControl1.SelectedTab := TabControl1.TabPages[0];
      end;
    //--- F9 按下=焦点移动到"信息查询"选项卡页
    Keys.F9:
      begin
        e.Handled := False;
        TabControl1.SelectedTab := TabControl1.TabPages[1];
      end;
    end;
  except
    on ex:Exception do
    begin
      messagebox.Show(' TWindiploma.TWindiploma_KeyDown: (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;
//****************************************************************
//*  TWinUser_KeyPress
//*
//*  [参数]
//*      1:系统参数
//*      2:系统参数
//*  [返回]
//*      无
//****************************************************************
procedure TWindiploma.TWindiploma_KeyPress(sender: System.Object; e: System.Windows.Forms.KeyPressEventArgs);
begin
  try
    Case e.KeyChar of
    char(13):
      begin
        e.Handled := False;
        SendKeys.Send('{Tab}');
      end;
    end;
  except
    on ex:Exception do
    begin
      messagebox.Show(' TWindiploma.TWindiploma_Keypress : (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;
//****************************************************************
//*  RefreshEnabled
//*
//*  [参数]
//*      1:员工编号的可用状态
//*      2:其它输入控件的可用状态
//*  [返回]
//*      无
//****************************************************************
procedure TWindiploma.RefreshEnabled(NThis, NOther: Boolean);
begin
  try
    If NThis = True Then
    begin
      Textname.ReadOnly := False;
    end
    Else
    begin
      Textname.ReadOnly := True;
    end;

    Textmemo.Enabled := NOther;
  except
    on ex:Exception do
    begin
      messagebox.Show('TWinUser.RefreshEnabled : (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;
//****************************************************************
//*  窗体项目清空
//*
//*  [参数]
//*      无
//*  [返回]
//*      无
//****************************************************************
procedure twindiploma.item_clear();
begin
  try
    self.Textname.Text:='';
    self.Textmemo.Text:='';
    self.Cmbxl.Text:='';
    if clsmain.quanxian<>'1' then
    begin
      tabcontrol1.TabPages[0].Enabled:=false;
    end;
  except
    on ex:Exception do
    begin
      messagebox.Show(' TWindiploma.item_clear: (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;
//****************************************************************
//*  项目Check
//*
//*  [参数]
//*      无
//*  [返回]
//*      1:输入ERR有无 (True:ERR没有、 False:ERR有)
//****************************************************************
function twindiploma.item_check():boolean;
begin
  try

    //学历名称
    if check_textname()=false then
    begin
      self.Textname.Focus;
      exit;
    end;
    result:=true;
  except
    on ex:Exception do
    begin
      messagebox.Show(' twindiploma.item_check: (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;
//****************************************************************
//*  项目CheckF
//*
//*  [参数]
//*      无
//*  [返回]
//*      1:输入ERR有无 (True:ERR没有、 False:ERR有)
//****************************************************************
function twindiploma.item_checkF():boolean;
begin
  try

    //学历名称
    if check_cmbxl()=false then
    begin
      self.Cmbxl.Focus;
      exit;
    end;
    result:=true;
  except
    on ex:Exception do
    begin
      messagebox.Show(' twindiploma.item_check: (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;

//****************************************************************
//*  学历名称 项目Check
//*
//*  [参数]
//*      无
//*  [返回]
//*      1:输入ERR有无 (True:ERR没有、 False:ERR有)
//****************************************************************
function twindiploma.check_textname():boolean;
var
  w_textname:string;
begin
   try
     w_textname:=textname.Text.Trim();
     if w_textname.Length>20 then
     begin
        messagebox.Show('长度超出最大范围','学历管理');
        result:=false;
        exit;
     end;
     result:=true;
  except
    on ex:Exception do
    begin
      messagebox.Show(' twindiploma.item_check: (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;


//****************************************************************
//*  学历名称 项目Check
//*
//*  [参数]
//*      无
//*  [返回]
//*      1:输入ERR有无 (True:ERR没有、 False:ERR有)
//****************************************************************
function twindiploma.check_cmbxl():boolean;
var
  w_cmbxl:string;
begin
  try
   w_cmbxl:=cmbxl.Text.Trim();
   if w_cmbxl.Length>20 then
   begin
     messagebox.Show('长度超出最大范围','学历管理');
     result:=false;
     exit;
   end;
    result:=true;
  except
    on ex:Exception do
    begin
      messagebox.Show(' twindiploma.check_cmbxl: (' + ex.message + ') ' , '考勤管理系统');
    end;
  end;
end;
//****************************************************************
//*  ToolBar1_ButtonClick
//*
//*  [参数]
//*      1:系统参数
//*      2:系统参数
//*  [返回]
//*      无
//****************************************************************
procedure TWindiploma.ToolBar1_ButtonClick(sender: System.Object; e: System.Windows.Forms.ToolBarButtonClickEventArgs);
begin
   try
     case strtoint(e.Button.Tag.ToString) of
     1: //添加
     begin
         flg:='添加';
         toolbar1.Buttons[1].Enabled:=false;   //编辑按钮不可用
         ToolBar1.Buttons[2].Enabled := True;  //保存按钮可用
         ToolBar1.Buttons[3].Enabled := False; //删除按钮不可用
         Item_Clear();
         RefreshEnabled(True, True);
     end;
     2://修改
      begin
        If Textname.Text = '' Then
        begin
          messagebox.Show('无修改数据。', '考勤管理系统');
        end
        else
        begin
          Flg := '修改';
          ToolBar1.Buttons[0].Enabled := False; //添加按钮不可用
          ToolBar1.Buttons[2].Enabled := True;  //保存按钮可用
          ToolBar1.Buttons[3].Enabled := False; //删除按钮不可用
          RefreshEnabled(False, True);
        End;
      end;
      3://保存
      begin
        Flg := '';
        //项目Check
        If Item_Check() = False Then
        begin
          Exit;
        End;
        If ToolBar1.Buttons[0].Enabled = True Then
        begin
          //数据添加

          If Data_Ent() = True Then
          begin
            messagebox.Show('数据已添加完成。', '考勤管理系统');
          end
          Else
          begin
            messagebox.Show('数据添加失败。' , '考勤管理系统');
          end;
        end
        Else
        begin
          //数据修改
          If Data_Upd() = True Then
          begin
            messagebox.Show('数据已修改完成。', '考勤管理系统');
          end

⌨️ 快捷键说明

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