frmemployeeinfo.cs

来自「酒店管理系统,您酒店物业管理的好帮手」· CS 代码 · 共 77 行

CS
77
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Hotel.Operation;

namespace Hotel.UI
{
    public partial class frmEmployeeInfo : Form
    {
        EmployeeInfoAccess obj = new EmployeeInfoAccess();
        public frmEmployeeInfo()
        {
            InitializeComponent();
        }

        private void frmEmployeeInfo_Load(object sender, EventArgs e)
        {
            obj.GetEmployeeInfo(lstShow);
        }

        private void btnSelect_Click(object sender, EventArgs e)
        {
            if (this.txtContent.Text == "")
            {
                MessageBox.Show("请输入您所要查询的信息!", "提示");
                return;
            }
            if (this.cboSelect.SelectedItem.ToString() == "员工姓名")
            {
                obj.GetEmployeeInfo(lstShow, this.txtContent.Text);
                if (this.lstShow.Items.Count == 0)
                {
                    MessageBox.Show("没有您查找的信息,请重新输入!", "提示");
                }
            }
            try
            {
                if (this.cboSelect.SelectedItem.ToString() == "员工编号")
                {
                    obj.GetEmployeeInfo(lstShow, Convert.ToInt32(this.txtContent.Text));
                    if (this.lstShow.Items.Count == 0)
                    {
                        MessageBox.Show("没有您查找的信息,请重新输入!", "提示");
                    }
                }
            }
            catch
            {
                MessageBox.Show("查询失败,请重新输入!", "提示");
                this.txtContent.Clear();
                this.txtContent.Focus();

            }
           

        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void txtContent_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)13)
            {
                btnSelect_Click(sender, e);
            }
        }

       
    }
}

⌨️ 快捷键说明

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