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

📄 frmuserredeploy.cs

📁 随着我国市场经济的快速发展
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using PMS.PMSClass;
namespace PMS
{
    public partial class frmUserRedeploy : Form
    {
        public frmUserRedeploy()
        {
            InitializeComponent();
        }
        DBOperate operate = new DBOperate();
        private void frmUserRedeploy_Load(object sender, EventArgs e)
        {
            string sql = "select UID as '员工编号',UName as '员工姓名',URemoveDate as '调动时间',UOldDep as '原部门',UNewDep as '现部门',UOldJob as '原职务',UNewJob as '现职务',UOldPay as '原工资',UNewPay as '工资调整',UPayExplain as '调动说明' from tb_redeploy";
            operate.BindDataGridView(dataGridView1,sql);
            string num = "select count(*) from tb_redeploy";
            toolStripStatusLabel2.Text = operate.HumanNum(num).ToString();
        }

        private void toolStripLabel1_Click(object sender, EventArgs e)
        {
            frmAddUserRedeploy adduserredeploy = new frmAddUserRedeploy();
            adduserredeploy.ShowDialog();
        }

        private void frmUserRedeploy_Activated(object sender, EventArgs e)
        {
            string sql = "select UID as '员工编号',UName as '员工姓名',URemoveDate as '调动时间',UOldDep as '原部门',UNewDep as '现部门',UOldJob as '原职务',UNewJob as '现职务',UOldPay as '原工资',UNewPay as '工资调整',UPayExplain as '调动说明' from tb_redeploy";
            operate.BindDataGridView(dataGridView1, sql);
            string num = "select count(*) from tb_redeploy";
            toolStripStatusLabel2.Text = operate.HumanNum(num).ToString();
        }

        private void toolStripLabel3_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedCells.Count > 0)
            {
                string sql = "delete from tb_redeploy where UID='"+dataGridView1.SelectedCells[0].Value.ToString()+"'";
                if (operate.OperateData(sql)>0)
                {
                    MessageBox.Show("删除成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("请选择要删除的信息","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
                return;
            }
        }

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

        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView1.SelectedCells.Count > 0)
            {
                string uid = dataGridView1.SelectedCells[0].Value.ToString();
                string uname = dataGridView1.SelectedCells[1].Value.ToString();
                frmChangeUserRedeploy changeuserredeploy = new frmChangeUserRedeploy();
                changeuserredeploy.id = uid;
                changeuserredeploy.name = uname;
                changeuserredeploy.ShowDialog();
            }
        }

        private void toolStripLabel2_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedCells.Count > 0)
            {
                string uid = dataGridView1.SelectedCells[0].Value.ToString();
                string uname = dataGridView1.SelectedCells[1].Value.ToString();
                frmChangeUserRedeploy changeuserredeploy = new frmChangeUserRedeploy();
                changeuserredeploy.id = uid;
                changeuserredeploy.name = uname;
                changeuserredeploy.ShowDialog();
            }
        }

        private void toolStripTextBox1_TextChanged(object sender, EventArgs e)
        {
            string sql = "select UID as '员工编号',UName as '员工姓名',URemoveDate as '调动时间',UOldDep as '原部门',UNewDep as '现部门',UOldJob as '原职务',UNewJob as '现职务',UOldPay as '原工资',UNewPay as '工资调整',UPayExplain as '调动说明' from tb_redeploy where UName like '%"+toolStripTextBox1.Text.Trim()+"%'";
            operate.BindDataGridView(dataGridView1, sql);
            string num = "select count(*) from tb_redeploy where UName like '%" + toolStripTextBox1.Text.Trim() + "%'";
            toolStripStatusLabel2.Text = operate.HumanNum(num).ToString();
        }

        private void toolStripLabel9_Click(object sender, EventArgs e)
        {
            PrintForm.frmRedeployPrint redeploy = new PMS.PrintForm.frmRedeployPrint();
            redeploy.ShowDialog();
        }
    }
}

⌨️ 快捷键说明

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