public ActionResult CreateContact(Category cat) { if (!ModelState.IsValid) return View(cat); data.CreateContactCat(cat, (Session["LoggedInUser"] as user).id); return RedirectToAction("ListContactCats"); }
public void CreateAwardCat(Category cat, int p) { award_categories c = new award_categories { name = cat.Name }; dbContext.award_categories.Add(c); dbContext.SaveChanges(); }
public Category CreateContactCat(Category cat, int createdBy) { contact_categories c = new contact_categories { name = cat.Name }; var newCat = dbContext.contact_categories.Add(c); dbContext.SaveChanges(); cat.Id = newCat.id; return cat; }
public ActionResult EditAward(Category cat) { if (!ModelState.IsValid) return View(cat); data.UpdateAwardCat(cat, (Session["LoggedInUser"] as user).id); return RedirectToAction("ListAwardCats"); }
public void UpdateContactCat(Category cat, int p) { var c = dbContext.contact_categories.First(x => x.id == cat.Id); { c.name = cat.Name; dbContext.SaveChanges(); } }