public ActionResult TrackingDetails(string scheduledId = "", string startDate = "", string endDate = "", string userId = "") { string url = Request.RawUrl; string query = Request.Url.Query; scheduledId = Request.QueryString["scheduledId"]; List <DateTime> listDate = new List <DateTime>(); List <TB_USERS> listUser = new List <TB_USERS>(); List <TB_SCHEDULES> listSchedule = new List <TB_SCHEDULES>(); List <V_TRACKING_USER_CLASS> list = new List <V_TRACKING_USER_CLASS>(); try { listDate = GetDateTimeToMonth(startDate, endDate); listSchedule = Schedules_Service.GetAll(); list = Trackings_Service.GetTrackingUser(userId, scheduledId, startDate, endDate); listUser = User_Service.GetAllStudies(); } catch (Exception e) { ViewBag.Error = e.ToString(); } ViewBag.ListDate = listDate.OrderByDescending(x => x).ToList(); ViewBag.Schedule = listSchedule; ViewBag.User = listUser; ViewBag.Url = url; return(View(list)); }
public PartialViewResult _TrackingDetails(string scheduledId = "", string startDate = "", string endDate = "", string userId = "") { List <DateTime> listDate = new List <DateTime>(); List <TB_SCHEDULES> details = new List <TB_SCHEDULES>(); List <TB_USERS> listUser = new List <TB_USERS>(); List <V_TRACKING_USER_CLASS> list = new List <V_TRACKING_USER_CLASS>(); List <TB_SCHEDULE_DETAILS> listDetails = new List <TB_SCHEDULE_DETAILS>(); try { listDetails = Schedule_Detail_Service.GetByScheduleId(scheduledId); foreach (var item in listDetails) { List <DateTime> listDateTemp = new List <DateTime>(); listDateTemp = DateTimeHelper.DaysOfMonth(DateTime.Now.Year, DateTime.Now.Month, ConvertDataWithView.Convert_DayOfWeek_ToTypeDayOfWeek(item.ScheduleDetailDayOfWeek)); foreach (var date in listDateTemp) { if (listDate.Where(x => x.ToString("ddMMyyyy").Equals(date.ToString("ddMMyyyy"))).ToList().Count == 0) { listDate.Add(date); } } } //listDate = GetDateTimeToMonth(startDate, endDate); listUser = User_Service.GetAllStudies(); details = Schedules_Service.GetAll(); list = Trackings_Service.GetTrackingUser(userId, scheduledId, String.Join("", startDate.Split('/')), String.Join("", endDate.Split('/'))); } catch (Exception e) { ViewBag.Error = e.ToString(); } ViewBag.Id = scheduledId; ViewBag.User = listUser; ViewBag.Schedule = details; ViewBag.ListDate = listDate; return(PartialView(list)); }