// GET: EmployeeController/Create public ActionResult Create() { var model = new EmployeeDepartmemtViewModel { Department = (List <EDepartment>)depRepo.List() }; return(View(model)); }
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()); } }