public async Task <IActionResult> Edit(int id) { var employeeContract = await _repository.GetEmployeeContract(id); if (employeeContract == null) { ViewBag.ErrorMessage = "لايوجد بيانات"; return(View("NotFound")); } ViewData["JopId"] = new SelectList(await _repository.GetJops(), "Id", "Name", employeeContract.JopId); ViewData["SeasonId"] = new SelectList(await _repository.GetSeasons(), "Id", "Name", employeeContract.SeasonId); ViewData["EmployeeId"] = new SelectList(await _repository.GetEmployees(), "Id", "Name", employeeContract.EmployeeId); return(View(employeeContract)); }