Esempio n. 1
0
        public ActionResult Grid(ChartViewModel model)
        {
            //The URL should come from a selection in the UI.
            //hardcode here for debugging
            model.Url = "https://www.findlay.edu";

            return RedirectToAction("Index", model);
        }
Esempio n. 2
0
        // GET: Grid
        public ActionResult Index(ChartViewModel model)
        {
            var listPageResponseModel = new List<PageResponseModel>();

            using (var pageStatusRepository = new PageStatusRepository())
            {
                //Default to set date for debugging
                var startDate = DateTime.Now.Date.AddDays(-5).ToString(CultureInfo.InvariantCulture);
                var endDate = DateTime.Now.Date.ToString(CultureInfo.InvariantCulture);

                if (model != null)
                {
                    startDate = model.StartDate.ToString(CultureInfo.InvariantCulture);
                    endDate = model.EndDate.ToString(CultureInfo.InvariantCulture);
                }

                var pageStatuses = pageStatusRepository.GetPageStatusesByDate(startDate, endDate);

                var timeZoneId = "Eastern Standard Time";
                var easternZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);

                foreach (var pageStatus in pageStatuses)
                {
                    var utcTime = new DateTime(
                        pageStatus.Created.Year,
                        pageStatus.Created.Month,
                        pageStatus.Created.Day,
                        pageStatus.Created.Hour,
                        pageStatus.Created.Minute,
                        pageStatus.Created.Second);

                    var easternTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, easternZone);

                    listPageResponseModel.Add(
                        new PageResponseModel
                        {
                            Url = pageStatus.Url,
                            ResponseTime = pageStatus.ResponseTime,
                            Created = easternTime
                        });
                }
            }

            ViewBag.datasource = listPageResponseModel;

            return View();
        }
Esempio n. 3
0
        public ActionResult Report()
        {
            var model = new ChartViewModel
            {
                StartDate = DateTime.Now.AddDays(-1),
                EndDate   = DateTime.Now
            };

            return View(model);
        }
Esempio n. 4
0
 // GET: Report
 public ActionResult Index(ChartViewModel model)
 {
     return View(model);
 }
Esempio n. 5
0
        public ActionResult Report(FormCollection form)
        {
            var model = new ChartViewModel();

            UpdateModel(model);

            if (model.ButtonClicked == "grid")
            {
                //The URL should come from a selection in the UI.
                //hardcode here for debugging
                model.Url = "https://www.findlay.edu";

                return RedirectToAction("Index", "Grid", model);
            }

            return RedirectToAction("Grid", model);
        }