public ActionResult Create(Employee emp) { var model = _employeeRepositary.Add(emp); if (model != null) { return(RedirectToAction("Index")); } return(View(model)); }
public IActionResult Create(EmployeeCreateModalView modal) { if (ModelState.IsValid) { string UniqFilePath = GetUniqueFilePath(modal); Employee emp = new Employee() { Name = modal.Name, Department = modal.Department, FilePath = UniqFilePath }; Employee nemp = _emprep.Add(emp); return(RedirectToAction("details", new { nemp.Id })); } return(View()); }
//Method to add employee public Employee Add(Employee employee) { return(employeeRepositary.Add(employee)); }