private void btnAdd_Click(object sender, EventArgs e)
        {
            linq = new linqtosqlClassDataContext(strCon); //实例化Linq连接对象
            tb_Employee employee = new tb_Employee();     //实例化tb_Employee类对象

            //为tb_Employee类中的员工实体赋值
            employee.ID      = txtID.Text;
            employee.Name    = txtName.Text;
            employee.Sex     = cboxSex.Text;
            employee.Age     = Convert.ToInt32(txtAge.Text);
            employee.Tel     = txtTel.Text;
            employee.Address = txtAddress.Text;
            employee.QQ      = Convert.ToInt32(txtQQ.Text);
            employee.Email   = txtEmail.Text;
            linq.tb_Employee.InsertOnSubmit(employee); //添加员工信息
            linq.SubmitChanges();                      //提交操作
            MessageBox.Show("员工信息添加成功");
            BindInfo("");
        }
Ejemplo n.º 2
0
 partial void Deletetb_Employee(tb_Employee instance);
Ejemplo n.º 3
0
 partial void Updatetb_Employee(tb_Employee instance);
Ejemplo n.º 4
0
 partial void Inserttb_Employee(tb_Employee instance);