public ActionResult GetRatingHistory(string id) { Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("zh-cn"); var code = BondInfoRepository.GetBondCodeById(id); if (string.IsNullOrEmpty(code)) { return(Json(new { IssuerRatingList = new List <RATE_ORG_CRED_HIS>(), BondRatingList = new List <BondRatingHist>(), }, JsonRequestBehavior.AllowGet)); } var comCode = ZcxRepository.GetComCodeFromBondCode(code).ToString(); var issuerRatingHistory = ZcxRepository.GetIssuerRating(comCode).Select(i => new { RATE_DATE = i.RATE_WRIT_DATE.ToString("yyyy-MM-dd"), RATE_ORG = i.Org, RATE = i.ISS_CRED_LEVEL }); var bondRatingHistory = BondReportRepository.GetBondRatingByCode(code).Select(b => new { RATE_DATE = b.RATE_DATE.ToString("yyyy-MM-dd"), RATE_ORG = b.RATE_ORG, RATE = b.RATE }); return(Json(new { IssuerRatingList = issuerRatingHistory, BondRatingList = bondRatingHistory }, JsonRequestBehavior.AllowGet)); }
public ActionResult DownloadRatingFile(long id) { var file = ZcxRepository.GetRatingFileData(id); if (file == null) { return(HttpNotFound()); } if (file.Content == null) { return(HttpNotFound()); } var contentType = MimeHelper.GetMimeTypeByExt(file.FileType); return(File(file.Content, contentType, Resources.Global.DownloadFileName + "." + file.FileType)); }