예제 #1
0
 public ActionResult GetAllFilters()
 {
     ActivityFilterModel filterModel = new ActivityFilterModel();
     if (Session["ActivityFilter"] != null)
     {
         filterModel = Session["ActivityFilter"] as ActivityFilterModel;
     }
     return Json(filterModel, JsonRequestBehavior.AllowGet);
 }
예제 #2
0
        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);
        }
예제 #3
0
 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);
 }