Ejemplo n.º 1
0
        // GET: EmployeeController/Create
        public ActionResult Create()
        {
            var model = new EmployeeDepartmemtViewModel
            {
                Department = (List <EDepartment>)depRepo.List()
            };

            return(View(model));
        }
Ejemplo n.º 2
0
 public ActionResult Create(EmployeeDepartmemtViewModel eE)
 {
     try
     {
         EEmployee e = new EEmployee
         {
             Id        = eE.Id,
             FirstName = eE.FirstName,
             LastName  = eE.LastName,
             Gender    = eE.Gender,
             Address   = eE.Address,
             Email     = eE.Email,
             Password  = eE.Password
         };
         empRepo.Add(e);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }