public Boolean SaveAssignInfo(AssignLoanInfoViewModel assignLoanInfoViewModel) { UserAccount user = null; if (Session[SessionHelper.UserData] != null) { user = ( UserAccount )Session[SessionHelper.UserData]; } try { var loaId = assignLoanInfoViewModel.LoaId.HasValue ? assignLoanInfoViewModel.LoaId.Value : -1; var conciergeId = assignLoanInfoViewModel.ConciergeId.HasValue ? assignLoanInfoViewModel.ConciergeId.Value : -1; var callCenterId = assignLoanInfoViewModel.CallCenterId.HasValue ? assignLoanInfoViewModel.CallCenterId.Value : -1; Guid companyId = Guid.Empty; if (!String.IsNullOrEmpty(assignLoanInfoViewModel.CompanyId)) { Guid.TryParse(assignLoanInfoViewModel.CompanyId, out companyId); } int loanNumber; bool isLoanNumberAssigned = int.TryParse(assignLoanInfoViewModel.LoanNumber, out loanNumber) && loanNumber > 0; if (user != null && !isLoanNumberAssigned) { string loanNum = LoanServiceFacade.RetrieveLoanNumber(assignLoanInfoViewModel.LoanId, user.UserAccountId); isLoanNumberAssigned = int.TryParse(loanNum, out loanNumber) && loanNumber > 0; } bool isSubmited = LoanServiceFacade.AssignConciergeLoanNumberAndLOA(assignLoanInfoViewModel.LoanId, conciergeId, assignLoanInfoViewModel.LoanNumber, assignLoanInfoViewModel.ConciergeNMLS, companyId, assignLoanInfoViewModel.ChannelId, assignLoanInfoViewModel.DivisionId, assignLoanInfoViewModel.BranchId, assignLoanInfoViewModel.EnableDigitalDocsCall, user.UserAccountId, loaId, callCenterId); if (isSubmited) { int losFolderId = int.Parse(assignLoanInfoViewModel.LosFolder); isSubmited = LoanServiceFacade.UpdateLosFolderId(assignLoanInfoViewModel.LoanId, losFolderId, user.UserAccountId); } if (isSubmited) { isSubmited = ActivitiesServiceFacade.ExecuteActivityRulesConcierge(ActivitiesServiceFacade.RetrieveActivity(assignLoanInfoViewModel.LoanId, ActivityType.CompleteLoanApplication, user.UserAccountId).Id, ActivityStatus.Completed, ActivityMode.None, false, ActionIntent.LoanNoAndConciergeAssigned, user.Party.Id, user.UserAccountId, loanNumberAlreadyAssigned: isLoanNumberAssigned); } return(isSubmited); } catch (Exception exception) { TraceHelper.Error(TraceCategory.Global, "ExportToLOS::LosFolderUpdated", exception, assignLoanInfoViewModel.LoanId, user != null ? user.UserAccountId : -1); return(false); } }