public ActionResult Edit([Bind(Include = "ID,Title,Details,PromotorID,PromotorName,IsTaken,IsAccepted,IsRejected,IsProposed,TakenByID, TypeOf")] Topics topics) { if (ModelState.IsValid) { db.Entry(topics).State = EntityState.Modified; topics.PromotorName = LINQueries.GetNameByID(topics.PromotorID); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(topics)); }
public ActionResult StudentProposition([Bind(Include = "ID,Title,Details,PromotorID,PromotorName,IsTaken,IsAccepted,IsRejected,IsProposed, TakenByID, TypeOf")] Topics topics) { if (ModelState.IsValid) { db.Topics.Add(topics); topics.TakenBy = User.Identity.Name.ToString(); topics.TakenByID = User.Identity.GetUserId().ToString(); topics.IsProposed = true; topics.PromotorName = LINQueries.GetNameByID(topics.PromotorID); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(topics)); }