示例#1
0
 public ActionResult RiskCatNew(RiskCat cat)
 {
     if (ModelState.IsValid)
     {
         db.RiskCats.AddObject(cat);
         db.SaveChanges();
         return RedirectToAction("RiskCatList");
     }
     return View(cat);
 }
示例#2
0
 public ActionResult RiskCatEdit(RiskCat cat)
 {
     if (ModelState.IsValid)
     {
         db.RiskCats.Attach(cat);
         db.ObjectStateManager.ChangeObjectState(cat, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("RiskCatList");
     }
     return View(cat);
 }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the RiskCats EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRiskCats(RiskCat riskCat)
 {
     base.AddObject("RiskCats", riskCat);
 }
示例#4
0
 /// <summary>
 /// Create a new RiskCat object.
 /// </summary>
 /// <param name="riskCatId">Initial value of the RiskCatId property.</param>
 /// <param name="riskCatName">Initial value of the RiskCatName property.</param>
 public static RiskCat CreateRiskCat(global::System.Int32 riskCatId, global::System.String riskCatName)
 {
     RiskCat riskCat = new RiskCat();
     riskCat.RiskCatId = riskCatId;
     riskCat.RiskCatName = riskCatName;
     return riskCat;
 }