Addu.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GongZi.GongZiClass;
namespace GongZi
{
public partial class Addu : Form
{
public Addu()
{
InitializeComponent();
}
DBOperate operate = new DBOperate();//创建数据库操作对象
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();//关闭窗体
}
private void frmAddUserRedeploy_Load(object sender, EventArgs e)
{
operate.BindDropdownlist("tb_employee",cbbnum,1);//绑定所有的员工编号
operate.BindDropdownlist("tb_department",cbbdep2,1);//绑定所有的部门名称
operate.BindDropdownlist("tb_userJob",cbbjob2,1);//绑定所有的职务列表
}
private void cbbnum_SelectedIndexChanged(object sender, EventArgs e)
{
string id = cbbnum.Text;//得到ID信息
string sql =//创建SQL字符串
"select * from tb_employee where employeeID='"+id+"'";
DataSet ds = operate.GetTable(sql);//得到数据集
txtname.Text=ds.Tables[0].Rows[0][2].ToString();//显示名称信息
txtdep1.Text = ds.Tables[0].Rows[0][4].ToString();//显示原部门信息
txtjob1.Text = ds.Tables[0].Rows[0][8].ToString();//显示原职务信息
txtpay1.Text = ds.Tables[0].Rows[0][12].ToString();//显示原工资信息
}
private void 增加ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (cbbnum.Text == "" || cbbdep2.Text == "" ||
cbbjob2.Text == "" || txtNewPay.Text.Trim() == "" ||
txtdate.Text == "" || txtexplain.Text.Trim() == "")
{
MessageBox.Show("请将信息填写完整", "提示",//弹出消息对话框
MessageBoxButtons.OK, MessageBoxIcon.Information);
return;//退出事件
}
else
{
string sql =//创建SQL字符串
"select count(*) from tb_redeploy where UID='"+cbbnum.Text+"'";
int i = operate.HumanNum(sql);//查找人数
if (i > 0)
{
MessageBox.Show("已经添加过该员工的调动信息",//弹出消息对话框
"提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
后面还有 31 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。