public ViewResult FilterCriteria() { var timeZoneList = BOTimeZone.TimeZoneCollection().OrderBy(tz => tz.TimeZoneDisplayName). Select(tz => new SelectListItem { Value = tz.TimeZoneDisplayName, Text = tz.TimeZoneDisplayName }).ToList(); timeZoneList.Insert(0, new SelectListItem() { Text = "All", Value = "All" }); FilterCriteria filterCriteria = new FilterCriteria(); filterCriteria.TimeZone = timeZoneList; filterCriteria.Duration = new[] { new SelectListItem { Text = "15 min", Value = "15 min" }, new SelectListItem { Text = "30 min", Value = "30 min" }, new SelectListItem { Text = "1 hr", Value = "1 hr" }, new SelectListItem { Text = "1 Week", Value = "1 Week" } }.ToList(); return(View(filterCriteria)); }
public ActionResult FilterCriteria(FilterCriteria filterCriteria) { try { throw new Exception(); if (string.IsNullOrWhiteSpace(filterCriteria.Topics)) { var timeZoneList = BOTimeZone.TimeZoneCollection().OrderBy(tz => tz.TimeZoneDisplayName). Select(tz => new SelectListItem { Value = tz.TimeZoneDisplayName, Text = tz.TimeZoneDisplayName }).ToList(); timeZoneList.Insert(0, new SelectListItem() { Text = "All", Value = "All" }); filterCriteria.TimeZone = timeZoneList; filterCriteria.Duration = new[] { new SelectListItem { Text = "15 min", Value = "15 min" }, new SelectListItem { Text = "30 min", Value = "30 min" }, new SelectListItem { Text = "1 hr", Value = "1 hr" }, new SelectListItem { Text = "1 week", Value = "1 week" } }.ToList(); return(View(filterCriteria)); } } catch (Exception ex) { logger.Log(ex.StackTrace, LOGLEVELS.ERROR); //error = ex.StackTrace; } //Clearing existing data for current User for fresh analysis BOTweetMentions.DeleteAll(User.Identity.GetUserId()); BOTweetCount.DeleteAll(User.Identity.GetUserId()); return(RedirectToAction("Index", "Home", new { UserId = Url.Encode(User.Identity.GetUserId()) })); }