Exemplo n.º 1
0
        public object GetCorrectCompanyModel(Dictionary <string, string> parameters)
        {
            int loanContactsCompanyId;

            Int32.TryParse(parameters["LoanContactsCompanyId"].ToString(), out loanContactsCompanyId);
            int contactType;

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

            switch (( ContactsTypeEnum )contactType)
            {
            case ContactsTypeEnum.CPA:
                LoanCPACompany loanCPACompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanCPACompany>(contactType, loanContactsCompanyId) : new LoanCPACompany();
                loanCPACompany = ( LoanCPACompany )SetLoanCompanyFromDictionary(parameters, loanCPACompany);
                return(loanCPACompany);

            case ContactsTypeEnum.DocSigning:
                LoanDocSigningCompany loanDocSigningCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanDocSigningCompany>(contactType, loanContactsCompanyId) : new LoanDocSigningCompany();
                loanDocSigningCompany = ( LoanDocSigningCompany )SetLoanCompanyFromDictionary(parameters, loanDocSigningCompany);
                return(loanDocSigningCompany);

            case ContactsTypeEnum.Employer:
                LoanEmployerCompany loanEmployerCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanEmployerCompany>(contactType, loanContactsCompanyId) : new LoanEmployerCompany();
                loanEmployerCompany = ( LoanEmployerCompany )SetLoanCompanyFromDictionary(parameters, loanEmployerCompany);
                return(loanEmployerCompany);

            case ContactsTypeEnum.Escrow:
                LoanEscrowCompany loanEscrowCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanEscrowCompany>(contactType, loanContactsCompanyId) : new LoanEscrowCompany();
                loanEscrowCompany = ( LoanEscrowCompany )SetLoanCompanyFromDictionary(parameters, loanEscrowCompany);
                return(loanEscrowCompany);

            case ContactsTypeEnum.FloodInsurance:
                LoanFloodInsuranceCompany loanFloodInsuranceCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanFloodInsuranceCompany>(contactType, loanContactsCompanyId) : new LoanFloodInsuranceCompany();
                loanFloodInsuranceCompany = ( LoanFloodInsuranceCompany )SetLoanCompanyFromDictionary(parameters, loanFloodInsuranceCompany);
                return(loanFloodInsuranceCompany);

            case ContactsTypeEnum.HazardInsurance:
                LoanHazardInsuranceCompany loanHazardInsuranceCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanHazardInsuranceCompany>(contactType, loanContactsCompanyId) : new LoanHazardInsuranceCompany();
                loanHazardInsuranceCompany = ( LoanHazardInsuranceCompany )SetLoanCompanyFromDictionary(parameters, loanHazardInsuranceCompany);
                return(loanHazardInsuranceCompany);

            case ContactsTypeEnum.HomeWarranty:
                LoanHomeWarrantyCompany loanHomeWarrantyCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanHomeWarrantyCompany>(contactType, loanContactsCompanyId) : new LoanHomeWarrantyCompany();
                loanHomeWarrantyCompany = ( LoanHomeWarrantyCompany )SetLoanCompanyFromDictionary(parameters, loanHomeWarrantyCompany);
                return(loanHomeWarrantyCompany);

            case ContactsTypeEnum.MortgageInsurance:
                LoanMortgageInsuranceCompany loanMortgageInsuranceCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanMortgageInsuranceCompany>(contactType, loanContactsCompanyId) : new LoanMortgageInsuranceCompany();
                loanMortgageInsuranceCompany = ( LoanMortgageInsuranceCompany )SetLoanCompanyFromDictionary(parameters, loanMortgageInsuranceCompany);
                return(loanMortgageInsuranceCompany);

            case ContactsTypeEnum.PropertyManagement:
                LoanPropertyManagementCompany loanPropertyManagementCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanPropertyManagementCompany>(contactType, loanContactsCompanyId) : new LoanPropertyManagementCompany();
                loanPropertyManagementCompany = ( LoanPropertyManagementCompany )SetLoanCompanyFromDictionary(parameters, loanPropertyManagementCompany);
                return(loanPropertyManagementCompany);

            case ContactsTypeEnum.Realtor:
                LoanRealtorCompany loanRealtorCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanRealtorCompany>(contactType, loanContactsCompanyId) : new LoanRealtorCompany();
                loanRealtorCompany = ( LoanRealtorCompany )SetLoanCompanyFromDictionary(parameters, loanRealtorCompany);
                return(loanRealtorCompany);

            case ContactsTypeEnum.Survey:
                LoanSurveyCompany loanSurveyCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanSurveyCompany>(contactType, loanContactsCompanyId) : new LoanSurveyCompany();
                loanSurveyCompany = ( LoanSurveyCompany )SetLoanCompanyFromDictionary(parameters, loanSurveyCompany);
                return(loanSurveyCompany);

            case ContactsTypeEnum.Termite:
                LoanTermiteCompany loanTermiteCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanTermiteCompany>(contactType, loanContactsCompanyId) : new LoanTermiteCompany();
                loanTermiteCompany = ( LoanTermiteCompany )SetLoanCompanyFromDictionary(parameters, loanTermiteCompany);
                return(loanTermiteCompany);

            case ContactsTypeEnum.TitleInsurance:
                LoanTitleInsuranceCompany loanTitleInsuranceCompany = loanContactsCompanyId != 0 ? _facade.LoadLoanCompany <LoanTitleInsuranceCompany>(contactType, loanContactsCompanyId) : new LoanTitleInsuranceCompany();
                loanTitleInsuranceCompany = ( LoanTitleInsuranceCompany )SetLoanCompanyFromDictionary(parameters, loanTitleInsuranceCompany);
                return(loanTitleInsuranceCompany);
            }
            return(null);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        public object CopyGlobalCompanyToLoanCompany(int contactType, int companyId, Guid loanId)
        {
            switch (( SystemAdminContactTypesEnum )contactType)
            {
            case SystemAdminContactTypesEnum.CPA:

                CCPACompany    cCPACompany    = _facade.LoadContactsCompany <CCPACompany>(contactType, companyId);
                LoanCPACompany loanCPACompany = new LoanCPACompany();
                loanCPACompany        = (LoanCPACompany)CopyCCompanyToLoanCompany(cCPACompany, loanCPACompany);
                loanCPACompany.LoanId = loanId;
                return(loanCPACompany);

            case SystemAdminContactTypesEnum.DocSigning:
                CDocSigningCompany    cDocSigningCompany    = _facade.LoadContactsCompany <CDocSigningCompany>(contactType, companyId);
                LoanDocSigningCompany loanDocSigningCompany = new LoanDocSigningCompany();
                loanDocSigningCompany        = ( LoanDocSigningCompany )CopyCCompanyToLoanCompany(cDocSigningCompany, loanDocSigningCompany);
                loanDocSigningCompany.LoanId = loanId;
                return(loanDocSigningCompany);

            //case SystemAdminContactTypesEnum.Employer:

            //    CEmployerCompany cEmployerCompany = _facade.LoadContactsCompany<CEmployerCompany>( contactType, companyId );
            //    LoanEmployerCompany loanEmployerCompany = new LoanEmployerCompany();
            //    loanEmployerCompany = ( LoanEmployerCompany )CopyCCompanyToLoanCompany( cEmployerCompany, loanEmployerCompany );
            //    loanEmployerCompany.LoanId = loanId;
            //    return loanEmployerCompany;
            case SystemAdminContactTypesEnum.Escrow:
                CEscrowCompany    cEscrowCompany    = _facade.LoadContactsCompany <CEscrowCompany>(contactType, companyId);
                LoanEscrowCompany loanEscrowCompany = new LoanEscrowCompany();
                loanEscrowCompany                  = ( LoanEscrowCompany )CopyCCompanyToLoanCompany(cEscrowCompany, loanEscrowCompany);
                loanEscrowCompany.LoanId           = loanId;
                loanEscrowCompany.RealECProviderId = cEscrowCompany.RealECProviderId;
                loanEscrowCompany.ABANumber        = cEscrowCompany.ABANumber;
                loanEscrowCompany.RoutingNumber    = cEscrowCompany.RoutingNumber;
                return(loanEscrowCompany);

            case SystemAdminContactTypesEnum.FloodInsurance:
                CFloodInsuranceCompany    cFloodInsuranceCompany    = _facade.LoadContactsCompany <CFloodInsuranceCompany>(contactType, companyId);
                LoanFloodInsuranceCompany loanFloodInsuranceCompany = new LoanFloodInsuranceCompany();
                loanFloodInsuranceCompany        = ( LoanFloodInsuranceCompany )CopyCCompanyToLoanCompany(cFloodInsuranceCompany, loanFloodInsuranceCompany);
                loanFloodInsuranceCompany.LoanId = loanId;
                return(loanFloodInsuranceCompany);

            case SystemAdminContactTypesEnum.HazardInsurance:
                CHazardInsuranceCompany    cHazardInsuranceCompany    = _facade.LoadContactsCompany <CHazardInsuranceCompany>(contactType, companyId);
                LoanHazardInsuranceCompany loanHazardInsuranceCompany = new LoanHazardInsuranceCompany();
                loanHazardInsuranceCompany        = ( LoanHazardInsuranceCompany )CopyCCompanyToLoanCompany(cHazardInsuranceCompany, loanHazardInsuranceCompany);
                loanHazardInsuranceCompany.LoanId = loanId;
                return(loanHazardInsuranceCompany);

            case SystemAdminContactTypesEnum.HomeWarranty:
                CHomeWarrantyCompany    cHomeWarrantyCompany    = _facade.LoadContactsCompany <CHomeWarrantyCompany>(contactType, companyId);
                LoanHomeWarrantyCompany loanHomeWarrantyCompany = new LoanHomeWarrantyCompany();
                loanHomeWarrantyCompany        = ( LoanHomeWarrantyCompany )CopyCCompanyToLoanCompany(cHomeWarrantyCompany, loanHomeWarrantyCompany);
                loanHomeWarrantyCompany.LoanId = loanId;
                return(loanHomeWarrantyCompany);

            case SystemAdminContactTypesEnum.MortgageInsurance:
                CMortgageInsuranceCompany    cMortgageInsuranceCompany    = _facade.LoadContactsCompany <CMortgageInsuranceCompany>(contactType, companyId);
                LoanMortgageInsuranceCompany loanMortgageInsuranceCompany = new LoanMortgageInsuranceCompany();
                loanMortgageInsuranceCompany        = ( LoanMortgageInsuranceCompany )CopyCCompanyToLoanCompany(cMortgageInsuranceCompany, loanMortgageInsuranceCompany);
                loanMortgageInsuranceCompany.LoanId = loanId;
                return(loanMortgageInsuranceCompany);

            case SystemAdminContactTypesEnum.PropertyManagement:
                CPropertyManagementCompany    cPropertyManagementCompany    = _facade.LoadContactsCompany <CPropertyManagementCompany>(contactType, companyId);
                LoanPropertyManagementCompany loanPropertyManagementCompany = new LoanPropertyManagementCompany();
                loanPropertyManagementCompany        = ( LoanPropertyManagementCompany )CopyCCompanyToLoanCompany(cPropertyManagementCompany, loanPropertyManagementCompany);
                loanPropertyManagementCompany.LoanId = loanId;
                return(loanPropertyManagementCompany);

            case SystemAdminContactTypesEnum.Realtor:
                CRealtorCompany    cRealtorCompany    = _facade.LoadContactsCompany <CRealtorCompany>(contactType, companyId);
                LoanRealtorCompany loanRealtorCompany = new LoanRealtorCompany();
                loanRealtorCompany        = ( LoanRealtorCompany )CopyCCompanyToLoanCompany(cRealtorCompany, loanRealtorCompany);
                loanRealtorCompany.LoanId = loanId;
                return(loanRealtorCompany);

            case SystemAdminContactTypesEnum.Survey:
                CSurveyCompany    cSurveyCompany    = _facade.LoadContactsCompany <CSurveyCompany>(contactType, companyId);
                LoanSurveyCompany loanSurveyCompany = new LoanSurveyCompany();
                loanSurveyCompany        = ( LoanSurveyCompany )CopyCCompanyToLoanCompany(cSurveyCompany, loanSurveyCompany);
                loanSurveyCompany.LoanId = loanId;
                return(loanSurveyCompany);

            case SystemAdminContactTypesEnum.Termite:
                CTermiteCompany    cTermiteCompany    = _facade.LoadContactsCompany <CTermiteCompany>(contactType, companyId);
                LoanTermiteCompany loanTermiteCompany = new LoanTermiteCompany();
                loanTermiteCompany        = ( LoanTermiteCompany )CopyCCompanyToLoanCompany(cTermiteCompany, loanTermiteCompany);
                loanTermiteCompany.LoanId = loanId;
                return(loanTermiteCompany);

            case SystemAdminContactTypesEnum.TitleInsurance:
                CTitleInsuranceCompany    cTitleInsuranceCompany    = _facade.LoadContactsCompany <CTitleInsuranceCompany>(contactType, companyId);
                LoanTitleInsuranceCompany loanTitleInsuranceCompany = new LoanTitleInsuranceCompany();
                loanTitleInsuranceCompany                  = ( LoanTitleInsuranceCompany )CopyCCompanyToLoanCompany(cTitleInsuranceCompany, loanTitleInsuranceCompany);
                loanTitleInsuranceCompany.LoanId           = loanId;
                loanTitleInsuranceCompany.RealECProviderId = cTitleInsuranceCompany.RealECProviderId;
                loanTitleInsuranceCompany.ABANumber        = cTitleInsuranceCompany.ABANumber;
                loanTitleInsuranceCompany.RoutingNumber    = cTitleInsuranceCompany.RoutingNumber;
                return(loanTitleInsuranceCompany);
            }
            return(null);
        }