public ActionResult Edit_dmThoiGioLamViec(dmThoiGioLamViec dmthoigiolamviec) { if (ModelState.IsValid) { db.Entry(dmthoigiolamviec).State = EntityState.Modified; db.SaveChanges(); TempData["Message_DanhMuc"] = "Cập nhật thành công!"; return(RedirectToAction("Index_dmThoiGioLamViec", "DanhMuc")); } TempData["Message_DanhMuc"] = "Cập nhật thất bại!"; return(RedirectToAction("Index_dmThoiGioLamViec", "DanhMuc")); }
public ActionResult Create_dmThoiGioLamViec(dmThoiGioLamViec dmthoigiolamviec) { if (ModelState.IsValid) { db.dmThoiGioLamViec.Add(dmthoigiolamviec); db.SaveChanges(); TempData["Message_DanhMuc"] = "Thêm mới thành công!"; return(RedirectToAction("Index_dmThoiGioLamViec", "DanhMuc")); } TempData["Message_DanhMuc"] = "Thêm mới thất bại!"; return(RedirectToAction("Index_dmThoiGioLamViec", "DanhMuc")); }