public ActionResult CurrentCenter() { Center c = db.Centers.Find(AccountProfile.CurrentUser.CenterID); if (AccountProfile.CurrentUser.CenterID == -1) { c = new Center(); c.Name = "Admin"; } return PartialView("_CurrentCenterPartial", c); }
public ActionResult Create(Center center) { if (ModelState.IsValid) { repoService.centerRepo.Insert(center); return RedirectToAction("Index"); } return View(center); }
public void Insert(Center e) { db.Centers.Add(e); db.SaveChanges(); }
public void Update(Center e) { db.Entry(e).State = EntityState.Modified; db.SaveChanges(); }
public void Delete(Center e) { db.Centers.Remove(e); db.SaveChanges(); }