public ActionResult Create(CreateThesisThemeViewModel model) { if (ModelState.IsValid) { if (this.User.IsInRole(GlobalConstants.TEACHER)) { var theme = Mapper.Map<ThesisTheme>(model); theme.TeacherId = this.User.Identity.GetUserId(); this.Data.ThesisThemes.Add(theme); this.Data.SaveChanges(); } return RedirectToAction("Themes"); } return View(model); }
public ActionResult Create(CreateThesisThemeViewModel model) { if (ModelState.IsValid) { if (this.User.IsInRole(GlobalConstants.TEACHER)) { var theme = Mapper.Map <ThesisTheme>(model); theme.TeacherId = this.User.Identity.GetUserId(); this.Data.ThesisThemes.Add(theme); this.Data.SaveChanges(); } return(RedirectToAction("Themes")); } return(View(model)); }