예제 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Depts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDepts(Dept dept)
 {
     base.AddObject("Depts", dept);
 }
예제 #2
0
 public ActionResult DeptNew(Dept dept)
 {
     if (ModelState.IsValid)
     {
         db.Depts.AddObject(dept);
         db.SaveChanges();
         return RedirectToAction("DeptList");
     }
     return View(dept);
 }
예제 #3
0
 /// <summary>
 /// Create a new Dept object.
 /// </summary>
 /// <param name="deptId">Initial value of the DeptId property.</param>
 /// <param name="deptName">Initial value of the DeptName property.</param>
 public static Dept CreateDept(global::System.Int32 deptId, global::System.String deptName)
 {
     Dept dept = new Dept();
     dept.DeptId = deptId;
     dept.DeptName = deptName;
     return dept;
 }
예제 #4
0
 public ActionResult DeptEdit(Dept dept)
 {
     if (ModelState.IsValid)
     {
         db.Depts.Attach(dept);
         db.ObjectStateManager.ChangeObjectState(dept, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("DeptList");
     }
     return View(dept);
 }