public async Task <IActionResult> EmployeeEvaluationsInThisSicle(int employeeId, int timeOfId) { var emp = await _repository.GetEmployee(employeeId); var timeOf = await _repository.GetTimesOfEvaluationAndPerformance(timeOfId); if (emp == null || timeOf == null) { ViewBag.ErrorMessage = "لايوجد بيانات"; return(View("NotFound")); } ViewBag.sycleStatus = timeOf.Status; ViewBag.departmentId = emp.DepartmentId; ViewBag.timesOfEvaluationAndPerformanceId = timeOfId; ViewBag.employeeId = emp.Id; ViewBag.employeeName = emp.Name; return(View(await _repository.GetEmployeeEvaluationsInThisSicle(employeeId, timeOfId))); }
public async Task <IActionResult> Employees(int departmentId, int timesOfEvaluationAndPerformanceId) { var timesOf = await _repository.GetTimesOfEvaluationAndPerformance(timesOfEvaluationAndPerformanceId); if (timesOf == null) { ViewBag.ErrorMessage = "لايوجد بيانات"; return(View("NotFound")); } var department = await _repository.GetDepartment(departmentId); ViewBag.department = department != null ? department.Name: string.Empty; ViewBag.timesOfEvaluationAndPerformanceId = timesOfEvaluationAndPerformanceId; ViewBag.departmentId = departmentId; var employees = await _repository.GetEmployeesByDpartmentId(departmentId); var models = new List <EmployeeBusinessModelView>(); foreach (var emp in employees) { string sectionname = emp.SectionId != null ? emp.Section.Name : "لايوجد"; string unitname = emp.UnitId != null ? emp.Unit.Name : "لايوجد"; string joptype = emp.JopType == true ? "اشرافية" : "غيراشرافية"; var model = new EmployeeBusinessModelView { Id = emp.Id, Department = emp.Department.Name, Section = sectionname, Name = emp.Name, EmployeeNo = emp.EmployeeNo, JopName = emp.JopName, JopType = joptype, Mobile = emp.Mobile, Unit = unitname, BusinessAndAchievements = await _repository.GetBusinessAndAchievementByEmployeeIdAndTimeOfId(emp.Id, timesOf.Id), Courses = await _repository.CourseByEmployeeIdAndTimeOfId(emp.Id, timesOf.Id), Occasions = await _repository.GetEmployeeOccasionsInThisSicle(emp.Id, timesOf.Id), Evaluations = await _repository.GetEmployeeEvaluationsInThisSicle(emp.Id, timesOf.Id), }; models.Add(model); } return(View(models)); }