public static WeeklyTimeTrackWeekListViewModel GetClockInOutTime(string userName, DateTime startDate, DateTime endDate)
{
var weeklyTimeTrack = GetWeeklyClockInOutTimeByDate(userName, startDate, endDate);
var selectedValue = weeklyTimeTrack.WeekStartDate.HasValue
? weeklyTimeTrack.WeekStartDate.Value.ToString()
: string.Empty;
return new WeeklyTimeTrackWeekListViewModel
{
WeeklyTimeTrack = weeklyTimeTrack,
SelectedValue = selectedValue,
UserName = userName,
WeekList = new SelectList(WeekManager.GetWeekList(WebHelpers.GetCurrentDateTimeByTimeZoneId(WebConfigurationManager.AppSettings["UserTimeZoneId"]), Convert.ToInt32(WebConfigurationManager.AppSettings["NumberOfPriorWeeks"]), true), "WeekStartDate", "WeekStartEndDateDisplay", selectedValue)
};
}