Пример #1
0
 public ActionResult Insert(RiskEvent m)
 {
     if (ModelState.IsValid)
     {
         db.RiskEvents.AddObject(m);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(m);
 }
Пример #2
0
 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);
 }
Пример #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the RiskEvents EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRiskEvents(RiskEvent riskEvent)
 {
     base.AddObject("RiskEvents", riskEvent);
 }
Пример #4
0
 /// <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;
 }