public ActionResult Edit([Bind(Include = "ID,Name,Id_name")] CS_Departments cS_Departments) { if (ModelState.IsValid) { db.Entry(cS_Departments).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cS_Departments)); }
public ActionResult Edit([Bind(Include = "ID,Name,Lastname,Phone,Email,About,Additional_info,Photo_id,Full_address")] Lecturer lecturer) { if (ModelState.IsValid) { db.Entry(lecturer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Photo_id = new SelectList(db.Photos, "ID", "Image_path", lecturer.Photo_id); return(View(lecturer)); }
public ActionResult Edit([Bind(Include = "ID,Title,Content,Lecturer_id")] Publication publication) { if (ModelState.IsValid) { db.Entry(publication).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Lecturer_id = new SelectList(db.Lecturers, "ID", "Name", publication.Lecturer_id); return(View(publication)); }
public ActionResult Edit([Bind(Include = "ID,Title,Content,Created_by,Created_at,Updated_at")] News news) { if (ModelState.IsValid) { db.Entry(news).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Created_by = new SelectList(db.Users, "ID", "Username", news.Created_by); return(View(news)); }