public ActionResult ImpactCatNew(ImpactCat cat) { if (ModelState.IsValid) { db.ImpactCats.AddObject(cat); db.SaveChanges(); return RedirectToAction("ImpactCatList"); } return View(cat); }
public ActionResult ImpactCatEdit(ImpactCat cat) { if (ModelState.IsValid) { db.ImpactCats.Attach(cat); db.ObjectStateManager.ChangeObjectState(cat, EntityState.Modified); db.SaveChanges(); return RedirectToAction("ImpactCatList"); } return View(cat); }
/// <summary> /// Create a new ImpactCat object. /// </summary> /// <param name="impactCatId">Initial value of the ImpactCatId property.</param> /// <param name="impactCatName">Initial value of the ImpactCatName property.</param> public static ImpactCat CreateImpactCat(global::System.Int32 impactCatId, global::System.String impactCatName) { ImpactCat impactCat = new ImpactCat(); impactCat.ImpactCatId = impactCatId; impactCat.ImpactCatName = impactCatName; return impactCat; }
/// <summary> /// Deprecated Method for adding a new object to the ImpactCats EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToImpactCats(ImpactCat impactCat) { base.AddObject("ImpactCats", impactCat); }