employeeselect.cs

来自「人事管理系统」· CS 代码 · 共 64 行

CS
64
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace BlueHill_Win_
{
    public partial class EmployeeSelect : Form
    {
        public EmployeeSelect()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            //this.Hide();
            //WorkingOvertimeManagement WOM = new WorkingOvertimeManagement();
            //WOM.Show();
            this.Close();
        }

        private void EmployeeSelect_Load(object sender, EventArgs e)
        {
            //SqlConnection con = DB.connection();
            //con.Open();
            //SqlCommand cmd = new SqlCommand("select 部门名称 from 部门表",con);
        }

        private void BtnSelect_Click(object sender, EventArgs e)
        {
            SqlConnection con = DB.connection();
            con.Open();
            if (textBox1.Text.Trim() == "")
            {
                if (textBox2.Text.Trim() == "")
                {
                    if (comboBox1.Text.Trim() == "")
                    {
                        DialogResult = MessageBox.Show("三个条件,你总得填一个噻,不然我怎么给你查!", "提示");
                    }
                    else
                    {
                        //SqlCommand cmdc = new SqlCommand("select * from 员工表 where 员工所属部门编号=(select 部门编号 from 部门表 where 部门名称='"+ comboBox1.Text.Trim() +"')",con);
                        //SqlDataReader sdr = cmdc.ExecuteReader();
                        //DB.setA = sdr;
                    }
                }
                else
                {
                }
            }
            else
            {
                SqlCommand cmd = new SqlCommand("select * from 员工表 where 员工姓名= '" + textBox1.Text.Trim() + "' and 员工电子邮件='" + textBox2.Text.Trim() + "' and 员工所属部门编号='" + comboBox1.Text.ToString().Trim() + "'", con);
            }
            con.Close();
        }
    }
}

⌨️ 快捷键说明

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