private LoanDetailsViewModel GetLoanDetails(Guid loanId, int prospectId, UserAccount user, bool collapseSection)
        {
            var tempDetails = LoanServiceFacade.RetrieveWorkQueueItemDetails(loanId, prospectId, -1);

            LoanDetailsViewModel loanDetails = new LoanDetailsViewModel();

            string emptyField = "-";

            if (tempDetails != null)
            {
                CommonHelper.RetreiveContactDetailsFromWorkQueueItemDetails(tempDetails, loanDetails, user, emptyField);
                CommonHelper.RetreiveLoanDetailsFromWorkQueueItemDetails(tempDetails, loanDetails, user, emptyField);
            }

            loanDetails.TitleInformation = ConciergeWorkQueueServiceFacade.ExecuteSPGetBorrowerData("GetBorrowerData", loanId, user.UserAccountId);

            // var leadSourceInformation = ContactServiceFacade.RetrieveLeadSourceByContactIdAndLoanId( prospectId, loanId, user.UserAccountId );
            //if ( leadSourceInformation != null )
            //    loanDetails.LeadSourceInformation = leadSourceInformation.LeadSourceId + " " + leadSourceInformation.Description;

            LeadSource hearAboutUs = LoanServiceFacade.RetrieveHearAboutUs(loanId);

            if (hearAboutUs != null)
            {
                if (hearAboutUs.AffinityGroup == Contracts.Affiliate.AffinityGroup.PartnersProfiles)
                {
                    if (hearAboutUs.HBMId != null && hearAboutUs.HBMId != Guid.Empty)
                    {
                        loanDetails.HearAboutUs = hearAboutUs.LeadSourceId + " Realtor-HBM";
                    }
                    else
                    {
                        loanDetails.HearAboutUs = hearAboutUs.LeadSourceId + " Realtor";
                    }
                }
                else
                {
                    loanDetails.HearAboutUs = hearAboutUs.LeadSourceId + " " + hearAboutUs.Description;
                }
            }

            //List<BusinessContact> contacts = BusinessContactServiceFacade.RetrieveBusinessContacts( loanId );
            List <BusinessContact> contacts = BusinessContactServiceFacade.RetrieveBusinessContactsAppraisal(loanId);

            loanDetails.Contacts        = GetDisplayInformation(contacts);
            loanDetails.LoanId          = loanId;
            loanDetails.CollapseDetails = collapseSection;

            _httpContext.Session[SessionHelper.CurrentLoanIdForBusinessContact] = loanId;

            if (loanDetails.Contacts.FirstOrDefault(x => x.BusinessContactCategory == BusinessContactCategory.BuyerAgent) != null)
            {
                _httpContext.Session[SessionHelper.CurrentBusinessContactBuyerAgent] = loanDetails.Contacts.FirstOrDefault(x => x.BusinessContactCategory == BusinessContactCategory.BuyerAgent).CompanyName;
            }
            else
            {
                _httpContext.Session[SessionHelper.CurrentBusinessContactBuyerAgent] = String.Empty;
            }

            if (loanDetails.Contacts.FirstOrDefault(x => x.BusinessContactCategory == BusinessContactCategory.SellerAgent) != null)
            {
                _httpContext.Session[SessionHelper.CurrentBusinessContactSellerAgent] = loanDetails.Contacts.FirstOrDefault(x => x.BusinessContactCategory == BusinessContactCategory.SellerAgent).CompanyName;
            }
            else
            {
                _httpContext.Session[SessionHelper.CurrentBusinessContactSellerAgent] = String.Empty;
            }
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("contactType", "-1");
            parameters.Add("activeInactive", "null");
            parameters.Add("searchString", "Search");
            parameters.Add("currentPage", "1");
            parameters.Add("pageSize", "10");
            parameters.Add("requestMultiplePages", "null");
            parameters.Add("getNextPages", "null");
            parameters.Add("hasChildren", "null");
            parameters.Add("loanId", loanId.ToString());

            loanDetails.LoanCompaniesAndContactsModel = ContactHelper.GetLoanCompaniesAndContacts(HttpContext, parameters);

            return(loanDetails);
        }