예제 #1
0
        public void TestUpdateEmp()
        {
            var emp = _empManager.GetEmpByIdBAL(20008);

            emp.Department = "AutoDAP";
            _empManager.PutEmpBAL(emp);

            emp.Department = "Autofacets";
            _empManager.PutEmpBAL(emp);

            Assert.Equal("Autofacets", emp.Department);
        }
예제 #2
0
 public ActionResult PutEmployee(EmployeeViewModel emp)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _empManager.PutEmpBAL(emp);
         }
         catch (Exception)
         {
             throw;
         }
         return(Ok(emp));
     }
     else
     {
         return(BadRequest(ModelState));
     }
 }