private void tsbluu_Click(object sender, EventArgs e) { if (cbbmanv.Text == "") { MessageBox.Show("Chưa chọn thông tin"); return; } nhanviendaotao nvdt = new nhanviendaotao(); nvdt.madt = cbbmadt.Text; nvdt.tendt = txttendt.Text; nvdt.manv = cbbmanv.Text; nvdt.tennv = txttennv.Text; if (MessageBox.Show(string.Format("Thêm nhân viên đào tạo"), "", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (Bus.InsertProfile(nvdt) > 0) { MessageBox.Show("Đã thêm"); Danhsachnvdt_Load(sender, e); } else { MessageBox.Show("Mã nhân viên đã tồn tại"); } } }
public static int InsertProfile(nhanviendaotao nvdt) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@madt", nvdt.madt), new SqlParameter("@tendt", nvdt.tendt), new SqlParameter("@manv", nvdt.manv), new SqlParameter("@tennv", nvdt.tennv) }; return(DataProvider.ExcuteNonQuerry("themnvdt", para)); }
public static int InsertProfile(nhanviendaotao nvdt) { return(Dao.InsertProfile(nvdt)); }