예제 #1
0
 public ActionResult Create(EmployeeModel emp)
 {
     if (ModelState.IsValid)
     {
         if (emp == null)
             return View(emp);
         var employee = Mapper.Map<EmployeeModel, Employee>(emp);
         //_iRepository.Add(employee);
         //_iunitofwork.Employeerepository.Add(employee);
         _iemployeeservice.Add(employee);
         return RedirectToAction("Index");
     }
     return View(emp);
 }
예제 #2
0
 public ActionResult Create()
 {
     var model = new EmployeeModel();
     return View(model);
 }