public int UpdateCV(string id, Congviec cv) { try { db.Entry(cv).State = EntityState.Modified; db.SaveChanges(); return(1); } catch { throw; } }
public int AddCongViec(Congviec cv) { try { db.Congviec.Add(cv); db.SaveChanges(); return(1); } catch { throw; } }
public int Create([FromBody] Congviec cv) { db.Congviec.Add(cv); try { if (ModelState.IsValid) { db.SaveChanges(); } return(1); } catch (DbUpdateException) { throw; } }
public int Edit(Congviec cv) { Congviec cvs = db.Congviec.Find(cv.Idcongviec); cvs.Idlv = cv.Idlv; cvs.Iddqt = cv.Iddqt; cvs.Idhoso = cv.Idhoso; cvs.Hanxuly = cv.Hanxuly; cvs.Ngaygioht = cv.Ngaygioht; cvs.Ngaygiomo = cv.Ngaygiomo; cvs.Tieude = cv.Tieude; cvs.Filedinhkem = cv.Filedinhkem; db.Entry(cvs).State = EntityState.Modified; db.SaveChanges(); return(dal.UpdateCV(cvs.Idcongviec, cvs)); }
public int Delete(string id) { try { Congviec cv = db.Congviec.Find(id); if (cv != null) { db.Congviec.Remove(cv); db.SaveChanges(); return(1); } else { return(0); } } catch { throw; } }
private void Them_Cong_Viec(List<object> ids) { if (ids != null && ids.Count > 0) { DataRow row = gridViewMaster.GetDataRow(gridViewMaster.FocusedRowHandle); Congviec frm = new Congviec(-2, true); frm.UpdateCongViec += new Congviec.UpdateCongViecHandler(frm_UpdateCongViec); ProtocolForm.ShowModalDialog(this, frm); gridControlThongTinLienHe.DataSource=DADuAn.loadDetail(HelpNumber.ParseInt64(row["ID"])); } }
private void gridControlThongTinLienHe_DoubleClick(object sender, EventArgs e) { DataRow r=gridViewThongTinLienHe.GetDataRow(gridViewThongTinLienHe.FocusedRowHandle); DataRow row = gridViewMaster.GetDataRow(gridViewMaster.FocusedRowHandle); if (r != null) { Congviec frm = new Congviec(HelpNumber.ParseInt64(r["pccv_id"]), false); frm.UpdateCongViec+=new Congviec.UpdateCongViecHandler(frm_UpdateCongViec); //frm.IsAdd = null; ProtocolForm.ShowModalDialog(this, frm); DADuAn.loadDetail(HelpNumber.ParseInt64(r["pccv_id"])); } }
private void gridControlCongviec_DoubleClick(object sender, EventArgs e) { DataRow r = gridViewCongviec.GetDataRow(gridViewCongviec.FocusedRowHandle); if (r != null) { if (IsAdd == false) { Congviec frm = new Congviec(HelpNumber.ParseInt64(r["pccv_id"]), false); frm.UpdateCongViec += new Congviec.UpdateCongViecHandler(frm_UpdateCongViec1); ProtocolForm.ShowModalDialog(this, frm); loadDetail(_ID); zoombarTienDo.Value = (int)lay_tiendo(); } } }
private void btnThemCV_Click(object sender, EventArgs e) { if (btnThemCV.Tag.Equals("ThemCV")) { Congviec frm = new Congviec(-2, true); frm.UpdateCongViec += new Congviec.UpdateCongViecHandler(frm_UpdateCongViec); ProtocolForm.ShowModalDialog(this, frm); loadDetail(_ID); zoombarTienDo.Value = (int)lay_tiendo(); } else { frmThemTaiLieu frm = new frmThemTaiLieu(-2, true); frm.UpdateTapTin += new frmThemTaiLieu.UpdateTapTinHandler(frm_UpdateTapTin); ProtocolForm.ShowModalDialog(this, frm); load_TapTin(_ID); } }