Ejemplo n.º 1
0
 public void SaveDept(Department dept)
 {
     using (var _deptContext = new DataContext())
     {
         _deptContext.Department.Add(dept);
         _deptContext.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public void EditDept(Department deptToEdit)
 {
     using (var _deptContext = new DataContext())
     {
         var selectedDEpt = _deptContext.Department.Where(x => x.DeptID == deptToEdit.DeptID).SingleOrDefault();
         selectedDEpt.DeptName = deptToEdit.DeptName;
         _deptContext.SaveChanges();
     }
 }