예제 #1
0
        private JsonTable GetBottomTable(BondDetailParams param, int id)
        {
            var userColumnService = (UserColumnService)DependencyResolver.Current.GetService(typeof(UserColumnService));
            var columns           = userColumnService.GetUserColumns(UserSettingHelper.GetUserId(Request), id);
            int total;
            var bottomTable             = BondReportRepository.GetBondDetailByTypeNew(param, out total);
            var reportcolumndefinitions = columns as REPORTCOLUMNDEFINITION[] ?? columns.ToArray();
            var jsonTable = BuidJsonTable(bottomTable, reportcolumndefinitions, total, param.StartPage, param.PageSize);
            List <Dictionary <string, string> > rowData = jsonTable.RowData;

            foreach (Dictionary <string, string> currentRow in rowData)
            {
                foreach (DataRow row in bottomTable.Rows)
                {
                    if (row["AssetId"].ToString() == currentRow["AssetId"])
                    {
                        if (!reportcolumndefinitions.Any(x => x.COLUMN_NAME == "IssuerOrgId"))
                        {
                            currentRow.Add("IssuerOrgId", row["IssuerOrgId"].ToString());
                        }
                        break;
                    }
                }
            }
            return(jsonTable);
        }
예제 #2
0
        public ActionResult ExportExcelForIssuanceMaturesDetail(DateTime start, DateTime end, string type, string typeValue, int useSubType, string subType, string subTypeValue, string unit, string term, string reportName, int id, string order, string itemList, int startPage, int pageSize)
        {
            var userColumnService = (UserColumnService)DependencyResolver.Current.GetService(typeof(UserColumnService));
            var columns           = userColumnService.GetUserColumns(UserSettingHelper.GetUserId(Request), id);
            var param             = new BondDetailParams
            {
                Type         = type,
                TypeValue    = typeValue,
                UseSubType   = useSubType == 1,
                SubType      = subType,
                SubTypeValue = subTypeValue,
                StartDate    = start,
                EndDate      = end,
                Term         = term,
                OrderBy      = order,
                ItemList     = itemList,
                StartPage    = startPage,
                PageSize     = pageSize
            };
            int total;
            var bottomTable = BondReportRepository.GetBondDetailByTypeNew(param, out total);

            ReportParameter reportParam = new ReportParameter
            {
                StartDate = start,
                EndDate   = end,
                Unit      = string.IsNullOrEmpty(unit) ? "100M" : unit,
            };

            var reportcolumndefinitions = columns as REPORTCOLUMNDEFINITION[] ?? columns.ToArray();

            return(new ExcelResult(bottomTable.AsEnumerable().AsQueryable(), reportcolumndefinitions.Select(x => x.DisplayName).ToArray(), reportcolumndefinitions.Select(x => x.COLUMN_NAME).ToArray(), reportName, reportName, false, null, reportParam, false, specificDateFormat: "yyyy-MM-dd"));
        }
예제 #3
0
        public PartialViewResult RatingDailog(int id)
        {
            ViewBag.ID   = id;
            ViewBag.Rate = IPPRepository.GetUserFileRate(id, UserSettingHelper.GetUserId(Request));
            var xAxisvalue = string.Join(",", GetRatingStatistics(id));

            ViewBag.X = string.Format("[{0}]", xAxisvalue);
            return(PartialView());
        }
예제 #4
0
        public string GeResUrl(int id)
        {
            _log.Error("Start GeResUrl:" + id);
            _repository.AddFileVisitLog(id, UserSettingHelper.GetUserId(Request));
            var    fileDetail = _repository.GetFileDetailById(id);
            string instiu     = fileDetail.INSTITUTIONINFOCODE;
            string result     = string.Empty;

            _log.Error("Get fileDetail.EXTENSION:" + fileDetail.EXTENSION);
            if (fileDetail.EXTENSION == "pdf" && "NationalGrainAndOilsInformationCenter,BeijingZhongdianJingwei".Contains(instiu))
            {
                result = "/PdfView/PdfView?did=" + id;
            }
            else
            {
                result = "/ResearchReport/DownloadFile?id=" + id;
            }
            return(result);
        }
예제 #5
0
        public virtual ActionResult GetReport(int id)
        {
            var reportInfo = ReportService.GetReportInfoById(id);
            BaseReportViewModel viewModel = null;
            var viewModelType             = System.Type.GetType(reportInfo.ViewModelName);

            if (viewModelType != null)
            {
                viewModel      = (BaseReportViewModel)Activator.CreateInstance(viewModelType, new object[] { reportInfo.ReportId, UserSettingHelper.GetUserId(Request) });
                viewModel.ID   = reportInfo.ReportId;
                viewModel.Name = reportInfo.DisplayName;
                viewModel.Initialization(Request);
            }
            else
            {
                ViewBag.ID   = reportInfo.ReportId;
                ViewBag.Name = reportInfo.DisplayName;
            }
            return(PartialView(reportInfo.ViewName, viewModel));
        }
예제 #6
0
 public ActionResult UpdateOrCreateUserColumn(int reportId, string setting)
 {
     _userColumnSvc.SaveUserColumns(UserSettingHelper.GetUserId(Request), reportId, setting);
     return(new HttpStatusCodeResult(HttpStatusCode.OK));
 }
예제 #7
0
        public ActionResult GetAvailableColumns(int reportId)
        {
            var columns = _userColumnSvc.GetAllColumnsWithUserSetting(UserSettingHelper.GetUserId(Request), reportId, CultureHelper.IsEnglishCulture());

            return(Json(columns, JsonRequestBehavior.AllowGet));
        }
예제 #8
0
 public JsonResult RateFile(int fileID, int rate)
 {
     IPPRepository.RateFile(fileID, UserSettingHelper.GetUserId(Request), rate);
     return(Json(GetRatingStatistics(fileID)));
 }