// GET: Admin/EmailModel/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EmailModel emailModel = db.EmailModel.Find(id); if (emailModel == null) { if (Request.IsAjaxRequest()) { return(Content("")); } return(HttpNotFound()); } if (Request.IsAjaxRequest()) { emailModel.IsRead = true; db.SaveChanges(); return(PartialView("~/Areas/Admin/Views/EmailModel/Partial/_PartialList.cshtml", emailModel)); } emailModel.IsRead = true; db.Entry(emailModel).State = EntityState.Modified; db.SaveChanges(); return(View(emailModel)); }
public ActionResult Edit([Bind(Include = "Id,Name,CreationDate,CreatedId,ModifiedDate,ModifiedId,DeletedDate,DeletedId")] Category category) { if (ModelState.IsValid) { category.ModifiedDate = DateTime.UtcNow; db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public ActionResult saveBack(int?id, AcademicBackground academic) { AcademicBackground entity = db.AcademicBackground.Find(id); if (entity == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (ModelState.IsValid) { entity.Degree = academic.Degree; entity.Details = academic.Details; entity.ModifiedDate = DateTime.UtcNow; entity.Qualification = academic.Qualification; entity.UniversityName = academic.UniversityName; entity.YearofObtention = academic.YearofObtention; db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); var acs = db.AcademicBackground.ToList(); return(PartialView("~/Areas/Admin/Views/Dashboard/partial/_PartialBackList.cshtml", acs)); } return(View()); }