private void CreateEmployee() { var employee = new Employee { FirstName = FirstName, LastName = LastName, UidCode = UidCode }; context.CreateEmployee(employee); ConnectedSuccessfully = true; }
public IActionResult Create(Employee employee) { if (ModelState.IsValid) { if (employee.EmployeeID > 0) { _employeeContext.Update(employee); } else { _employeeContext.CreateEmployee(employee); } return(RedirectToAction("Index", "Home")); } else { return(View(employee)); } }