Exemple #1
0
        public ActionResult SearchForm(string platform)
        {
            int orgId  = ImpersonateController.GetOrgId(Request);
            int userId = ImpersonateController.GetUserId(Request);

            ViewBag.OrganizationId = orgId;

            var columns = _reportsService.GetSelectableColumns(platform, orgId, userId);

            var model = columns.Data.OrderBy(x => x.MainCategory == "Date" ? 1 : 2).ThenBy(x => x.Id).ToList();

            var idColulmn = columns.Data.FirstOrDefault(x => x.UniqueName.ToLower().EndsWith("id") || x.DisplayName.ToLower().EndsWith("id"));

            if (idColulmn != null)
            {
                ViewBag.SelectedColumnName = idColulmn.UniqueName;
            }

            // get the text columns for text filter column selector

            var columnMappings = _reportsService.GetColumnMappings(platform, orgId, userId);
            var textColumns    = columnMappings.Data.Where(x => IsStringType(x.DbType));

            ViewBag.TextColumnIds = textColumns.Select(x => x.Id.ToString()).ToList();

            return(PartialView("SearchForm", model));
        }
Exemple #2
0
        public ActionResult Edit(int id, string platform)
        {
            int orgId = ImpersonateController.GetOrgId(Request);

            var allMappings = _reportsService.GetColumnMappings(platform, orgId, null, columnId: id);

            var model = allMappings.Data.First();

            return(View(model));
        }
Exemple #3
0
        public ActionResult Index(string platform)
        {
            int orgId  = ImpersonateController.GetOrgId(Request);
            int userId = ImpersonateController.GetUserId(Request);

            ViewBag.Platform       = platform;
            ViewBag.OrganizationId = orgId;

            var model = _reportsService.GetColumnMappings(platform, orgId, userId: userId);

            return(View(model));
        }
Exemple #4
0
        public ActionResult Index(string platform = null)
        {
            int orgId = ImpersonateController.GetOrgId(Request);

            if (platform == null)
            {
                return(SelectProvider());
            }

            ViewBag.Platform       = platform;
            ViewBag.OrganizationId = orgId;
            return(View());
        }
Exemple #5
0
        public ActionResult Export(string platform, SearchRequest searchRequest)
        {
            int orgId  = ImpersonateController.GetOrgId(Request);
            int userId = ImpersonateController.GetUserId(Request);

            var sw = new Stopwatch();

            sw.Start();

            var result = _reportsService.GenerateReport(platform, orgId, userId, searchRequest);

            sw.Stop();
            ViewBag.SearchElapsedMilliseconds = sw.ElapsedMilliseconds;

            return(View("Export", result));
        }
Exemple #6
0
        public ActionResult Create(string platform)
        {
            int orgId = ImpersonateController.GetOrgId(Request);

            var model = new ReportColumnMapping
            {
                DataSourceTypeId       = 1,
                OrganizationId         = orgId > 0 ? orgId :(int?)null,
                FieldAggregationMethod = FieldAggregationMethod.Sum,
                DbType     = DbType.Int32,
                KnownTable = "Stats",
                MetaData   = new List <ReportColumnMetaDataValue>()
                {
                    new ReportColumnMetaDataValue()
                    {
                        Name = "DataFormat", Value = "Number"
                    }
                }
            };

            return(View("Edit", model));
        }