private void SaveData(LoadOperation<nhanvien_cs> lo) { if (lo.Entities.Count() > 0) { MessageBox.Show("Mã cán bộ " + this.txtmanv.Text.Trim().ToUpper() + " đã tồn tại"); } else { if (txtmanv.Text.Trim() != "" || txtten.Text.Trim() != "") { string m = FunAndPro.GetSelectedKeyValue(cmbdiaban, rowMenu); if (m.Length > 0) m = ";" + m + ";"; nhanvien_cs ap = new nhanvien_cs { ma_nvcs = txtmanv.Text.Trim().ToUpper(), ten_nv = this.txtten.Text.Trim(), ma_huyen=App.ma_huyen, kt=checkEdit1.IsChecked, phone=txtphone.Text.Trim(), diaban=m }; nhanvien_cs_log apl = new nhanvien_cs_log { ma_nvcs = txtmanv.Text.Trim().ToUpper(), ten_nv = this.txtten.Text.Trim(), ma_huyen = App.ma_huyen, kt = checkEdit1.IsChecked, phone = txtphone.Text.Trim(), diaban = m, users=App.User_name, thoi_gian=App.Current_d }; dstb.nhanvien_cs.Add(ap); dstb.nhanvien_cs_logs.Add(apl); dstb.SubmitChanges(OnSubmitCompleted, true); } else MessageBox.Show("Nhập chưa đủ thông tin hoặc sai qui cách nhập mã cán bộ !"); } }
/// <summary> /// Create a new nhanvien_cs_log object. /// </summary> /// <param name="id">Initial value of the id property.</param> public static nhanvien_cs_log Createnhanvien_cs_log(global::System.Decimal id) { nhanvien_cs_log nhanvien_cs_log = new nhanvien_cs_log(); nhanvien_cs_log.id = id; return nhanvien_cs_log; }
private void UpdateData(LoadOperation<nhanvien_cs> lo) { string m = FunAndPro.GetSelectedKeyValue(cmbdiaban, rowMenu); if (m.Length > 0) m = ";" + m + ";"; if (lo.Entities.Count() > 0) { lo.Entities.ElementAt(0).ten_nv = txtten.Text.Trim(); lo.Entities.ElementAt(0).phone = txtphone.Text.Trim(); lo.Entities.ElementAt(0).diaban = m; nhanvien_cs_log apl = new nhanvien_cs_log { ma_nvcs = txtmanv.Text.Trim().ToUpper(), ten_nv = this.txtten.Text.Trim(), ma_huyen = App.ma_huyen, kt = checkEdit1.IsChecked, phone = txtphone.Text.Trim(), diaban = m, users = App.User_name, thoi_gian = App.Current_d }; dstb.nhanvien_cs_logs.Add(apl); dstb.SubmitChanges(OnSubmitCompleted, true); } }
/// <summary> /// Deprecated Method for adding a new object to the nhanvien_cs_log EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTonhanvien_cs_log(nhanvien_cs_log nhanvien_cs_log) { base.AddObject("nhanvien_cs_log", nhanvien_cs_log); }