public Thesis(string inputTitle, string inputAuthor, int inputYear, ThesisType inputThesisEntityType, string inputSchool, EntityType inputEntityType, DateTime inputEntryDate) : base(inputTitle, inputAuthor, inputYear, inputEntityType, inputEntryDate) { School = inputSchool; ThesisEntityType = inputThesisEntityType; }
public ActionResult DeleteConfirmed(Guid id) { ThesisType thesisType = db.ThesisTypes.Find(id); db.ThesisTypes.Remove(thesisType); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: ThesisTypes/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ThesisType thesisType = db.ThesisTypes.Find(id); if (thesisType == null) { return(HttpNotFound()); } return(View(thesisType)); }
public ActionResult Edit([Bind(Include = "ThesisTypeID,Name,Description")] ThesisTypeViewModel thesisTypeViewModel) { if (ModelState.IsValid) { ThesisType model = db.ThesisTypes.Find(thesisTypeViewModel.ThesisTypeID); model.Name = thesisTypeViewModel.Name; model.Description = thesisTypeViewModel.Description; model.DateModified = DateTime.Now; model.UserModifiedID = Guid.Parse(User.Identity.GetUserId()); db.Entry(model).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(thesisTypeViewModel)); }
public ActionResult Create([Bind(Include = "Name,Description")] ThesisType thesisType) { if (ModelState.IsValid) { thesisType.ThesisTypeID = Guid.NewGuid(); thesisType.DateCreated = DateTime.Now; thesisType.DateModified = thesisType.DateCreated; thesisType.UserCreatedID = Guid.Parse(User.Identity.GetUserId()); thesisType.UserModifiedID = thesisType.UserCreatedID; db.ThesisTypes.Add(thesisType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(thesisType)); }