private void button1_Click(object sender, EventArgs e) { NhanvienDataContext db = new NhanvienDataContext(); NHANVIEN dv = new NHANVIEN(); dv.MANV = Convert.ToInt32(textBox1.Text); dv.HOTEN = textBox2.Text; dv.NGAYSINH = textBox3.Text; dv.DIACHI = textBox4.Text; dv.DIENTHOAI = textBox5.Text; dv.HSLUONG = Convert.ToDouble(textBox6.Text); dv.MADONVI = Convert.ToInt32(comboBox1.Text); db.NHANVIENs.InsertOnSubmit(dv); db.SubmitChanges(); load(); }
private void button2_Click(object sender, EventArgs e) { int dongchon = dataGridView1.CurrentCell.RowIndex; NhanvienDataContext db = new NhanvienDataContext(); NHANVIEN q = db.NHANVIENs.Single(p => p.MANV == Convert.ToInt32(textBox1.Text)); q.MANV = Convert.ToInt32(textBox1.Text); q.HOTEN = textBox2.Text; q.NGAYSINH = textBox3.Text; q.DIACHI = textBox4.Text; q.DIENTHOAI = textBox5.Text; q.HSLUONG = Convert.ToDouble(textBox6.Text); q.MADONVI = Convert.ToInt32(comboBox1.Text); db.SubmitChanges(); load(); }
private void detach_NHANVIENs(NHANVIEN entity) { this.SendPropertyChanging(); entity.DONVI = null; }
private void attach_NHANVIENs(NHANVIEN entity) { this.SendPropertyChanging(); entity.DONVI = this; }
partial void DeleteNHANVIEN(NHANVIEN instance);
partial void UpdateNHANVIEN(NHANVIEN instance);
partial void InsertNHANVIEN(NHANVIEN instance);