public ActionResult GetAllFilters() { ActivityFilterModel filterModel = new ActivityFilterModel(); if (Session["ActivityFilter"] != null) { filterModel = Session["ActivityFilter"] as ActivityFilterModel; } return Json(filterModel, JsonRequestBehavior.AllowGet); }
public ActionResult SetActivityTypeFilter(string activityTypes) { ActivityFilterModel filterModel = new ActivityFilterModel(); JavaScriptSerializer serializer = new JavaScriptSerializer(); if (Session["ActivityFilter"] != null) { filterModel = Session["ActivityFilter"] as ActivityFilterModel; filterModel.ActivityTypes = serializer.Deserialize<List<ActivityTypeFilter>>(activityTypes); } else { filterModel.ActivityTypes = serializer.Deserialize<List<ActivityTypeFilter>>(activityTypes); Session["ActivityFilter"] = filterModel; } return Json(filterModel, JsonRequestBehavior.AllowGet); }
public ActionResult GetSelectedActivityTypeByDate(string selectedLocation, string selectedActivityCategory, string startDate, string endDate) { IEnumerable<ActivitySummaryDataContract> result = _activitiesService.GetAllActivitiesByLocationFilteredCategory(selectedLocation, selectedActivityCategory , DateTime.ParseExact(startDate, "d/MM/yyyy", CultureInfo.InvariantCulture) , DateTime.ParseExact(endDate, "d/MM/yyyy", CultureInfo.InvariantCulture), GetDeviceInformation()); ActivityFilterModel filterModel = new ActivityFilterModel(); if (Session["ActivityFilter"] != null) { (Session["ActivityFilter"] as ActivityFilterModel).StartDate = startDate; (Session["ActivityFilter"] as ActivityFilterModel).EndDate = endDate; } else { filterModel.StartDate = startDate; filterModel.EndDate = endDate; Session["ActivityFilter"] = filterModel; } return Json(result, JsonRequestBehavior.AllowGet); }