Example #1
0
        public ActionResult SpeedReport(ReportViewModel reportModel)
        {
            reportModel.Results = new List<ReportResultViewModel>();
            reportModel = new ReportData().GetSpeedReport(reportModel);

            ReportParameterViewModel model = new ReportParameterViewModel();
            model.DeviceList = new List<SelectListItem>();
            var CurrentUser = Session["UserData"] as Admin;

            // Get list of devices
            DataTable dt = Data.GetData(DataBase.Api, CommandType.StoredProcedure, "Api_GetDeviceList", new List<SqlParameter>() {
                    new SqlParameter("UserId", Guid.Parse(CurrentUser.UserId.ToString())) }.ToArray());
            if (dt != null || dt.Rows.Count > 0)
            {
                model.DeviceList = dt.AsEnumerable().Select(m => new SelectListItem()
                {
                    Value = Convert.ToString(m["DeviceId"]),
                    Text = Convert.ToString(m["DeviceId"])
                }).ToList();
            }
            reportModel.Parameter = model;
            return View(reportModel);
        }
Example #2
0
        public ActionResult Summary(ReportViewModel reportModel)
        {
            //ReportViewModel reportModel = new ReportViewModel();

            reportModel.Results = new List<ReportResultViewModel>();

            reportModel = new ReportData().GetSummaryReport(reportModel);
            return View(reportModel);
        }