Пример #1
0
        public SalesforceUserResponse GetSalesforceUser(string userId)
        {
            IServiceRequest        proxy;
            SalesforceUserRequest  request  = null;
            SalesforceUserResponse response = null;

            try
            {
                proxy = ServiceRequestFactory.GetProxy(SERVICES.AUM_SERVICE);

                request        = new SalesforceUserRequest();
                request.Filter = string.Format("(APLId == '{0}')", userId);;
                response       = proxy.Request <SalesforceUserRequest, SalesforceUserResponse>(request);

                if (null != response)
                {
                    if (response.Fault != null)
                    {
                        // log error
                        Sitecore.Diagnostics.Log.Error(response.Fault, this);
                    }
                    else
                    {
                        return(response);
                    }
                }
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Unable to get Salesforce user data for userId [" + userId + "] from AUM service", ex, this);
                throw ex;
            }
            return(response);
        }
Пример #2
0
        static private int SendEmail(string sEmailFrom, string sEmailFromName, string oListOfContacts, string oListOfCCContacts, string sEmailSubject, string sEmailBody)
        {
            int             iSuccess;
            IServiceRequest oServiceProxy;

            GFWM.Common.AUM.Entities.Response.Client.EventSendEmailResponse oEmailResponse;
            GFWM.Common.AUM.Entities.Request.Client.EventSendEmailRequest   oRequestEmail;

            try
            {
                oServiceProxy = ServiceRequestFactory.GetProxy(SERVICES.AUM_SERVICE);

                oEmailResponse = null;
                oRequestEmail  = new GFWM.Common.AUM.Entities.Request.Client.EventSendEmailRequest();

                oRequestEmail.SendByUserName  = sEmailFromName;
                oRequestEmail.SendByUserEmail = sEmailFrom;
                oRequestEmail.Recipient       = oListOfContacts;
                oRequestEmail.CCRecipients    = oListOfCCContacts;
                oRequestEmail.Subject         = sEmailSubject;
                oRequestEmail.Body            = sEmailBody;

                oEmailResponse = oServiceProxy.Request <GFWM.Common.AUM.Entities.Request.Client.EventSendEmailRequest, GFWM.Common.AUM.Entities.Response.Client.EventSendEmailResponse>(oRequestEmail);
                iSuccess       = (oEmailResponse == null) ? iUnableToSendEmail : oEmailResponse.Result;
            }
            catch (Exception oEmailSendingException)
            {
                Sitecore.Diagnostics.Log.Error("Error while trying send email", oEmailSendingException, typeof(Email));
                throw oEmailSendingException;
            }

            return(iSuccess);
        }
        public static Dictionary <string, GridTable> GetInvestmentLevelData()
        {
            Dictionary <string, GridTable> tables = new Dictionary <string, GridTable>();
            IServiceRequest oAUMService;

            try
            {
                var currentAuthorization = Authorization.CurrentAuthorization;
                oAUMService = ServiceRequestFactory.GetProxy(SERVICES.AUM_SERVICE);

                GFWM.Common.PracticeManagement.Entities.Request.PremierConsultantInvestmentLevelRequest request = new GFWM.Common.PracticeManagement.Entities.Request.PremierConsultantInvestmentLevelRequest();

                var response = oAUMService.Request <GFWM.Common.PracticeManagement.Entities.Request.PremierConsultantInvestmentLevelRequest, GFWM.Common.PracticeManagement.Entities.Response.PremierConsultantInvestmentLevelResponse>(request);

                if (response != null)
                {
                    if (response.FirmBdas != null && response.FirmBdas.Count() > 0)
                    {
                        tables.Add(HtmlTableHelper.ILSFirmCODE, GetFirmTable(response.FirmBdas));
                    }

                    if (response.AdvisorBdas != null && response.AdvisorBdas.Count() > 0)
                    {
                        tables.Add(HtmlTableHelper.ILSAdvisorCODE, GetAdvisorTable(response.AdvisorBdas));
                    }
                }

                return(tables);
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Error executing GetInvestmentLevelData request", ex, typeof(PracticeManagementHelper));
            }
            return(null);
        }
Пример #4
0
        public UserAttributesResponse GetUserAttributes(string ssoguid, string userId)
        {
            IServiceRequest        proxy;
            UserAttributesResponse response = null;
            UserAttributesRequest  request  = null;

            try
            {
                proxy = ServiceRequestFactory.GetProxy(SERVICES.STATE_SERVICE);

                request         = new UserAttributesRequest();
                request.SSOGUID = ssoguid;
                request.UserId  = userId;
                response        = proxy.Request <UserAttributesRequest, UserAttributesResponse>(request);

                if (null != response)
                {
                    if (response.Fault != null)
                    {
                        // log error
                        Sitecore.Diagnostics.Log.Error(response.Fault, this);
                    }
                    else
                    {
                        return(response);
                    }
                }
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Unable to get user attributes for SSOGUID [" + ssoguid + "] and or userId [" + userId + "] from State service", ex, this);
                throw ex;
            }
            return(response);
        }
Пример #5
0
        public UserProfileResponse GetUserSSODetails(string ssoguid)
        {
            IServiceRequest     proxy;
            UserProfileResponse response = null;
            UserProfileRequest  request  = null;

            try
            {
                proxy = ServiceRequestFactory.GetProxy(SERVICES.USERPROFILE_SERVICE);

                request         = new UserProfileRequest();
                request.SSOGUID = ssoguid;
                response        = proxy.Request <UserProfileRequest, UserProfileResponse>(request);

                if (null != response)
                {
                    if (response.Fault != null)
                    {
                        // log error
                        Sitecore.Diagnostics.Log.Error(response.Fault, this);
                    }
                    else
                    {
                        return(response);
                    }
                }
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Unable to get user details for SSOGUID " + ssoguid + " from User Profile service", ex, this);
                throw ex;
            }
            return(response);
        }
Пример #6
0
        public GFWM.Common.AUM.Entities.Response.SupportTeamResponse GetSupportTeamDetails(string agentId)
        {
            SupportTeamResponse response = null;
            IServiceRequest     proxy;

            try
            {
                SupportTeamRequest request = new SupportTeamRequest();
                proxy = ServiceRequestFactory.GetProxy(SERVICES.AUM_SERVICE);

                request.AgentId = agentId;
                response        = proxy.Request <SupportTeamRequest, SupportTeamResponse>(request);

                if (null != response)
                {
                    if (response.Fault != null)
                    {
                        // log error
                        Sitecore.Diagnostics.Log.Error(response.Fault, this);
                    }
                    else
                    {
                        return(response);
                    }
                }
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Unable to get support team contact details data for Agent " + agentId + " from AUM service", ex, this);
                throw ex;
            }
            return(response);
        }
Пример #7
0
        /// <summary>
        /// Returns the automatically generated documents for the current user
        /// </summary>
        /// <param name="oCustodians"></param>
        /// <param name="oPrograms"></param>
        /// <returns></returns>
        public static List <ModelPortfolioResult> GetModelPortfolioDocuments(string[] oCustodians, string[] oPrograms)
        {
            ModelSetsRequest            oModelSetsRequest;
            ModelSetsResponse           oModelSetsResponse;
            Authorization               oAuthorization;
            List <ModelPortfolioResult> oModelPortfolioResult;
            IServiceRequest             oAUMService;

            try
            {
                oAUMService           = ServiceRequestFactory.GetProxy(SERVICES.AUM_SERVICE);
                oModelPortfolioResult = new List <ModelPortfolioResult>();
                oAuthorization        = Authorization.CurrentAuthorization;
                Sitecore.Diagnostics.Log.Info("Model Portfolio Start External call", "");
                Sitecore.Diagnostics.Log.Info(string.Format("Model Portfolio oAuthorization != null [{0}] !oAuthorization.IsTestMode [{1}] oAuthorization.Claim != null [{2}] oAuthorization.Claim.Roles != null [{3}] oAuthorization.Claim.Roles.Count() > 0 [{4}]", oAuthorization != null, !oAuthorization.IsTestMode, oAuthorization.Claim != null, oAuthorization.Claim.Roles != null, oAuthorization.Claim.Roles.Count() > 0), "");
                //We can only obtain the documents if we are working on integrated mode
                if (oAuthorization != null && !oAuthorization.IsTestMode && oAuthorization.Claim != null && oAuthorization.Claim.Roles != null && oAuthorization.Claim.Roles.Count() > 0)
                {
                    //We assume that we should get the documents for all the roles for the current user
                    Sitecore.Diagnostics.Log.Info(string.Format("Model Portfolio External call NO SIEBELID,CustodianID: {0}, ProgramId: {1}, SiebelID: {2}", String.Concat(oCustodians), String.Concat(oPrograms), "String.Empty"), "");
                    oModelSetsRequest = new GFWM.Common.Resources.Entities.Request.ModelSetsRequest()
                    {
                        CustodianId = oCustodians,
                        ProgramId   = oPrograms
                    };

                    oModelSetsResponse = oAUMService.Request <GFWM.Common.Resources.Entities.Request.ModelSetsRequest, GFWM.Common.Resources.Entities.Response.ModelSetsResponse>(oModelSetsRequest);

                    if (oModelSetsResponse != null && oModelSetsResponse.ModelSets != null)
                    {
                        foreach (GFWM.Common.Resources.Entities.Data.ModelSetDocument documentData in oModelSetsResponse.ModelSets)
                        {
                            oModelPortfolioResult.Add(new ModelPortfolioResult(
                                                          documentData.DocumentTitle,
                                                          documentData.DownloadLink,
                                                          documentData.StrategistName,
                                                          documentData.LastReallocationDT.HasValue ? documentData.LastReallocationDT.Value.ToString("MM/dd/yyyy") : DateTime.Today.ToString("MM/dd/yyyy"),
                                                          documentData.CustodianId,
                                                          documentData.ProgramId,
                                                          GetModelPortfolioOmnitureParameter(documentData)
                                                          )
                                                      );
                        }
                        Sitecore.Diagnostics.Log.Info(string.Format("Model Portfolio External call result: {0}", oModelSetsResponse.ModelSets.Count()), "");
                    }
                    else
                    {
                        Sitecore.Diagnostics.Log.Info("Model Portfolio External call result: NULL", "");
                    }
                }
                Sitecore.Diagnostics.Log.Info("Model Portfolio Finish External call", "");
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Model Portfolio External call fail", ex, ex);
                return(new List <ModelPortfolioResult>());
            }

            return(oModelPortfolioResult);
        }
Пример #8
0
        private static List<Document> CallEventSearchService(EventsSearchRequest request)
        {
            IServiceRequest client = ServiceRequestFactory.GetProxy(SERVICES.GLOBALSEARCH_SERVICE);
            List<Document> results = new List<Document>();
            EventsSearchResponse response = null;

            try
            {
                response = client.Request<EventsSearchRequest, EventsSearchResponse>(request);
                results = response.Results;
            }
            catch (Exception searchException)
            {
                Sitecore.Diagnostics.Log.Error("Error executing event search request", searchException, typeof(EventHelper));
            }

            return results;
        }
Пример #9
0
        public AgentDetailsResponse GetAgentDetails(string agentId)
        {
            IServiceRequest      proxy;
            AgentDetailsResponse response;
            AgentDetailsRequest  request;

            proxy    = null;
            response = null;
            try
            {
                proxy = ServiceRequestFactory.GetProxy(SERVICES.AUM_SERVICE);

                request        = new AgentDetailsRequest();
                request.Filter = string.Format("(APLID == '{0}')", agentId);

                if (null != proxy)
                {
                    response = proxy.Request <AgentDetailsRequest, AgentDetailsResponse>(request);
                    if (null != response)
                    {
                        if (response.Fault != null)
                        {
                            // log error
                            Sitecore.Diagnostics.Log.Error(response.Fault, this);
                        }
                        else
                        {
                            return(response);
                        }
                    }
                }
                return(null);
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Unable to get Agent " + agentId + "'s data from AUM service", ex, this);
                throw ex;
            }
        }
Пример #10
0
        public MyProfileInformationResponse GetUserInfo(string aplId)
        {
            IServiceRequest              proxy;
            MyProfileInformationRequest  request;
            MyProfileInformationResponse response;

            try
            {
                proxy = ServiceRequestFactory.GetProxy(SERVICES.PREFERENCE_SERVICE);

                request = new MyProfileInformationRequest()
                {
                    UserID = aplId,
                };

                if (null != proxy)
                {
                    response = proxy.Request <MyProfileInformationRequest, MyProfileInformationResponse>(request);
                    if (null != response)
                    {
                        if (response.Fault != null)
                        {
                            // log error
                            Sitecore.Diagnostics.Log.Error(response.Fault, this);
                        }
                        else
                        {
                            return(response);
                        }
                    }
                }
                return(null);
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Unable to get user " + aplId + "'s data from Preference service", ex, this);
                throw ex;
            }
        }
        public static GridTable  GetBDAData()
        {
            GridTable       table = null;
            IServiceRequest oAUMService;

            try
            {
                var currentAuthorization = Authorization.CurrentAuthorization;
                oAUMService = ServiceRequestFactory.GetProxy(SERVICES.AUM_SERVICE);
                if (currentAuthorization.IsOsj)
                {
                    if (currentAuthorization.OsjIds != null && currentAuthorization.OsjIds.Count() > 0)
                    {
                        GFWM.Common.PracticeManagement.Entities.Request.PremierBusinessBuilderRequest request = new GFWM.Common.PracticeManagement.Entities.Request.PremierBusinessBuilderRequest();

                        var response = oAUMService.Request <GFWM.Common.PracticeManagement.Entities.Request.PremierBusinessBuilderRequest, GFWM.Common.PracticeManagement.Entities.Response.PremierBusinessBuilderResponse>(request);
                        if (response != null && response.OsjBda != null)
                        {
                            table = new GridTable();

                            DateTime?dt = response.OsjBda.EligibleAumDate;

                            table.Header = new List <GridCell>()
                            {
                                new GridCell()
                                {
                                    Value = "ID"
                                },
                                new GridCell()
                                {
                                    Value = "Name"
                                },
                                new GridCell()
                                {
                                    Value = dt.HasValue ? string.Format("BDA Eligible AUM (as of {0})", dt.Value.ToString("MM/dd/yy")) : "BDA Eligible AUM"
                                },
                                new GridCell()
                                {
                                    Value = "Available BDA Balance"
                                },
                                new GridCell()
                                {
                                    Value = "Maximum BDA Balance"
                                },
                                new GridCell()
                                {
                                    Value = "Available BDA % of Max"
                                },
                            };

                            var cells = new List <GridCell>()
                            {
                                new GridCell()
                                {
                                    Value = response.OsjBda.OsjId
                                },
                                new GridCell()
                                {
                                    Value = response.OsjBda.FirmName
                                },
                                new GridCell()
                                {
                                    Value = response.OsjBda.EligibleAum.HasValue ? response.OsjBda.EligibleAum.Value.ToString("C0") : "$0"
                                },
                                new GridCell()
                                {
                                    Value = response.OsjBda.AvailableBalance.HasValue ? response.OsjBda.AvailableBalance.Value.ToString("C0") : "$0"
                                },
                                new GridCell()
                                {
                                    Value = response.OsjBda.MaximumBalance.HasValue ? response.OsjBda.MaximumBalance.Value.ToString("C0") : "$0"
                                },
                                new GridCell()
                                {
                                    Value = response.OsjBda.PercentageOfMax.HasValue ? response.OsjBda.PercentageOfMax.Value.ToString("N0") + " %" : "0 %"
                                },
                            };
                            var rows = new List <GridRow>()
                            {
                                new GridRow()
                                {
                                    Cells = cells,
                                }
                            };
                            table.Rows = rows;
                        }
                    }
                }

                return(table);
            }
            catch (Exception ex)
            {
                Sitecore.Diagnostics.Log.Error("Error executing GetBDAData request", ex, typeof(PracticeManagementHelper));
            }

            return(null);
        }