Beispiel #1
0
        public object GetCorrectContactModel(Dictionary <string, string> parameters)
        {
            int loanContactsContactId;

            Int32.TryParse(parameters["LoanContactsContactId"].ToString(), out loanContactsContactId);
            int contactType;

            Int32.TryParse(parameters["CompanyType"].ToString(), out contactType);

            switch (( ContactsTypeEnum )contactType)
            {
            case ContactsTypeEnum.CPA:
                LoanCPAContact loanCPAContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanCPAContact>(contactType, loanContactsContactId) : new LoanCPAContact();
                loanCPAContact = (LoanCPAContact)SetLoanContactFromDictionary(parameters, loanCPAContact);
                return(loanCPAContact);

            case ContactsTypeEnum.DocSigning:
                LoanDocSigningContact loanDocSigningContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanDocSigningContact>(contactType, loanContactsContactId) : new LoanDocSigningContact();
                loanDocSigningContact = ( LoanDocSigningContact )SetLoanContactFromDictionary(parameters, loanDocSigningContact);
                return(loanDocSigningContact);

            case ContactsTypeEnum.Employer:
                LoanEmployerContact loanEmployerContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanEmployerContact>(contactType, loanContactsContactId) : new LoanEmployerContact();
                loanEmployerContact = ( LoanEmployerContact )SetLoanContactFromDictionary(parameters, loanEmployerContact);
                return(loanEmployerContact);

            case ContactsTypeEnum.Escrow:
                LoanEscrowContact loanEscrowContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanEscrowContact>(contactType, loanContactsContactId) : new LoanEscrowContact();
                loanEscrowContact = ( LoanEscrowContact )SetLoanContactFromDictionary(parameters, loanEscrowContact);
                return(loanEscrowContact);

            case ContactsTypeEnum.FloodInsurance:
                LoanFloodInsuranceContact loanFloodInsuranceContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanFloodInsuranceContact>(contactType, loanContactsContactId) : new LoanFloodInsuranceContact();
                loanFloodInsuranceContact = ( LoanFloodInsuranceContact )SetLoanContactFromDictionary(parameters, loanFloodInsuranceContact);
                return(loanFloodInsuranceContact);

            case ContactsTypeEnum.HazardInsurance:
                LoanHazardInsuranceContact loanHazardInsuranceContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanHazardInsuranceContact>(contactType, loanContactsContactId) : new LoanHazardInsuranceContact();
                loanHazardInsuranceContact = ( LoanHazardInsuranceContact )SetLoanContactFromDictionary(parameters, loanHazardInsuranceContact);
                return(loanHazardInsuranceContact);

            case ContactsTypeEnum.HomeWarranty:
                LoanHomeWarrantyContact loanHomeWarrantyContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanHomeWarrantyContact>(contactType, loanContactsContactId) : new LoanHomeWarrantyContact();
                loanHomeWarrantyContact = ( LoanHomeWarrantyContact )SetLoanContactFromDictionary(parameters, loanHomeWarrantyContact);
                return(loanHomeWarrantyContact);

            case ContactsTypeEnum.MortgageInsurance:
                LoanMortgageInsuranceContact loanMortgageInsuranceContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanMortgageInsuranceContact>(contactType, loanContactsContactId) : new LoanMortgageInsuranceContact();
                loanMortgageInsuranceContact = ( LoanMortgageInsuranceContact )SetLoanContactFromDictionary(parameters, loanMortgageInsuranceContact);
                return(loanMortgageInsuranceContact);

            case ContactsTypeEnum.PropertyManagement:
                LoanPropertyManagementContact loanPropertyManagementContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanPropertyManagementContact>(contactType, loanContactsContactId) : new LoanPropertyManagementContact();
                loanPropertyManagementContact = ( LoanPropertyManagementContact )SetLoanContactFromDictionary(parameters, loanPropertyManagementContact);
                return(loanPropertyManagementContact);

            case ContactsTypeEnum.Realtor:
                LoanRealtorContact loanRealtorContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanRealtorContact>(contactType, loanContactsContactId) : new LoanRealtorContact();
                loanRealtorContact         = ( LoanRealtorContact )SetLoanContactFromDictionary(parameters, loanRealtorContact);
                loanRealtorContact.SubType = Int32.Parse(parameters["LoanContactsContactSubType"].ToString());
                return(loanRealtorContact);

            case ContactsTypeEnum.Survey:
                LoanSurveyContact loanSurveyContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanSurveyContact>(contactType, loanContactsContactId) : new LoanSurveyContact();
                loanSurveyContact = ( LoanSurveyContact )SetLoanContactFromDictionary(parameters, loanSurveyContact);
                return(loanSurveyContact);

            case ContactsTypeEnum.Termite:
                LoanTermiteContact loanTermiteContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanTermiteContact>(contactType, loanContactsContactId) : new LoanTermiteContact();
                loanTermiteContact = ( LoanTermiteContact )SetLoanContactFromDictionary(parameters, loanTermiteContact);
                return(loanTermiteContact);

            case ContactsTypeEnum.TitleInsurance:
                LoanTitleInsuranceContact loanTitleInsuranceContact = loanContactsContactId != 0 ? _facade.LoadLoanContact <LoanTitleInsuranceContact>(contactType, loanContactsContactId) : new LoanTitleInsuranceContact();
                loanTitleInsuranceContact = ( LoanTitleInsuranceContact )SetLoanContactFromDictionary(parameters, loanTitleInsuranceContact);
                return(loanTitleInsuranceContact);
            }
            return(null);
        }
Beispiel #2
0
        public BusinessContact GetAndPopulateBusinessContactModel(int contactType, int companyId, int contactId, Guid loanId)
        {
            switch (( ContactsTypeEnum )contactType)
            {
            case ContactsTypeEnum.CPA:
                LoanCPACompany companyModel = _facade.LoadLoanCompany <LoanCPACompany>(contactType, companyId);
                LoanCPAContact contactModel = _facade.LoadLoanContact <LoanCPAContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(companyModel, contactModel, loanId));;

            case ContactsTypeEnum.DocSigning:
                LoanDocSigningCompany loanDocSigningCompany = _facade.LoadLoanCompany <LoanDocSigningCompany>(contactType, companyId);
                LoanDocSigningContact loanDocSigningContact = _facade.LoadLoanContact <LoanDocSigningContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanDocSigningCompany, loanDocSigningContact, loanId));

            case ContactsTypeEnum.Employer:
                LoanEmployerCompany loanEmployerCompany = _facade.LoadLoanCompany <LoanEmployerCompany>(contactType, companyId);
                LoanEmployerContact loanEmployerContact = _facade.LoadLoanContact <LoanEmployerContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanEmployerCompany, loanEmployerContact, loanId));

            case ContactsTypeEnum.Escrow:
                LoanEscrowCompany loanEscrowCompany = _facade.LoadLoanCompany <LoanEscrowCompany>(contactType, companyId);
                LoanEscrowContact loanEscrowContact = _facade.LoadLoanContact <LoanEscrowContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanEscrowCompany, loanEscrowContact, loanId));

            case ContactsTypeEnum.FloodInsurance:
                LoanFloodInsuranceCompany loanFloodInsuranceCompany = _facade.LoadLoanCompany <LoanFloodInsuranceCompany>(contactType, companyId);
                LoanFloodInsuranceContact loanFloodInsuranceContact = _facade.LoadLoanContact <LoanFloodInsuranceContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanFloodInsuranceCompany, loanFloodInsuranceContact, loanId));

            case ContactsTypeEnum.HazardInsurance:
                LoanHazardInsuranceCompany loanHazardInsuranceCompany = _facade.LoadLoanCompany <LoanHazardInsuranceCompany>(contactType, companyId);
                LoanHazardInsuranceContact loanHazardInsuranceContact = _facade.LoadLoanContact <LoanHazardInsuranceContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanHazardInsuranceCompany, loanHazardInsuranceContact, loanId));

            case ContactsTypeEnum.HomeWarranty:
                LoanHomeWarrantyCompany loanHomeWarrantyCompany = _facade.LoadLoanCompany <LoanHomeWarrantyCompany>(contactType, companyId);
                LoanHomeWarrantyContact loanHomeWarrantyContact = _facade.LoadLoanContact <LoanHomeWarrantyContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanHomeWarrantyCompany, loanHomeWarrantyContact, loanId));

            case ContactsTypeEnum.MortgageInsurance:
                LoanMortgageInsuranceCompany loanMortgageInsuranceCompany = _facade.LoadLoanCompany <LoanMortgageInsuranceCompany>(contactType, companyId);
                LoanMortgageInsuranceContact loanMortgageInsuranceContact = _facade.LoadLoanContact <LoanMortgageInsuranceContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanMortgageInsuranceCompany, loanMortgageInsuranceContact, loanId));

            case ContactsTypeEnum.PropertyManagement:
                LoanPropertyManagementCompany loanPropertyManagementCompany = _facade.LoadLoanCompany <LoanPropertyManagementCompany>(contactType, companyId);
                LoanPropertyManagementContact loanPropertyManagementContact = _facade.LoadLoanContact <LoanPropertyManagementContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanPropertyManagementCompany, loanPropertyManagementContact, loanId));

            case ContactsTypeEnum.Realtor:
                LoanRealtorCompany loanRealtorCompany = _facade.LoadLoanCompany <LoanRealtorCompany>(contactType, companyId);
                LoanRealtorContact loanRealtorContact = _facade.LoadLoanContact <LoanRealtorContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanRealtorCompany, loanRealtorContact, loanId));

            case ContactsTypeEnum.Survey:
                LoanSurveyCompany loanSurveyCompany = _facade.LoadLoanCompany <LoanSurveyCompany>(contactType, companyId);
                LoanSurveyContact loanSurveyContact = _facade.LoadLoanContact <LoanSurveyContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanSurveyCompany, loanSurveyContact, loanId));

            case ContactsTypeEnum.Termite:
                LoanTermiteCompany loanTermiteCompany = _facade.LoadLoanCompany <LoanTermiteCompany>(contactType, companyId);
                LoanTermiteContact loanTermiteContact = _facade.LoadLoanContact <LoanTermiteContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanTermiteCompany, loanTermiteContact, loanId));

            case ContactsTypeEnum.TitleInsurance:
                LoanTitleInsuranceCompany loanTitleInsuranceCompany = _facade.LoadLoanCompany <LoanTitleInsuranceCompany>(contactType, companyId);
                LoanTitleInsuranceContact loanTitleInsuranceContact = _facade.LoadLoanContact <LoanTitleInsuranceContact>(contactType, contactId);

                return(PopulateBusinessContactFromLoanContact(loanTitleInsuranceCompany, loanTitleInsuranceContact, loanId));
            }
            return(null);
        }
Beispiel #3
0
        public object CopyGlobalContactToLoanContact(int contactType, int contactId, Guid loanId)
        {
            switch (( SystemAdminContactTypesEnum )contactType)
            {
            case SystemAdminContactTypesEnum.CPA:

                CCPAContact    cCPAContact    = _facade.LoadContactsContact <CCPAContact>(contactType, contactId);
                LoanCPAContact loanCPAContact = new LoanCPAContact();
                loanCPAContact        = ( LoanCPAContact )CopyCContactToLoanContact(cCPAContact, loanCPAContact);
                loanCPAContact.LoanId = loanId;
                return(loanCPAContact);

            case SystemAdminContactTypesEnum.DocSigning:

                CDocSigningContact    cDocSigningContact    = _facade.LoadContactsContact <CDocSigningContact>(contactType, contactId);
                LoanDocSigningContact loanDocSigningContact = new LoanDocSigningContact();
                loanDocSigningContact        = ( LoanDocSigningContact )CopyCContactToLoanContact(cDocSigningContact, loanDocSigningContact);
                loanDocSigningContact.LoanId = loanId;
                return(loanDocSigningContact);

            //case SystemAdminContactTypesEnum.Employer:
            //    CEmployerContact cEmployerContact = _facade.LoadContactsContact<CEmployerContact>( contactType, contactId );
            //    LoanEmployerContact loanEmployerContact = new LoanEmployerContact();
            //    loanEmployerContact = ( LoanEmployerContact )CopyCContactToLoanContact( cEmployerContact, loanEmployerContact );
            //    loanEmployerContact.LoanId = loanId;
            //    loanEmployerContact.EnableIntegrations = cEmployerContact.EnableIntegrations;
            //    loanEmployerContact.ContactURLForReference = cEmployerContact.ContactURLForReference;
            //    loanEmployerContact.HBMId = cEmployerContact.HBMId;
            //    loanEmployerContact.LeadSourceId = cEmployerContact.LeadSourceId;
            //    loanEmployerContact.Description = cEmployerContact.Description;
            //    loanEmployerContact.CRMCampaignId = cEmployerContact.CRMCampaignId;
            //    return loanEmployerContact;
            case SystemAdminContactTypesEnum.Escrow:
                CEscrowContact    cEscrowContact    = _facade.LoadContactsContact <CEscrowContact>(contactType, contactId);
                LoanEscrowContact loanEscrowContact = new LoanEscrowContact();
                loanEscrowContact        = ( LoanEscrowContact )CopyCContactToLoanContact(cEscrowContact, loanEscrowContact);
                loanEscrowContact.LoanId = loanId;
                return(loanEscrowContact);

            case SystemAdminContactTypesEnum.FloodInsurance:
                CFloodInsuranceContact    cFloodInsuranceContact    = _facade.LoadContactsContact <CFloodInsuranceContact>(contactType, contactId);
                LoanFloodInsuranceContact loanFloodInsuranceContact = new LoanFloodInsuranceContact();
                loanFloodInsuranceContact        = ( LoanFloodInsuranceContact )CopyCContactToLoanContact(cFloodInsuranceContact, loanFloodInsuranceContact);
                loanFloodInsuranceContact.LoanId = loanId;
                return(loanFloodInsuranceContact);

            case SystemAdminContactTypesEnum.HazardInsurance:
                CHazardInsuranceContact    cHazardInsuranceContact    = _facade.LoadContactsContact <CHazardInsuranceContact>(contactType, contactId);
                LoanHazardInsuranceContact loanHazardInsuranceContact = new LoanHazardInsuranceContact();
                loanHazardInsuranceContact        = ( LoanHazardInsuranceContact )CopyCContactToLoanContact(cHazardInsuranceContact, loanHazardInsuranceContact);
                loanHazardInsuranceContact.LoanId = loanId;
                return(loanHazardInsuranceContact);

            case SystemAdminContactTypesEnum.HomeWarranty:
                CHomeWarrantyContact    cHomeWarrantyContact    = _facade.LoadContactsContact <CHomeWarrantyContact>(contactType, contactId);
                LoanHomeWarrantyContact loanHomeWarrantyContact = new LoanHomeWarrantyContact();
                loanHomeWarrantyContact        = ( LoanHomeWarrantyContact )CopyCContactToLoanContact(cHomeWarrantyContact, loanHomeWarrantyContact);
                loanHomeWarrantyContact.LoanId = loanId;
                return(loanHomeWarrantyContact);

            case SystemAdminContactTypesEnum.MortgageInsurance:
                CMortgageInsuranceContact    cMortgageInsuranceContact    = _facade.LoadContactsContact <CMortgageInsuranceContact>(contactType, contactId);
                LoanMortgageInsuranceContact loanMortgageInsuranceContact = new LoanMortgageInsuranceContact();
                loanMortgageInsuranceContact        = ( LoanMortgageInsuranceContact )CopyCContactToLoanContact(cMortgageInsuranceContact, loanMortgageInsuranceContact);
                loanMortgageInsuranceContact.LoanId = loanId;
                return(loanMortgageInsuranceContact);

            case SystemAdminContactTypesEnum.PropertyManagement:
                CPropertyManagementContact    cPropertyManagementContact    = _facade.LoadContactsContact <CPropertyManagementContact>(contactType, contactId);
                LoanPropertyManagementContact loanPropertyManagementContact = new LoanPropertyManagementContact();
                loanPropertyManagementContact        = ( LoanPropertyManagementContact )CopyCContactToLoanContact(cPropertyManagementContact, loanPropertyManagementContact);
                loanPropertyManagementContact.LoanId = loanId;
                return(loanPropertyManagementContact);

            case SystemAdminContactTypesEnum.Realtor:
                CRealtorContact    cRealtorContact    = _facade.LoadContactsContact <CRealtorContact>(contactType, contactId);
                LoanRealtorContact loanRealtorContact = new LoanRealtorContact();
                loanRealtorContact                        = ( LoanRealtorContact )CopyCContactToLoanContact(cRealtorContact, loanRealtorContact);
                loanRealtorContact.LoanId                 = loanId;
                loanRealtorContact.EnableIntegrations     = cRealtorContact.EnableIntegrations;
                loanRealtorContact.ContactURLForReference = cRealtorContact.ContactURLForReference;
                loanRealtorContact.HBMId                  = cRealtorContact.HBMId;
                loanRealtorContact.LeadSourceId           = cRealtorContact.LeadSourceId;
                loanRealtorContact.Description            = cRealtorContact.Description;
                loanRealtorContact.CRMCampaignId          = cRealtorContact.CRMCampaignId;
                loanRealtorContact.RealtorLicenseNumber   = cRealtorContact.RealtorLicenseNumber;
                return(loanRealtorContact);

            case SystemAdminContactTypesEnum.Survey:
                CSurveyContact    cSurveyContact    = _facade.LoadContactsContact <CSurveyContact>(contactType, contactId);
                LoanSurveyContact loanSurveyContact = new LoanSurveyContact();
                loanSurveyContact        = ( LoanSurveyContact )CopyCContactToLoanContact(cSurveyContact, loanSurveyContact);
                loanSurveyContact.LoanId = loanId;
                return(loanSurveyContact);

            case SystemAdminContactTypesEnum.Termite:
                CTermiteContact    cTermiteContact    = _facade.LoadContactsContact <CTermiteContact>(contactType, contactId);
                LoanTermiteContact loanTermiteContact = new LoanTermiteContact();
                loanTermiteContact        = ( LoanTermiteContact )CopyCContactToLoanContact(cTermiteContact, loanTermiteContact);
                loanTermiteContact.LoanId = loanId;
                return(loanTermiteContact);

            case SystemAdminContactTypesEnum.TitleInsurance:
                CTitleInsuranceContact    cTitleInsuranceContact    = _facade.LoadContactsContact <CTitleInsuranceContact>(contactType, contactId);
                LoanTitleInsuranceContact loanTitleInsuranceContact = new LoanTitleInsuranceContact();
                loanTitleInsuranceContact        = ( LoanTitleInsuranceContact )CopyCContactToLoanContact(cTitleInsuranceContact, loanTitleInsuranceContact);
                loanTitleInsuranceContact.LoanId = loanId;
                return(loanTitleInsuranceContact);
            }
            return(null);
        }