public async Task <AttendanceViewModel> GetActive(AttendanceFilterModel filter) { var date = DateTime.Today.ToString("yyyy/MM/dd"); var viewModel = new AttendanceViewModel(); var attendances = await _attendanceService.GetActiveAsync(date); viewModel.Attendances = attendances; viewModel.FilterModel = await GetAttendanceFilterAsync(); return(viewModel); }
public async Task <IActionResult> ActiveWork(string employeeId) { var today = DateTime.Today.ToString("yyyy/MM/dd"); var filter = new AttendanceFilterModel { EmployeeId = employeeId }; var viewModel = await _attendanceViewModelService.GetActive(today); return(View(viewModel)); }
public IActionResult GetAttendanceStatistics(AttendanceFilterModel filter) { try { CheckAuthorization(Role.Student); var stLogin = CurrentUser.Login.ToLower(); var stCode = stLogin.StartsWith("st") ? stLogin.Substring(2) : stLogin; return(Ok(FactoryConcentrator.StudentAttendanceFactory.GetStatistics( CurrentLanguage, FactoryConcentrator.StudentFacotry.GetStudentIdByCode(stCode), filter.From, filter.To))); } catch (Exception exception) { return(BadRequest(exception)); } }
public async Task <AttendanceFilterModel> GetAttendanceFilterAsync() { var shifts = await _employeeDetailService.GetShifts(); var positions = await _employeeDetailService.GetPositions(); var jobFunctions = await _employeeDetailService.GetJobFunctions(); var departments = await _employeeDetailService.GetDepartments(); var sections = await _employeeDetailService.GetSections(); var filterModel = new AttendanceFilterModel { Shifts = shifts, Positions = positions, JobFunctions = jobFunctions, Departments = departments, Sections = sections }; return(filterModel); }