private static List <DateTime> GetLeaves(Guid loggedInEmployeeId, DateTime dateFrom, DateTime dateTo) { var leaveList = DatabaseSnapshots <LeaveModel> .Get("Leave").List; var leaves = leaveList?.Where(y => y.EmployeeId == loggedInEmployeeId && y.LeaveDate <= dateTo && y.LeaveDate >= dateFrom)?.Select(x => x.LeaveDate.Date).ToList(); return(leaves); }
private static List <DateTime> GetHolidays(DateTime dateFrom, DateTime dateTo) { var holidayList = DatabaseSnapshots <HolidayModel> .Get("Holiday").List; var holidays = holidayList?.Where(y => y.HolidayDate <= dateTo && y.HolidayDate >= dateFrom)?.Select(x => x.HolidayDate.Date).ToList(); return(holidays); }
public static List <LeaveModel> GetLeaves() { return(DatabaseSnapshots <Models.LeaveModel> .Get("Leave").List); }
public static List <EmployeeModel> GetEmployees() { return(DatabaseSnapshots <Models.EmployeeModel> .Get("Employee").List); }
private static List <IncompleteAttendanceModel> GetMarkedAttendanceList(Guid loggedInEmployeeId, DateTime dateFrom, DateTime dateTo) { return(DatabaseSnapshots <AttendanceModel> .Get("Attendance").List?.Where(x => x.EmployeeId == loggedInEmployeeId && ((x.IsWorkFromHome ?? false) == true || x.InTime != null || x.OutTime != null) && x.AttendanceDate <= dateTo && x.AttendanceDate >= dateFrom)?.Select(x => new IncompleteAttendanceModel { DateTime = x.AttendanceDate, InTime = x.InTime, OutTime = x.OutTime, IsWorkFromHome = x.IsWorkFromHome }).ToList()); }