Esempio n. 1
0
        public JsonResult GetOpenMarketOperation(int reportId, string type, DateTime startDate, DateTime endDate, string unit, bool includeExpired, string categoryType)
        {
            var table = OpenMarketReportRepository.GetOpenMarketOperation(type, startDate, endDate, unit, includeExpired?1:0);

            if (categoryType == "OperationTerm")
            {
                var dv = table.DefaultView;
                dv.Sort = "TERM";
                table   = dv.ToTable();
            }
            var columns = OpenMarketReportRepository.GetOpenMarketColumnDefinitionByReportId(reportId, "Operation");
            var jtable  = BuidJsonTable(table, columns);

            return(Json(jtable, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public ActionResult ExportExcelForOperation(int reportId, string type, DateTime startDate, DateTime endDate, string unit, bool includeExpired, string category)
        {
            var table = OpenMarketReportRepository.GetOpenMarketOperation(type, startDate, endDate, unit, includeExpired?1:0);

            if (category == "OperationTerm")
            {
                var dv = table.DefaultView;
                dv.Sort = "TERM";
                table   = dv.ToTable();
            }
            var columns      = OpenMarketReportRepository.GetOpenMarketColumnDefinitionByReportId(reportId, "Operation");
            var jtable       = BuidJsonTable(table, columns);
            var reportName   = MenuService.GetMenuNodeByReportId(reportId).DisplayName;
            var totalColumns = new List <string>();

            totalColumns.Add("Amount");
            totalColumns.Add("Volume");
            var jP = new JsonExcelParameter {
                Table = jtable, TableName = reportName, Source = Resources.Global.Source, totalColumns = totalColumns, sumGroupColumnName = category, isTotal = true
            };

            return(new JsonTableGroupExcelResult(jP));
        }