public void SetBranding(UserAccount currentUser) { if (currentUser != null) { BrandingConfiguration brandingConfiguration = CompanyProfileServiceFacade.RetrieveBrandingConfigurationByHierarchy(new BrandingConfigurationHierarchy() { BranchId = currentUser.BranchId, ChannelId = currentUser.ChannelId, DivisionId = currentUser.DivisionId }); if (brandingConfiguration != null) { HttpContext.Current.Session[SessionHelper.BrandName] = brandingConfiguration.DisplayName; HttpContext.Current.Session[SessionHelper.StyleSheetTheme] = brandingConfiguration.Theme; HttpContext.Current.Session[SessionHelper.BrandNameShort] = brandingConfiguration.NameShort; HttpContext.Current.Session[SessionHelper.BrandNameDomain] = brandingConfiguration.Url; HttpContext.Current.Session[SessionHelper.BrandPhone] = brandingConfiguration.Phone; HttpContext.Current.Session[SessionHelper.CompanyCopyrightName] = brandingConfiguration.CopyrightName; HttpContext.Current.Session[SessionHelper.CompanyProfileId] = brandingConfiguration.CompanyProfileId; HttpContext.Current.Session[SessionHelper.BrandingConfiguration] = brandingConfiguration; HttpContext.Current.Session[SessionHelper.BrandNameCssFile] = brandingConfiguration.BrandNameCssFile; HttpContext.Current.Session[SessionHelper.BrandingConfiguration] = brandingConfiguration; } } }
private void LoadCompanies(AssignLoanInfoViewModel assignLoanInfoViewModel) { if (assignLoanInfoViewModel.Companies != null) { assignLoanInfoViewModel.Companies.Clear(); } else { assignLoanInfoViewModel.Companies = new List <DropDownItem>(); } if (!assignLoanInfoViewModel.Companies.Any(c => c.Text.Equals(ViewAllItem.Text))) { assignLoanInfoViewModel.Companies.Add(ViewAllItem); } if (!assignLoanInfoViewModel.Channels.Any(ch => ch.Text.Equals(ViewAllItem.Text))) { assignLoanInfoViewModel.Channels.Add(ViewAllItem); } if (!assignLoanInfoViewModel.Divisions.Any(d => d.Text.Equals(ViewAllItem.Text))) { assignLoanInfoViewModel.Divisions.Add(ViewAllItem); } if (!assignLoanInfoViewModel.Branches.Any(b => b.Text.Equals(ViewAllItem.Text))) { assignLoanInfoViewModel.Branches.Add(ViewAllItem); } // for administrator role, we need to fetch all companies from the system var companies = MML.Web.Facade.UserAccountServiceFacade.GetAllCompanies(); if (companies == null) { return; } DropDownItem item = null; foreach (Company c in companies.OrderBy(c => c.Name)) { item = new DropDownItem(); item.Value = c.CompanyId.ToString(); item.Text = c.Name; assignLoanInfoViewModel.Companies.Add(item); } if (assignLoanInfoViewModel.CompanyId == null || assignLoanInfoViewModel.CompanyId == "-1" || assignLoanInfoViewModel.CompanyId == "0" || assignLoanInfoViewModel.CompanyId == Guid.Empty.ToString()) { CompanyProfile companyProfile = CompanyProfileServiceFacade.RetrieveCompanyProfile(); if (companyProfile != null) { assignLoanInfoViewModel.CompanyId = companyProfile.CompanyProfileId.ToString(); } } }
public static string GetChannelBorrowerSiteURL(int loId) { var channel = CompanyProfileServiceFacade.GetChannelByChannelId(-1, loId); if (channel != null && !string.IsNullOrEmpty(channel.BorrowerSiteURL)) { return(channel.BorrowerSiteURL); } return(ConfigurationManager.AppSettings["BorrowerUrl"]); }
public static void SetCdnSettingInSession() { var keyList = new[] { SessionHelper.LoanCenterImagesStaticContentServerUrl, SessionHelper.LoanCenterCssStaticContentServerUrl, SessionHelper.LoanCenterJavascriptStaticContentServerUrl }; var isSettingsInSession = true; foreach (var key in keyList) { if (HttpContext.Current.Session[key] == null) { isSettingsInSession = false; break; } } if (isSettingsInSession) { return; } var cdnSettings = CompanyProfileServiceFacade.RetrieveCdnSetting(CdnType.LoanCenter); var version = AssemblyHelper.GetAssemblyVersion(); if (cdnSettings != null) { foreach (var key in keyList) { if (!String.IsNullOrEmpty(key)) { var url = cdnSettings.FirstOrDefault(c => c.ServerUrlType == key); if (url != null && !String.IsNullOrEmpty(url.ServerUrl)) { HttpContext.Current.Session[key] = url.ServerUrl.Replace("##path&&version##", String.Format("LoanCenter/{0}/", version)); } } } } }
public ActionResult RetrieveSmartGfeData(ManageFeesViewModel model) { ModelState.Clear(); var loan = LoanServiceFacade.RetrieveLoan(model.TitleAndEscrow.LoanId, false, model.TitleAndEscrow.UserAccountId); var costGroupNumber11 = model.TitleAndEscrow.CostGroups.First(c => c.CostGroupNumber == 11); var costGroupNumber12 = model.TitleAndEscrow.CostGroups.First(c => c.CostGroupNumber == 12); var closingCostRequestId = IntegrationLogServiceFacade.GetClosingCorpXmlForLoanId(model.TitleAndEscrow.LoanId, model.TitleAndEscrow.UserAccountId); var defaultCostCalculation = new DefaultCostCalculation() { LoanId = model.TitleAndEscrow.LoanId, ClosingCostRequestId = closingCostRequestId, FeeProvider = model.TitleAndEscrow.FeeProvider, MortgageType = loan.MortgageType, PropertyValue = loan.SubjectProperty.CurrentEstimatedValue.HasValue ? ( decimal )loan.SubjectProperty.CurrentEstimatedValue : 0, LoanAmount = ( decimal )loan.BaseLoanAmount, StateName = loan.SubjectProperty.Address == null ? null : loan.SubjectProperty.Address.StateName, PropertyType = loan.SubjectProperty.PropertyType, InvestorName = loan.InvestorName, CompanyProfile = CompanyProfileServiceFacade.RetrieveCompanyProfile(), LoanTransactionTypeId = loan.LoanType }; costGroupNumber11 = CostServiceFacade.RetrieveCostFromSmartGfe(defaultCostCalculation, model.TitleAndEscrow.UserAccountId, costGroupNumber11); costGroupNumber12 = CostServiceFacade.RetrieveCostFromSmartGfe(defaultCostCalculation, model.TitleAndEscrow.UserAccountId, costGroupNumber12); ManageFeesHelper.PreselectDefaultCosts(costGroupNumber11); ManageFeesHelper.PreselectDefaultCosts(costGroupNumber12); var group1100Index = model.TitleAndEscrow.CostGroups.FindIndex(g => g.CostGroupNumber == 11); model.TitleAndEscrow.CostGroups.RemoveAt(group1100Index); model.TitleAndEscrow.CostGroups.Insert(group1100Index, costGroupNumber11); var group1200Index = model.TitleAndEscrow.CostGroups.FindIndex(g => g.CostGroupNumber == 12); model.TitleAndEscrow.CostGroups.RemoveAt(group1200Index); model.TitleAndEscrow.CostGroups.Insert(group1200Index, costGroupNumber12); var itemize = GeneralSettingsServiceFacade.RetrieveStatusByGeneralSettingsName("Itemize Lender Credit", Guid.Empty, 0); LoanHelper.PerformPTCCalculationsForTitleEscrow(model.TitleAndEscrow.CostGroups, itemize); ManageFeesHelper.PopulateComboBoxes(model); ManageFeesHelper.SetTitleAndEscrowModel(model); return(PartialView("Commands/ManageFees/_manageFeeSmartGfeSection", model)); }
protected void Application_PreRequestHandlerExecute(object sender, EventArgs e) { try { if (Context.Handler is IRequiresSessionState) { if (Session[SessionHelper.BrandName] == null || Session[SessionHelper.StyleSheetTheme] == null || Session[SessionHelper.BrandNameShort] == null || Session[SessionHelper.BrandNameDomain] == null || Session[SessionHelper.BrandPhone] == null || Session[SessionHelper.CompanyCopyrightName] == null || Session[SessionHelper.CompanyProfileId] == null) { BrandingConfiguration brandingConfiguration = CompanyProfileServiceFacade.RetrieveBrandingConfiguration(StringHelper.FixUrl(Context.Request.Url.Host)); if (brandingConfiguration != null) { Session[SessionHelper.BrandName] = brandingConfiguration.DisplayName; Session[SessionHelper.StyleSheetTheme] = brandingConfiguration.Theme; Session[SessionHelper.BrandNameShort] = brandingConfiguration.NameShort; Session[SessionHelper.BrandNameDomain] = brandingConfiguration.Url; Session[SessionHelper.BrandPhone] = brandingConfiguration.Phone; Session[SessionHelper.CompanyCopyrightName] = brandingConfiguration.CopyrightName; Session[SessionHelper.CompanyProfileId] = brandingConfiguration.CompanyProfileId; Session[SessionHelper.BrandingConfiguration] = brandingConfiguration; Session[SessionHelper.BrandNameCssFile] = brandingConfiguration.BrandNameCssFile; Session[SessionHelper.BrandingConfiguration] = brandingConfiguration; } } } // CDNHelper.SetCdnSettingInSession(); BundleConfig.RegisterBundles(BundleTable.Bundles); } catch (Exception ex) { TraceHelper.Error(TraceCategory.Global, "Error occurred in Global.asax.cs - Application_PreRequestHandlerExecute()!", ex, Guid.Empty, -1); } }
private void LoadDisclosureSummary(AppraisalViewModel userAppraisalViewModel, Guid loanId, UserAccount user) { DisclosuresSummaryInfo disclosuresSummaryInfo = DocumentsServiceFacade.RetrieveDisclosuresSummaryInfo(loanId, user.UserAccountId); userAppraisalViewModel.DisclosuresSummaryInfo = disclosuresSummaryInfo; var channel = CompanyProfileServiceFacade.GetChannelByChannelId(userAppraisalViewModel.Loan.ChannelId); var activateOrderAppraisal = false; if (channel != null && channel.ActivateOrderAppraisalSettings != null) { switch (channel.ActivateOrderAppraisalSettings.DisclosuresESignTriggerType) { case (int)OrderAppraisalTriggerEnum.FirstIntentToProceed: IntegrationsSettings integrationSettings = LoanServiceFacade.RetrieveIntegrationsSettings(user.UserAccountId); activateOrderAppraisal = (disclosuresSummaryInfo.IntentToProceedReceivedBorrower != null && disclosuresSummaryInfo.IntentToProceedReceivedCoBorrower != null) || (disclosuresSummaryInfo.IntentToProceedReceivedBorrower != null && integrationSettings != null && !integrationSettings.AllBorrowersMustESign); break; case (int)OrderAppraisalTriggerEnum.LastIntentToProceed: activateOrderAppraisal = DocumentsServiceFacade.CheckItpSetForAllLoanApplications(loanId, user.UserAccountId); break; case (int)OrderAppraisalTriggerEnum.GFEandDisclosureActivity: var activity = ActivitiesServiceFacade.RetrieveActivity(loanId, ActivityType.ReviewDisclosures, user.UserAccountId); activateOrderAppraisal = channel.ActivateOrderAppraisalSettings.DisclosuresESignStatus == (int)ActivityStatus.Completed || channel.ActivateOrderAppraisalSettings.DisclosuresESignStatus == (int)ActivityStatus.Submitted; if (((int)activity.Status == channel.ActivateOrderAppraisalSettings.DisclosuresESignStatus && channel.ActivateOrderAppraisalSettings.DisclosuresESignStatus == (int)ActivityStatus.Submitted) || activity.Status == ActivityStatus.Completed) { activateOrderAppraisal = true; } break; } } userAppraisalViewModel.IsAppraisalDisabled = !activateOrderAppraisal; }
private void LoadCompanies(FilterViewModel userFilterViewModel) { userFilterViewModel.Companies.Clear(); if (!userFilterViewModel.Companies.Any(c => c.Text.Equals(base.ViewAllItemGuid.Text))) { userFilterViewModel.Companies.Add(base.ViewAllItemGuid); } if (!userFilterViewModel.Channels.Any(ch => ch.Text.Equals(base.ViewAllItem.Text))) { userFilterViewModel.Channels.Add(base.ViewAllItem); } if (!userFilterViewModel.Divisions.Any(d => d.Text.Equals(base.ViewAllItem.Text))) { userFilterViewModel.Divisions.Add(base.ViewAllItem); } if (!userFilterViewModel.Branches.Any(b => b.Text.Equals(base.ViewAllItemGuid.Text))) { userFilterViewModel.Branches.Add(base.ViewAllItemGuid); } if (!userFilterViewModel.Users.Any(u => u.Text.Equals(base.ViewAllItem.Text))) { userFilterViewModel.Users.Add(base.ViewAllItem); } // for administrator role, we need to fetch all companies from the system var companies = MML.Web.Facade.UserAccountServiceFacade.GetAllCompanies(); if (companies == null) { return; } foreach (Company c in companies.OrderBy(c => c.Name)) { userFilterViewModel.Companies.Add(new SelectListItem() { Text = c.Name, Value = c.CompanyId.ToString(), Selected = (HttpContext.Session[SessionHelper.CompanyProfileId] != null && c.CompanyId.Equals(( Guid )HttpContext.Session[SessionHelper.CompanyProfileId])) }); } if (userFilterViewModel.CompanyId == null || userFilterViewModel.CompanyId == Guid.Empty) { CompanyProfile companyProfile = CompanyProfileServiceFacade.RetrieveCompanyProfile(); if (companyProfile != null) { userFilterViewModel.CompanyId = companyProfile.CompanyProfileId; } } var resultChannels = UserAccountServiceFacade.GetChannels(userFilterViewModel.CompanyId); if (resultChannels != null) { foreach (Channel channel in resultChannels.OrderBy(r => r.Name)) { userFilterViewModel.Channels.Add(new SelectListItem() { Text = channel.Name, Value = channel.ChannelId.ToString(), Selected = false }); } } }
private GetStarted StartNewProspect() { var user = AccountHelper.GetUserAccount(HttpContext); Int32 callCenterId = 0; if (user.Roles != null && user.Roles.OrderByDescending(r => r.RolePriority).FirstOrDefault() != null) { if (user.Roles.OrderByDescending(r => r.RolePriority).FirstOrDefault().RoleName.Equals(RoleName.LoanProcessor)) { callCenterId = user.UserAccountId; } } string message; Int32 createdUserAccountId; // Create account string username = "******" + DateTime.Now.ToString("MMddyyyyHmmss") + "@meandmyloan.com"; var newUserAccount = new UserAccount() { Username = username, DateCreated = DateTime.Now, IsActivated = false, IsLocked = false, IsTemporary = false, Password = String.Empty, PasswordHint = String.Empty, SecurityAnswer = String.Empty, SecurityQuestionId = 1, OpenedByLOorConcierge = true, CreationStatus = UserAccountCreationStatus.SystemGenerated, IsOnlineUser = true, // by default we create online user, this will be changed on CreateAccountLO page Party = new Party() { FirstName = "new", LastName = "prospect", SSN = "000-00-0000 ", MiddleName = String.Empty, CompanyName = String.Empty, EmailAddress = String.Empty, AlternateEmailAddress = String.Empty }, }; var hierarchy = new BrandingConfigurationHierarchy() { BranchId = user.BranchId == Guid.Empty ? null : ( Guid? )user.BranchId, ChannelId = user.ChannelId == 0 ? null : ( int? )user.ChannelId, DivisionId = user.DivisionId == 0 ? null : ( int? )user.DivisionId }; var brandingConfiguration = CompanyProfileServiceFacade.RetrieveBrandingConfigurationByHierarchy(hierarchy); if (UserAccountServiceFacade.CreateUserAccount(newUserAccount, false, out message, out createdUserAccountId, brandingConfiguration, createdByUserId: user.UserAccountId) == false) { throw new ApplicationException("Error creating new user account"); } if (createdUserAccountId < 0) { throw new ApplicationException("Error creating new user account"); } newUserAccount.UserAccountId = createdUserAccountId; // Create Contact var contact = new Contact { FirstName = "new", LastName = "prospect", UserAccount = newUserAccount, LoanId = null, OwnerAccountId = user.UserAccountId, IsInitialLead = true, }; if (brandingConfiguration != null) { contact.CompanyProfileId = brandingConfiguration.CompanyProfileId; contact.ChannelId = brandingConfiguration.ChannelId; contact.DivisionId = brandingConfiguration.DivisionId; contact.BranchId = brandingConfiguration.BranchId; } if (callCenterId != 0) { contact.CallCenterId = callCenterId; } var createdContact = ContactServiceFacade.CreateContact(contact); // Create impersonation token Guid token = MML.Common.Impersonation.ImpersonationToken.GetToken(); bool isInserted = ImpersonationTokenServiceFacade.InsertImpersonationToken(token, Guid.Empty, user.UserAccountId); if (isInserted) { GetStartedHelper getStartedHelper = new GetStartedHelper(); return(getStartedHelper.GetStarted(HttpContext, user, token, username, true, createdContact.ContactId, isTempUser: true)); } return(null); }