📄 增加员工.cs
字号:
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;
using Yewucheng;
namespace Myproject
{
public partial class 增加员工 : Form
{
private 员工信息 info;
public 增加员工(员工信息 obj)
{
InitializeComponent();
this.info = obj;
}
private void but2_Click(object sender, EventArgs e)
{
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
string grade;
if (checkBox1.Checked)
grade = checkBox1.Text;
else if (checkBox2.Checked)
grade = checkBox2.Text;
else
grade = checkBox3.Text;
wang m = new wang();
m.insertmand("insert into Tianjiayuangong values('" + this.txt1.Text + "','" + this.txt2.Text + "','" + this.txt3.Text + "','" + this.txt4.Text + "','" + this.txt5.Text + "','" + grade + "')");
MessageBox.Show("添加一行员工记录成功", "消息");
this.Hide();
DataTable table = new DataTable();
table.Columns.Add("column1");
table.Columns.Add("column2");
table.Columns.Add("column3");
table.Columns.Add("column4");
table.Columns.Add("column5");
table.Columns.Add("column6");
table.Rows.Add(new object[] { this.txt1.Text, this.txt2.Text, this.txt3.Text, this.txt4.Text, this.txt5.Text, grade });
this.info.dbgpase.DataSource = table;
DataSet ds = m.SelectMand("select *from Tianjiayuangong ");
this.info.dbgpase.DataSource = ds.Tables[0].DefaultView;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -