public ActionResult Insert(RiskEvent m) { if (ModelState.IsValid) { db.RiskEvents.AddObject(m); db.SaveChanges(); return RedirectToAction("Index"); } return View(m); }
public ActionResult Edit(RiskEvent r, int id) { if (ModelState.IsValid) { db.RiskEvents.Attach(r); db.ObjectStateManager.ChangeObjectState(r, System.Data.EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(r); }
/// <summary> /// Deprecated Method for adding a new object to the RiskEvents EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRiskEvents(RiskEvent riskEvent) { base.AddObject("RiskEvents", riskEvent); }
/// <summary> /// Create a new RiskEvent object. /// </summary> /// <param name="riskEventID">Initial value of the RiskEventID property.</param> public static RiskEvent CreateRiskEvent(global::System.Int32 riskEventID) { RiskEvent riskEvent = new RiskEvent(); riskEvent.RiskEventID = riskEventID; return riskEvent; }