public SessionVm GetSessionOnFilter(int pageSize, int sessionType, string searchKeyword) { SessionVm objSessionVm = new SessionVm { SessionList = SessionDataAccesor.GetSessionOnFilter(pageSize, sessionType, searchKeyword), AllAttendees = UserDataAccesor.GetAllUsers() }; return(objSessionVm); }
public DashboardVm GetDashboardData() { var dashboardVm = new DashboardVm { Trainees = UserDataAccesor.GetDashboardData(), UpcomingSessions = SessionDataAccesor.GetSessionOnFilter(100, 1, "") }; var lastFriday = DateTime.Now; while (lastFriday.DayOfWeek != DayOfWeek.Friday) { lastFriday = lastFriday.AddDays(-1); } foreach (var trainee in dashboardVm.Trainees) { bool feedbackAdded = false; foreach (var feedback in trainee.WeeklyFeedback) { feedback.WeekForFeedbackPresent = string.Empty; if (feedback.StartDate >= lastFriday.AddDays(-5)) { feedbackAdded = true; } feedback.WeekForFeedbackPresent = feedback.StartDate.ToString("dd/MM/yyyy") + "-" + feedback.EndDate.ToString("dd/MM/yyyy"); } trainee.LastWeekFeedbackAdded = feedbackAdded; // trainee.IsFeedbackPending = !(trainee.LastWeeklyFeedback > checkLowerDate && trainee.LastWeeklyFeedback <= lastFriday); } return(dashboardVm); }