📄 frmusercheck.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 frmUserCheck : Form
{
public frmUserCheck()
{
InitializeComponent();
}
DBOperate operate = new DBOperate();
private void frmUserCheck_Load(object sender, EventArgs e)
{
string str = "select PID as '员工编号',Pname as '员工姓名',Pdep as '所属部门',PKpcontent as '考评内容',PKpResult as '考评结果',PKpscore as '考评分数',PKpPeople as '考评人',PKpDate as '考评日期' from tb_check";
operate.BindDataGridView(dataGridView1,str);
string num = "select count(*) from tb_check";
toolStripStatusLabel2.Text = operate.HumanNum(num).ToString();
}
private void toolStripLabel1_Click(object sender, EventArgs e)
{
frmAddUserCheck addusercheck = new frmAddUserCheck();
addusercheck.ShowDialog();
}
private void frmUserCheck_Activated(object sender, EventArgs e)
{
string str = "select PID as '员工编号',Pname as '员工姓名',Pdep as '所属部门',PKpcontent as '考评内容',PKpResult as '考评结果',PKpscore as '考评分数',PKpPeople as '考评人',PKpDate as '考评日期' from tb_check";
operate.BindDataGridView(dataGridView1, str);
string num = "select count(*) from tb_check";
toolStripStatusLabel2.Text = operate.HumanNum(num).ToString();
}
private void toolStripLabel3_Click(object sender, EventArgs e)
{
if (dataGridView1.SelectedCells.Count > 0)
{
string id = dataGridView1.SelectedCells[0].Value.ToString();
string deletesql = "delete from tb_check where PID='"+id+"'";
if (operate.OperateData(deletesql) > 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 toolStripTextBox1_TextChanged(object sender, EventArgs e)
{
string str = "select PID as '员工编号',Pname as '员工姓名',Pdep as '所属部门',PKpcontent as '考评内容',PKpResult as '考评结果',PKpscore as '考评分数',PKpPeople as '考评人',PKpDate as '考评日期' from tb_check where Pname like '%"+toolStripTextBox1.Text+"%'";
operate.BindDataGridView(dataGridView1, str);
string num = "select count(*) from tb_check where Pname like '%" + toolStripTextBox1.Text + "%' ";
toolStripStatusLabel2.Text = operate.HumanNum(num).ToString();
}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (dataGridView1.SelectedCells.Count > 0)
{
string id = dataGridView1.SelectedCells[0].Value.ToString();
string name = dataGridView1.SelectedCells[1].Value.ToString();
frmUserCheckChange usercheckchange = new frmUserCheckChange();
usercheckchange.pid = id;
usercheckchange.pname = name;
usercheckchange.ShowDialog();
}
else
{
MessageBox.Show("请选择要修改的信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
}
private void toolStripLabel2_Click(object sender, EventArgs e)
{
if (dataGridView1.SelectedCells.Count > 0)
{
string id = dataGridView1.SelectedCells[0].Value.ToString();
string name = dataGridView1.SelectedCells[1].Value.ToString();
frmUserCheckChange usercheckchange = new frmUserCheckChange();
usercheckchange.pid = id;
usercheckchange.pname = name;
usercheckchange.ShowDialog();
}
else
{
MessageBox.Show("请选择要修改的信息", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
}
private void toolStripLabel9_Click(object sender, EventArgs e)
{
PMS.PrintForm.frmUserCheckPrint usercheckprint = new PMS.PrintForm.frmUserCheckPrint();
usercheckprint.ShowDialog();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -