Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public ActionResult DeptNew(Dept dept)
 {
     if (ModelState.IsValid)
     {
         db.Depts.AddObject(dept);
         db.SaveChanges();
         return RedirectToAction("DeptList");
     }
     return View(dept);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }