Пример #1
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"));
        }
Пример #2
0
 public ActionResult FileBrowser(int?id, string q)
 {
     if (id.HasValue || !string.IsNullOrEmpty(q))
     {
         ViewBag.Order    = "";
         ViewBag.Asc      = false;
         ViewBag.FileID   = 0;
         ViewBag.TopicID  = id ?? 0;
         ViewBag.queryStr = q ?? "";
         if (id.HasValue)
         {
             var topic = IPPRepository.GetTopicByID(id.Value, UserSettingHelper.GetEikonUserID(Request));
             ViewBag.PageTitle          = CultureHelper.IsEnglishCulture() ? topic["NAMEEN"] : topic["NAMECN"];
             ViewBag.TruncatedPageTitle = HtmlUtil.Truncate(ViewBag.PageTitle, 30);
             ViewBag.ChatroomUrl        = topic["RMLINK"];
             ViewBag.Following          = topic["FOLLOWING"];
         }
         else
         {
             ViewBag.PageTitle          = q;
             ViewBag.TruncatedPageTitle = HtmlUtil.Truncate(ViewBag.PageTitle, 30);
             ViewBag.ChatroomUrl        = "";
             ViewBag.Following          = 0;
         }
     }
     else
     {
         return(RedirectToAction("IPPHome"));
     }
     return(View());
 }
Пример #3
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);
        }
Пример #4
0
        public ActionResult IPPHome()
        {
            var isEnglish = CultureHelper.IsEnglishCulture();

            ViewBag.StaticTopics = IPPRepository.GetStaticTopics(isEnglish);
            ViewBag.Announcement = IPPRepository.GetAnnouncement(isEnglish);
            ViewBag.LatestFile   = IPPRepository.GetLatestFile(isEnglish);
            ViewBag.InternalUser = UserSettingHelper.IsInternalUser(Request);

            var    userAttibuteMap = UserSettingHelper.GetUserAttributeMap(Request);
            string submitterId;

            if (String.IsNullOrWhiteSpace(Request.Headers["reutersuuid"]))
            {
                submitterId = Request.ServerVariables["HTTP_X_FORWARDED_FOR"] ?? Request.ServerVariables["REMOTE_ADDR"];
            }
            else
            {
                submitterId = userAttibuteMap == null ? "" : userAttibuteMap.First(x => x.name.ToLower() == "UserId".ToLower()).value;
            }

            var email = userAttibuteMap == null ? "" : userAttibuteMap.First(x => x.name.ToLower() == "UserId".ToLower()).value;
            var name  = userAttibuteMap == null ? "" : userAttibuteMap.First(x => x.name.ToLower() == "FullName".ToLower()).value;
            var RM    = userAttibuteMap == null ? "" : userAttibuteMap.First(x => x.name.ToLower() == "ReutersMessagingId".ToLower()).value;

            IPPRepository.InsertSubmitter(submitterId, email, name, RM);

            return(View());
        }
Пример #5
0
        public ActionResult GetTopicsByCreater(int moduleID, int pageNo, int pageSize, bool isHtml = false)
        {
            int total;
            var table = IPPRepository.GetTopicsByCreater(moduleID, UserSettingHelper.GetEikonUserID(Request), pageNo,
                                                         pageSize, out total);
            var data = new { Data = DatatableToJson(table), CurrentPage = pageNo, PageSize = pageSize, Total = total };

            return(isHtml ? Json(data, "text/html", JsonRequestBehavior.AllowGet) : Json(data, JsonRequestBehavior.AllowGet));
        }
Пример #6
0
        public ActionResult GetFilesForApproval(int moduleID, int topicID, string key, int pageNo, int pageSize, int status, bool isHtml = false)
        {
            var isEn = CultureHelper.IsEnglishCulture();
            int total;
            var table = IPPRepository.GetFilesForApproval(moduleID, topicID, UserSettingHelper.GetEikonUserID(Request), key, pageNo, pageSize, isEn, status, out total);
            var data  = new { Data = DatatableToJson(table), CurrentPage = pageNo, PageSize = pageSize, Total = total };

            return(isHtml ? Json(data, "text/html", JsonRequestBehavior.AllowGet) : Json(data, JsonRequestBehavior.AllowGet));
        }
Пример #7
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());
        }
Пример #8
0
        public ActionResult GetFavoriteTopics(int moduleID, string userID, string topic, string order, int pageNo, int pageSize, bool isHtml = false)
        {
            var isEn = CultureHelper.IsEnglishCulture();
            int total;
            var table = IPPRepository.GetFavoriteTopics(moduleID, UserSettingHelper.GetEikonUserID(Request), topic, order, pageNo, pageSize, isEn, out total);
            var data  = new { Data = DatatableToJson(table), CurrentPage = pageNo, PageSize = pageSize, Total = total };

            return(isHtml ? Json(data, "text/html", JsonRequestBehavior.AllowGet) : Json(data, JsonRequestBehavior.AllowGet));
        }
Пример #9
0
        public ActionResult GetTopicName(int id)
        {
            var topic = IPPRepository.GetTopicByID(id, UserSettingHelper.GetEikonUserID(Request));
            var data  = new
            {
                Name          = CultureHelper.IsEnglishCulture() ? topic["NAMEEN"] : topic["NAMECN"],
                TruncatedName = HtmlUtil.Truncate(CultureHelper.IsEnglishCulture() ? topic["NAMEEN"].ToString() : topic["NAMECN"].ToString(), 30),
                ChatroomUrl   = topic["RMLINK"],
                Following     = topic["FOLLOWING"]
            };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Пример #10
0
        public ActionResult DeleteFileByID(int id)
        {
            var    result  = IPPRepository.DeleteFile(id, UserSettingHelper.GetEikonUserID(Request));
            string message = "";

            if (result == 1)
            {
                message = "Error.";
            }
            var data = new { Result = result, Message = message };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Пример #11
0
        private void SaveSettings_MouseClick(object sender, MouseEventArgs e)
        {
            var userSetting = new Setting
            {
                Send  = this.toBox.Text,
                Watch = this.MonitorBox.Text,
                User  = System.Security.Principal.WindowsIdentity.GetCurrent().Name
            };

            var list = new List <Setting>();

            list.Add(userSetting);

            UserSettingHelper.SaveSettings(list);
        }
Пример #12
0
        /// <summary>
        /// Mies the document partial.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns></returns>
        public ActionResult MyDocumentPartial(string id)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                return(new EmptyResult());
            }
            var pageId = id.Trim().ToLower();

            if (pageId == "preapprove" || pageId == "approved" || pageId == "topicmanagement")
            {
                if (!UserSettingHelper.IsInternalUser(Request))
                {
                    return(new EmptyResult());
                }
            }
            return(PartialView(id));
        }
Пример #13
0
        public ActionResult GetFileInfo(long id)
        {
            var file = IPPRepository.DownloadFile(id, UserSettingHelper.GetEikonUserID(Request));

            switch (file.UPLOADTYPE)
            {
            case ConstValues.IPP_Upload_File:
                return(Json(new { type = "file", url = Url.Action("DownloadFile", new { id = id }) }, JsonRequestBehavior.AllowGet));

            case ConstValues.IPP_Upload_Ric:
                return(Json(new { type = "ric", ricType = file.FILETYPE, ricVal = file.RIC }, JsonRequestBehavior.AllowGet));

            case ConstValues.IPP_Upload_WebSite:
                return(Json(new { type = "url", url = file.RIC }, JsonRequestBehavior.AllowGet));

            default:
                return(HttpNotFound());
            }
        }
Пример #14
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);
        }
Пример #15
0
        public Form1()
        {
            InitializeComponent();

            //initialize the filesystem watcher
            watcher = new FileSystemWatcher();

            //TODO: Remember to dispose of the object when it is done.

#if DEBUG
            this.MonitorBox.Text = @"C:\Users\Daniel\Desktop\From";
            this.toBox.Text      = @"C:\Users\Daniel\Desktop\To";
#endif
            notifyIcon.BalloonTipText  = "FileOrg Minimized.";
            notifyIcon.BalloonTipTitle = "FileOrg";

            if (this.CheckIfRegistryExists(Application.ProductName))
            {
                this.autoStart.Checked = true;
            }
            else
            {
                this.autoStart.Checked = false;
            }


            //check if the esttings exist. If so, start the threads.
            var settings = UserSettingHelper.LoadSettings();
            if (settings.Count > 0)
            {
                foreach (var setting in settings)
                {
                    if (setting.User == System.Security.Principal.WindowsIdentity.GetCurrent().Name)
                    {
                        this.MonitorBox.Text = setting.Watch;
                        this.toBox.Text      = setting.Send;
                        StartMonitor_Click(this, new EventArgs());
                    }
                }
            }
        }
Пример #16
0
        public ActionResult DeleteTopic(int id)
        {
            var result  = IPPRepository.DeleteTopic(id, UserSettingHelper.GetEikonUserID(Request));
            var message = "";

            switch (result)
            {
            case 1:
                message = Resources.IPP.IPP_FileExist;
                break;

            case 2:
                message = "unknown error, try again later";
                break;

            default:
                message = "";
                break;
            }
            var data = new { Result = result, Message = message };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Пример #17
0
        public ActionResult TopicEditor(int?id)
        {
            var      topicCreate = id == null ? new TopicCreate() : IPPRepository.GetTopicById((int)id);
            IPPTopic ippTopic;

            topicCreate = topicCreate ?? new TopicCreate();
            var moduleItems = new List <SelectListItem>();
            IEnumerable <MODULEINFO> modules = IPPRepository.GetModuleList();

            foreach (var m in modules)
            {
                moduleItems.Add(new SelectListItem {
                    Value = m.ID.ToString(), Selected = m.ID == topicCreate.ModuleID ? true : false, Text = CultureHelper.IsEnglishCulture() ? m.NAMEEN : m.NAMECN
                });
            }

            ippTopic = new IPPTopic
            {
                ID                = topicCreate.ID,
                DescriptionCn     = topicCreate.DescriptionCn,
                DescriptionEn     = topicCreate.DescriptionEn,
                Tag               = topicCreate.Tag,
                NameCn            = topicCreate.NameCn,
                NameEn            = topicCreate.NameEn,
                ModuleItems       = moduleItems,
                Approver          = string.IsNullOrEmpty(topicCreate.Approver) ? UserSettingHelper.GetEikonUserID(Request) : topicCreate.Approver,
                IsApprove         = topicCreate.IsApprove,
                IsDirectDelete    = topicCreate.IsDirectDelete,
                IsInternalApprove = topicCreate.IsInternalApprove,
                ModuleID          = topicCreate.ModuleID.ToString(),
                RMLink            = topicCreate.RMLink,
                Thumbnail         = topicCreate.Thumbnail,
                ImageName         = topicCreate.ImageName
            };

            return(View(ippTopic));
        }
Пример #18
0
        public ActionResult UpdateFileStatus(int id, string operation)
        {
            int status = 1;

            switch (operation)
            {
            case "publish":
                status = 1;
                break;

            case "approve":
                status = 2;
                break;

            case "reject":
                status = 3;
                break;

            case "delete":
                return(DeleteFileByID(id));

            default:
                break;
            }

            int    ret     = IPPRepository.UpdateFileStatus(id, status, UserSettingHelper.GetEikonUserID(Request));
            string message = "";

            if (ret == 1)
            {
                message = Resources.IPP.IPP_Already_Approve;
            }

            var data = new { Result = ret, Message = message };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Пример #19
0
        public ActionResult UploadTopic(IPPTopic ippTopic, HttpPostedFileBase image)
        {
            var tmp = ippTopic.Approver.Replace(';', ';').Trim();

            if (tmp[tmp.Length - 1] != ';')
            {
                ippTopic.Approver += ";";
            }

            var topicCreate = new TopicCreate
            {
                ID                = ippTopic.ID,
                DescriptionCn     = ippTopic.DescriptionCn,
                DescriptionEn     = ippTopic.DescriptionEn,
                IsApprove         = ippTopic.IsApprove,
                IsInternalApprove = ippTopic.IsInternalApprove,
                IsDirectDelete    = ippTopic.IsDirectDelete,
                Approver          = ippTopic.Approver,
                RMLink            = ippTopic.RMLink,
                Tag               = ippTopic.Tag,
                NameCn            = ippTopic.NameCn,
                NameEn            = ippTopic.NameEn,
                ModuleID          = Convert.ToInt32(ippTopic.ModuleID),
                Creater           = UserSettingHelper.GetEikonUserID(Request),
                ImageName         = ippTopic.ImageName
            };

            if (image != null && image.ContentLength > 0)
            {
                topicCreate.Thumbnail = new byte[image.ContentLength];
                image.InputStream.Read(topicCreate.Thumbnail, 0, image.ContentLength);
            }

            IPPRepository.UploadTopic(topicCreate);
            return(Redirect("~/ipp/MyDocument/topicManagement"));
        }
Пример #20
0
 public ActionResult FollowTopic(int id)
 {
     IPPRepository.FollowTopic(UserSettingHelper.GetEikonUserID(Request), id);
     return(Content(""));
 }
Пример #21
0
 public ActionResult UpdateOrCreateUserColumn(int reportId, string setting)
 {
     _userColumnSvc.SaveUserColumns(UserSettingHelper.GetUserId(Request), reportId, setting);
     return(new HttpStatusCodeResult(HttpStatusCode.OK));
 }
Пример #22
0
        public ActionResult GetAvailableColumns(int reportId)
        {
            var columns = _userColumnSvc.GetAllColumnsWithUserSetting(UserSettingHelper.GetUserId(Request), reportId, CultureHelper.IsEnglishCulture());

            return(Json(columns, JsonRequestBehavior.AllowGet));
        }
Пример #23
0
        public ActionResult QueryFiles(int id, string q, string title, string author, DateTime?startDate, DateTime?endDate, bool enableDate, string description, string source, int pageNo, int pageSize, string order, bool isHtml = false, long fileID = 0)
        {
            var isEn = CultureHelper.IsEnglishCulture();
            int total;
            var table = IPPRepository.QueryFiles(id, q, title, author, startDate, endDate, enableDate, description, source, pageNo, pageSize, order, isEn, UserSettingHelper.GetEikonUserID(Request), out total, fileID);

            var data = new { Data = DatatableToJson(table), CurrentPage = pageNo, PageSize = pageSize, Total = total };

            return(isHtml ? Json(data, "text/html", JsonRequestBehavior.AllowGet) : Json(data, JsonRequestBehavior.AllowGet));
        }
Пример #24
0
        public ActionResult FileEditor(long?id, int?topicid, string previousRequest)
        {
            FileCreate fileCreate = null;

            if (id == null)
            {
                fileCreate = new FileCreate();
                var eikonUserId = UserSettingHelper.GetEikonUserID(Request);
                var submitter   = IPPRepository.GeSubmitterById(eikonUserId);

                fileCreate.SubmitterID  = submitter.ID;
                fileCreate.SubmiterName = submitter.Name;
                fileCreate.Submiter     = submitter.Email;
            }
            else
            {
                fileCreate = IPPRepository.GetFileByFileID((long)id);
            }

            IPPFile ippFile;

            fileCreate = fileCreate ?? new FileCreate();
            var moduleItems     = new List <SelectListItem>();
            var topicItems      = new List <SelectListItem>();
            var ricTypeItems    = new List <SelectListItem>();
            var uploadTypeItems = HtmlUtil.CookSelectOptions("Ipp_UploadType");

            if (id != null)
            {
                topicid = IPPRepository.GetTopicIdByFileId(id);
            }

            IEnumerable <MODULEINFO> modules = IPPRepository.GetModuleList();
            var moduleId = (topicid == null || topicid == 0)? modules.FirstOrDefault().ID : (int)IPPRepository.GetModuleIdByTopicId((int)topicid);
            var topics   = IPPRepository.GetTopicListByModuleId(moduleId);

            foreach (var m in modules)
            {
                moduleItems.Add(new SelectListItem {
                    Selected = m.ID == moduleId ? true : false, Value = m.ID.ToString(), Text = CultureHelper.IsEnglishCulture() ? m.NAMEEN : m.NAMECN
                });
            }

            var selectedTopicId = topicid == null?topics.FirstOrDefault().ID : topicid;

            foreach (var m in topics)
            {
                topicItems.Add(new SelectListItem {
                    Selected = m.ID == selectedTopicId ? true : false, Value = m.ID.ToString(), Text = CultureHelper.IsEnglishCulture() ? m.NAMEEN : m.NAMECN
                });
            }

            ricTypeItems.Add(new SelectListItem {
                Value = "Graph", Text = "Chart"
            });
            ricTypeItems.Add(new SelectListItem {
                Value = "Quote Object", Text = "Quote"
            });
            ricTypeItems.Add(new SelectListItem {
                Value = "News", Text = "News"
            });

            var userAttibuteMap = UserSettingHelper.GetUserAttributeMap(Request);
            var author          = userAttibuteMap == null ? "" : userAttibuteMap.First(x => x.name.ToLower() == "FullName".ToLower()).value;
            var source          = userAttibuteMap == null ? "" : userAttibuteMap.First(x => x.name.ToLower() == "AccountName".ToLower()).value;

            if (UserSettingHelper.IsInternalUser(Request))
            {
                source = "Thomson Reuters";
            }

            ippFile = new IPPFile
            {
                Id                                              = fileCreate.ID,
                Author                                          = string.IsNullOrEmpty(fileCreate.Author) ? author : fileCreate.Author,
                AuthorRM                                        = fileCreate.AuthorRM,
                AuthorEmail                                     = fileCreate.AuthorEmail,
                DescriptionCn                                   = fileCreate.DescrCn,
                DescriptionEn                                   = fileCreate.DescrEn,
                UploadType                                      = fileCreate.UploadType,
                FileType                                        = fileCreate.FileType,
                WebsiteRic                                      = fileCreate.UploadType == "Upload_Website" ? fileCreate.RIC : "",
                EikonRic                                        = fileCreate.UploadType == "Upload_Ric" ? fileCreate.RIC : "",
                ReportDate                                      = fileCreate.ReportDate.ToString("yyyy-MM-dd"),
                SubmitterID                                     = fileCreate.SubmitterID,
                SubmiterName                                    = fileCreate.SubmiterName,
                Submiter                                        = fileCreate.Submiter,
                Tag                                             = fileCreate.Tag != null?fileCreate.Tag.Replace('|', ';') : fileCreate.Tag,
                                                TitleCn         = fileCreate.TitleCn,
                                                TitleEn         = fileCreate.TitleEn,
                                                ModuleItems     = moduleItems,
                                                Topic           = selectedTopicId.ToString(),
                                                TopicItems      = topicItems,
                                                UploadTypeItems = uploadTypeItems,
                                                RicTypeItems    = ricTypeItems,
                                                Source          = string.IsNullOrEmpty(fileCreate.Source) ? source : fileCreate.Source,
                                                PreviousRequest = previousRequest,
                                                Status          = fileCreate.Status,
                                                FileName        = fileCreate.FileName,
                                                DisplayOrder    = fileCreate.DisplayOrder
            };

            return(View(ippFile));
        }
Пример #25
0
 /// <summary>
 /// Mies the document.
 /// </summary>
 /// <returns></returns>
 public ActionResult MyDocument()
 {
     ViewBag.InternalUser = UserSettingHelper.IsInternalUser(Request);
     return(View());
 }
Пример #26
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));
        }
Пример #27
0
 public JsonResult RateFile(int fileID, int rate)
 {
     IPPRepository.RateFile(fileID, UserSettingHelper.GetUserId(Request), rate);
     return(Json(GetRatingStatistics(fileID)));
 }