示例#1
0
        public ActionResult GetRateOfIssuesReport(int id)
        {
            ReportInfo reportInfo   = ReportService.GetReportInfoById(id);
            var        startDate    = new DateTime(DateTime.Now.Year - 1, DateTime.Now.Month, 1);
            var        bondRateRepo = ReportService.GetBondIssueRatesRepo(new BondIssueParams
            {
                StartDate = startDate,
                BondType  = "BTB",
                Term      = "7Y",
                IsFloat   = "n",
                Rating    = "All"
            }).ToList();
            var bondRateRepo2 = ReportService.GetBondIssueRatesRepo(new BondIssueParams
            {
                StartDate = startDate,
                BondType  = "PBB",
                Term      = "7Y",
                IsFloat   = "n",
                Rating    = "All"
            }).ToList();

            var bondIssueReport = new BondIssueRateReport(reportInfo.ReportId)
            {
                Name = reportInfo.DisplayName,
            };

            bondIssueReport.InitOrUpdate(bondRateRepo);
            bondIssueReport.InitOrUpdate(bondRateRepo2);
            var themeName = ThemeHelper.GetTheme(Request);

            bondIssueReport.Chart.Theme = themeName;

            return(View("RateOfIssues", bondIssueReport));
        }
示例#2
0
        public ActionResult AddBond(int reportId, string displayName, DateTime?date, string bondType, string term, string couponType, string rating, string grid)
        {
            var serializer = new JavaScriptSerializer();

            if (grid.Contains("&quot"))
            {
                grid = System.Web.HttpUtility.HtmlDecode(grid);
            }
            var g = serializer.Deserialize(grid, typeof(List <BondIssueRate>)) as List <BondIssueRate>;

            var param = new BondIssueParams
            {
                StartDate = date ?? new DateTime(DateTime.Now.Year, 1, 1),
                BondType  = bondType,
                Term      = term,
                IsFloat   = couponType,
                Rating    = rating,
            };

            var bondRateRepo = ReportService.GetBondIssueRatesRepo(param).ToList();

            var bondIssueReport = new BondIssueRateReport(reportId)
            {
                Name        = displayName,
                Grid        = g,
                IsAllRating = rating == "All"
            };

            bondIssueReport.InitOrUpdate(bondRateRepo);
            var themeName = ThemeHelper.GetTheme(Request);

            bondIssueReport.Chart.Theme = themeName;

            return(PartialView("_IssueRatesStatistical", bondIssueReport));
        }
示例#3
0
        public ActionResult DeleteBond(int reportId, string displayName, DateTime?date, string bondType, string term, string couponType, string rating, string grid, string itemName)
        {
            var serializer = new JavaScriptSerializer();

            if (grid.Contains("&quot"))
            {
                grid = System.Web.HttpUtility.HtmlDecode(grid);
            }
            var g = serializer.Deserialize(grid, typeof(List <BondIssueRate>)) as List <BondIssueRate>;

            if (g != null)
            {
                g.RemoveAll(b => b.ItemName == itemName);
            }

            var bondIssueReport = new BondIssueRateReport(reportId)
            {
                Name        = displayName,
                Grid        = g,
                IsAllRating = rating == "All"
            };

            bondIssueReport.UpdateChartOnly(g);
            var themeName = ThemeHelper.GetTheme(Request);

            bondIssueReport.Chart.Theme = themeName;

            return(PartialView("_IssueRatesStatistical", bondIssueReport));
        }