public IActionResult Create() { var model = new LocationEmployeeCreateViewModel(); ViewBag.listPos = _positionService.GetAll(); ViewBag.listEMP = _employeeService.GetAll(); return(View(model)); }
public async Task <IActionResult> Create(LocationEmployeeCreateViewModel model) { if (ModelState.IsValid) { var locationemployee = new LocationEmployee { DateJoinedLocation = DateTime.Now, EmployeeId = model.EmployeeId, LocationId = model.LocationId, Status = true, StatusJoindLocation = true }; await _locationEmployeeService.CreateAsync(locationemployee); return(RedirectToAction("Create")); } return(View()); }