public ActionResult Create(SoftwareLicense softwarelicense) { #region Authorization if( Authentication.IsAdmin == false ) { return RedirectToAction( "Login", "Users" ); } #endregion if (ModelState.IsValid) { db.Licenses.Add(softwarelicense); db.SaveChanges(); return RedirectToAction("Index"); } return View(softwarelicense); }
public ActionResult Edit(SoftwareLicense softwarelicense) { #region Authorization if( Authentication.IsAdmin == false ) { return RedirectToAction( "Login", "Users" ); } #endregion if (ModelState.IsValid) { db.Entry(softwarelicense).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(softwarelicense); }