/// <summary>
        /// Fill method for populating a collection by ADDITIONAL_CASE_DATA
        /// </summary>
        public void FillByAdditionalCaseData(TransmittalDataCollection transmittalDataCollection, System.Int64 loanApplicationId)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(TransmittalData.GetConnectionString());


            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(TransmittalData.GetConnectionString(), "gsp_SelectTransmittalDataCollectionByAdditionalCaseData");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // set the parameters
                    sqlparams["@loanApplicationId"].Value = loanApplicationId;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectTransmittalDataCollectionByAdditionalCaseData", sqlparams);


                    // Send the collection and data to the object factory.
                    CreateObjectsFromData(transmittalDataCollection, datareader);


                    // close the connection
                    cnn.Close();
                }


                // nullify the connection
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Fills a single instance with data based on its primary key values.
        /// </summary>
        public virtual void Fill(FHAVABorrower fhavaborrower, System.Int64 borrowerId)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(FHAVABorrower.GetConnectionString());

            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(FHAVABorrower.GetConnectionString(), "gsp_SelectFHAVABorrower");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // set the parameters
                    sqlparams["@borrowerId"].Value = borrowerId;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectFHAVABorrower", sqlparams);


                    if (datareader.Read())
                    {
                        fhavaborrower.SetMembers(ref datareader);
                    }


                    cnn.Close();                     // close the connection
                }


                // nullify the connection var
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Fill method for populating a collection by InterestRateIndex
        /// </summary>
        public void FillByInterestRateIndex(ARMCollection aRMCollection, System.Int16 id)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(ARM.GetConnectionString());


            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(ARM.GetConnectionString(), "gsp_SelectARMCollectionByInterestRateIndex");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // set the parameters
                    sqlparams["@indexType"].Value = id;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectARMCollectionByInterestRateIndex", sqlparams);


                    // Send the collection and data to the object factory.
                    CreateObjectsFromData(aRMCollection, datareader);


                    // close the connection
                    cnn.Close();
                }


                // nullify the connection
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Fill method for populating a collection by FNMCreditReportScoreType
        /// </summary>
        public void FillByFNMCreditReportScoreType(FHAVABorrowers fHAVABorrowers, System.Int16 id)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(FHAVABorrower.GetConnectionString());


            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(FHAVABorrower.GetConnectionString(), "gsp_SelectFHAVABorrowersByFNMCreditReportScoreType");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // set the parameters
                    sqlparams["@fNMCreditReportScoreType"].Value = id;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectFHAVABorrowersByFNMCreditReportScoreType", sqlparams);


                    // Send the collection and data to the object factory.
                    CreateObjectsFromData(fHAVABorrowers, datareader);


                    // close the connection
                    cnn.Close();
                }


                // nullify the connection
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Fill method for populating a collection by BORROWER
        /// </summary>
        public void FillByBorrower(Liabilities liabilities, System.Int64 id)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(Liability.GetConnectionString());


            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(Liability.GetConnectionString(), "gsp_SelectLiabilitiesByBorrower");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // set the parameters
                    sqlparams["@borrowerId"].Value = id;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectLiabilitiesByBorrower", sqlparams);


                    // Send the collection and data to the object factory.
                    CreateObjectsFromData(liabilities, datareader);


                    // close the connection
                    cnn.Close();
                }


                // nullify the connection
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Fills a single instance with data based on its primary key values.
        /// </summary>
        public virtual void Fill(TransactionDetail transactiondetail, System.Int64 loanApplicationId)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(TransactionDetail.GetConnectionString());

            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(TransactionDetail.GetConnectionString(), "gsp_SelectTransactionDetail");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // set the parameters
                    sqlparams["@loanApplicationId"].Value = loanApplicationId;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectTransactionDetail", sqlparams);


                    if (datareader.Read())
                    {
                        transactiondetail.SetMembers(ref datareader);
                    }


                    cnn.Close();                     // close the connection
                }


                // nullify the connection var
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Fills a single instance with data based on its primary key values.
        /// </summary>
        public virtual void Fill(HMDARaceType hmdart, System.Int16 id)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(HMDARaceType.GetConnectionString());

            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(HMDARaceType.GetConnectionString(), "gsp_SelectHMDARaceType");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // set the parameters
                    sqlparams["@id"].Value = id;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectHMDARaceType", sqlparams);


                    if (datareader.Read())
                    {
                        hmdart.SetMembers(ref datareader);
                    }


                    cnn.Close();                     // close the connection
                }


                // nullify the connection var
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Fill method for populating an entire collection of Borrowers using the selection service GetBySSN
        /// </summary>
        public virtual void GetBySSN(Borrowers borrowers, System.String sSN)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(Borrower.GetConnectionString());


            try
            {
                // discover the sql parameters
                SqlParameterHash sqlparams = SqlHelperParameterCache.GetSpParameterSet(Borrower.GetConnectionString(), "gsp_BorrowersGetBySSN");


                using (cnn)
                {
                    // open the connection
                    cnn.Open();


                    // Start setting the requirement SP parameters
                    sqlparams["@sSN"].Value = sSN;


                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_BorrowersGetBySSN", sqlparams);


                    // Send the collection and data to the object factory
                    CreateObjectsFromData(borrowers, datareader);


                    // close the connection
                    cnn.Close();
                }


                // nullify the connection
                cnn = null;
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(TransactionDetail persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(TransactionDetail.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(TransactionDetail.GetConnectionString(), "gsp_UpdateTransactionDetail");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(TransactionDetail.GetConnectionString(), "gsp_CreateTransactionDetail");
                }


                // Store the parameter for the AlterationsImprovementsAndRepairsAmount attribute.
                if (!persistObject.AlterationsImprovementsAndRepairsAmountIsNull)
                {
                    sqlparams["@alterationsImprovementsAndRepairsAmount"].Value = persistObject.AlterationsImprovementsAndRepairsAmount;
                }
                // Store the parameter for the BorrowerPaidDiscountPointsTotalAmount attribute.
                if (!persistObject.BorrowerPaidDiscountPointsTotalAmountIsNull)
                {
                    sqlparams["@borrowerPaidDiscountPointsTotalAmount"].Value = persistObject.BorrowerPaidDiscountPointsTotalAmount;
                }
                // Store the parameter for the EstimatedClosingCostsAmount attribute.
                if (!persistObject.EstimatedClosingCostsAmountIsNull)
                {
                    sqlparams["@estimatedClosingCostsAmount"].Value = persistObject.EstimatedClosingCostsAmount;
                }
                // Store the parameter for the MIAndFundingFeeFinancedAmount attribute.
                if (!persistObject.MIAndFundingFeeFinancedAmountIsNull)
                {
                    sqlparams["@mIAndFundingFeeFinancedAmount"].Value = persistObject.MIAndFundingFeeFinancedAmount;
                }
                // Store the parameter for the MIAndFundingFeeTotalAmount attribute.
                if (!persistObject.MIAndFundingFeeTotalAmountIsNull)
                {
                    sqlparams["@mIAndFundingFeeTotalAmount"].Value = persistObject.MIAndFundingFeeTotalAmount;
                }
                // Store the parameter for the PrepaidItemsEstimatedAmount attribute.
                if (!persistObject.PrepaidItemsEstimatedAmountIsNull)
                {
                    sqlparams["@prepaidItemsEstimatedAmount"].Value = persistObject.PrepaidItemsEstimatedAmount;
                }
                // Store the parameter for the PurchasePriceAmount attribute.
                if (!persistObject.PurchasePriceAmountIsNull)
                {
                    sqlparams["@purchasePriceAmount"].Value = persistObject.PurchasePriceAmount;
                }
                // Store the parameter for the RefinanceIncludingDebtsToBePaidOffAmount attribute.
                if (!persistObject.RefinanceIncludingDebtsToBePaidOffAmountIsNull)
                {
                    sqlparams["@refinanceIncludingDebtsToBePaidOffAmount"].Value = persistObject.RefinanceIncludingDebtsToBePaidOffAmount;
                }
                // Store the parameter for the SalesConcessionAmount attribute.
                if (!persistObject.SalesConcessionAmountIsNull)
                {
                    sqlparams["@salesConcessionAmount"].Value = persistObject.SalesConcessionAmount;
                }
                // Store the parameter for the SellerPaidClosingCostsAmount attribute.
                if (!persistObject.SellerPaidClosingCostsAmountIsNull)
                {
                    sqlparams["@sellerPaidClosingCostsAmount"].Value = persistObject.SellerPaidClosingCostsAmount;
                }
                // Store the parameter for the SubordinateLienAmount attribute.
                if (!persistObject.SubordinateLienAmountIsNull)
                {
                    sqlparams["@subordinateLienAmount"].Value = persistObject.SubordinateLienAmount;
                }
                // Store the parameter for the SubordinateLienHELOCAmount attribute.
                if (!persistObject.SubordinateLienHELOCAmountIsNull)
                {
                    sqlparams["@subordinateLienHELOCAmount"].Value = persistObject.SubordinateLienHELOCAmount;
                }
                // Store the parameter for the FREReserveAmount attribute.
                if (!persistObject.FREReserveAmountIsNull)
                {
                    sqlparams["@fREReserveAmount"].Value = persistObject.FREReserveAmount;
                }
                // Store the parameter for the FREReservesAmount attribute.
                if (!persistObject.FREReservesAmountIsNull)
                {
                    sqlparams["@fREReservesAmount"].Value = persistObject.FREReservesAmount;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateTransactionDetail", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateTransactionDetail", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateTransactionDetail", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateTransactionDetail", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(ContactPoint persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(ContactPoint.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(ContactPoint.GetConnectionString(), "gsp_UpdateContactPoint");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(ContactPoint.GetConnectionString(), "gsp_CreateContactPoint");
                }


                // Store the parameter for the BorrowerId attribute.
                if (!persistObject.BorrowerIdIsNull)
                {
                    sqlparams["@borrowerId"].Value = persistObject.BorrowerId;
                }
                // Store the parameter for the TypeOtherDescription attribute.
                if (!persistObject.TypeOtherDescriptionIsNull)
                {
                    sqlparams["@typeOtherDescription"].Value = persistObject.TypeOtherDescription;
                }
                // Store the parameter for the Value attribute.
                if (!persistObject.ValueIsNull)
                {
                    sqlparams["@value"].Value = persistObject.Value;
                }
                // Store the parameter for the PreferenceIndicator attribute.
                sqlparams["@preferenceIndicator"].Value = persistObject.PreferenceIndicator;
                // Store the parameter for the RoleType attribute.
                if (!persistObject.RoleTypeIsNull)
                {
                    sqlparams["@roleType"].Value = persistObject.RoleType;
                }
                // Store the parameter for the Type attribute.
                if (!persistObject.TypeIsNull)
                {
                    sqlparams["@type"].Value = persistObject.Type;
                }
                // Store the parameter for the Id attribute.
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                    // Store the parameter for the Id attribute.
                    sqlparams["@id"].Value = persistObject.Id;
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(cnn, CommandType.StoredProcedure, "gsp_CreateContactPoint", sqlparams));
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateContactPoint", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(sqlTrans, CommandType.StoredProcedure, "gsp_CreateContactPoint", sqlparams));
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateContactPoint", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(LoanQualification persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(LoanQualification.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(LoanQualification.GetConnectionString(), "gsp_UpdateLoanQualification");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(LoanQualification.GetConnectionString(), "gsp_CreateLoanQualification");
                }


                // Store the parameter for the AdditionalBorrowerAssetsNotConsideredIndicator attribute.
                sqlparams["@additionalBorrowerAssetsNotConsideredIndicator"].Value = persistObject.AdditionalBorrowerAssetsNotConsideredIndicator;
                // Store the parameter for the AdditionalBorrowerAssetsConsideredIndicator attribute.
                sqlparams["@additionalBorrowerAssetsConsideredIndicator"].Value = persistObject.AdditionalBorrowerAssetsConsideredIndicator;
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateLoanQualification", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateLoanQualification", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateLoanQualification", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateLoanQualification", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(LoanFeatures persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(LoanFeatures.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(LoanFeatures.GetConnectionString(), "gsp_UpdateLoanFeatures");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(LoanFeatures.GetConnectionString(), "gsp_CreateLoanFeatures");
                }


                // Store the parameter for the AssumabilityIndicator attribute.
                sqlparams["@assumabilityIndicator"].Value = persistObject.AssumabilityIndicator;
                // Store the parameter for the BalloonIndicator attribute.
                sqlparams["@balloonIndicator"].Value = persistObject.BalloonIndicator;
                // Store the parameter for the BalloonLoanMaturityTermMonths attribute.
                if (!persistObject.BalloonLoanMaturityTermMonthsIsNull)
                {
                    sqlparams["@balloonLoanMaturityTermMonths"].Value = persistObject.BalloonLoanMaturityTermMonths;
                }
                // Store the parameter for the BuydownTemporarySubsidyIndicator attribute.
                sqlparams["@buydownTemporarySubsidyIndicator"].Value = persistObject.BuydownTemporarySubsidyIndicator;
                // Store the parameter for the CounselingConfirmationIndicator attribute.
                sqlparams["@counselingConfirmationIndicator"].Value = persistObject.CounselingConfirmationIndicator;
                // Store the parameter for the EscrowWaiverIndicator attribute.
                sqlparams["@escrowWaiverIndicator"].Value = persistObject.EscrowWaiverIndicator;
                // Store the parameter for the FREOfferingIdentifier attribute.
                if (!persistObject.FREOfferingIdentifierIsNull)
                {
                    sqlparams["@fREOfferingIdentifier"].Value = persistObject.FREOfferingIdentifier;
                }
                // Store the parameter for the FNMProductPlanIdentifier attribute.
                if (!persistObject.FNMProductPlanIdentifierIsNull)
                {
                    sqlparams["@fNMProductPlanIdentifier"].Value = persistObject.FNMProductPlanIdentifier;
                }
                // Store the parameter for the FNMProductPlanIndentifier attribute.
                if (!persistObject.FNMProductPlanIndentifierIsNull)
                {
                    sqlparams["@fNMProductPlanIndentifier"].Value = persistObject.FNMProductPlanIndentifier;
                }
                // Store the parameter for the HELOCMaximumBalanceAmount attribute.
                if (!persistObject.HELOCMaximumBalanceAmountIsNull)
                {
                    sqlparams["@hELOCMaximumBalanceAmount"].Value = persistObject.HELOCMaximumBalanceAmount;
                }
                // Store the parameter for the HELOCInitialAdvanceAmount attribute.
                if (!persistObject.HELOCInitialAdvanceAmountIsNull)
                {
                    sqlparams["@hELOCInitialAdvanceAmount"].Value = persistObject.HELOCInitialAdvanceAmount;
                }
                // Store the parameter for the InterestOnlyTerm attribute.
                if (!persistObject.InterestOnlyTermIsNull)
                {
                    sqlparams["@interestOnlyTerm"].Value = persistObject.InterestOnlyTerm;
                }
                // Store the parameter for the LenderSelfInsuredIndicator attribute.
                sqlparams["@lenderSelfInsuredIndicator"].Value = persistObject.LenderSelfInsuredIndicator;
                // Store the parameter for the LoanScheduledClosingDate attribute.
                if (!persistObject.LoanScheduledClosingDateIsNull)
                {
                    sqlparams["@loanScheduledClosingDate"].Value = persistObject.LoanScheduledClosingDate;
                }
                // Store the parameter for the MICoveragePercent attribute.
                if (!persistObject.MICoveragePercentIsNull)
                {
                    sqlparams["@mICoveragePercent"].Value = persistObject.MICoveragePercent;
                }
                // Store the parameter for the NegativeAmortizationLimitPercent attribute.
                if (!persistObject.NegativeAmortizationLimitPercentIsNull)
                {
                    sqlparams["@negativeAmortizationLimitPercent"].Value = persistObject.NegativeAmortizationLimitPercent;
                }
                // Store the parameter for the PrepaymentPenaltyIndicator attribute.
                sqlparams["@prepaymentPenaltyIndicator"].Value = persistObject.PrepaymentPenaltyIndicator;
                // Store the parameter for the PrepaymentPenaltyTermMonths attribute.
                if (!persistObject.PrepaymentPenaltyTermMonthsIsNull)
                {
                    sqlparams["@prepaymentPenaltyTermMonths"].Value = persistObject.PrepaymentPenaltyTermMonths;
                }
                // Store the parameter for the PrepaymentRestrictionIndicator attribute.
                sqlparams["@prepaymentRestrictionIndicator"].Value = persistObject.PrepaymentRestrictionIndicator;
                // Store the parameter for the ProductDescription attribute.
                if (!persistObject.ProductDescriptionIsNull)
                {
                    sqlparams["@productDescription"].Value = persistObject.ProductDescription;
                }
                // Store the parameter for the ProductName attribute.
                if (!persistObject.ProductNameIsNull)
                {
                    sqlparams["@productName"].Value = persistObject.ProductName;
                }
                // Store the parameter for the ScheduledFirstPaymentDate attribute.
                if (!persistObject.ScheduledFirstPaymentDateIsNull)
                {
                    sqlparams["@scheduledFirstPaymentDate"].Value = persistObject.ScheduledFirstPaymentDate;
                }
                // Store the parameter for the NameDocumentsDrawnInType attribute.
                if (!persistObject.NameDocumentsDrawnInTypeIsNull)
                {
                    sqlparams["@nameDocumentsDrawnInType"].Value = persistObject.NameDocumentsDrawnInType;
                }
                // Store the parameter for the GSEProjectClassificationType attribute.
                if (!persistObject.GSEProjectClassificationTypeIsNull)
                {
                    sqlparams["@gSEProjectClassificationType"].Value = persistObject.GSEProjectClassificationType;
                }
                // Store the parameter for the GSEPropertyType attribute.
                if (!persistObject.GSEPropertyTypeIsNull)
                {
                    sqlparams["@gSEPropertyType"].Value = persistObject.GSEPropertyType;
                }
                // Store the parameter for the LienPriorityType attribute.
                if (!persistObject.LienPriorityTypeIsNull)
                {
                    sqlparams["@lienPriorityType"].Value = persistObject.LienPriorityType;
                }
                // Store the parameter for the LoanDocumentationType attribute.
                if (!persistObject.LoanDocumentationTypeIsNull)
                {
                    sqlparams["@loanDocumentationType"].Value = persistObject.LoanDocumentationType;
                }
                // Store the parameter for the LoanRepaymentType attribute.
                if (!persistObject.LoanRepaymentTypeIsNull)
                {
                    sqlparams["@loanRepaymentType"].Value = persistObject.LoanRepaymentType;
                }
                // Store the parameter for the MICertificationStatusType attribute.
                if (!persistObject.MICertificationStatusTypeIsNull)
                {
                    sqlparams["@mICertificationStatusType"].Value = persistObject.MICertificationStatusType;
                }
                // Store the parameter for the MICompanyNameType attribute.
                if (!persistObject.MICompanyNameTypeIsNull)
                {
                    sqlparams["@mICompanyNameType"].Value = persistObject.MICompanyNameType;
                }
                // Store the parameter for the PaymentFrequencyType attribute.
                if (!persistObject.PaymentFrequencyTypeIsNull)
                {
                    sqlparams["@paymentFrequencyType"].Value = persistObject.PaymentFrequencyType;
                }
                // Store the parameter for the FullPrepaymentPenaltyOptionType attribute.
                if (!persistObject.FullPrepaymentPenaltyOptionTypeIsNull)
                {
                    sqlparams["@fullPrepaymentPenaltyOptionType"].Value = persistObject.FullPrepaymentPenaltyOptionType;
                }
                // Store the parameter for the LoanClosingStatusType attribute.
                if (!persistObject.LoanClosingStatusTypeIsNull)
                {
                    sqlparams["@loanClosingStatusType"].Value = persistObject.LoanClosingStatusType;
                }
                // Store the parameter for the ServicingTransferStatusType attribute.
                if (!persistObject.ServicingTransferStatusTypeIsNull)
                {
                    sqlparams["@servicingTransferStatusType"].Value = persistObject.ServicingTransferStatusType;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateLoanFeatures", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateLoanFeatures", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateLoanFeatures", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateLoanFeatures", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(Buydown persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(Buydown.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(Buydown.GetConnectionString(), "gsp_UpdateBuydown");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(Buydown.GetConnectionString(), "gsp_CreateBuydown");
                }


                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                // Store the parameter for the ChangeFrequencyMonths attribute.
                if (!persistObject.ChangeFrequencyMonthsIsNull)
                {
                    sqlparams["@changeFrequencyMonths"].Value = persistObject.ChangeFrequencyMonths;
                }
                // Store the parameter for the DurationMonths attribute.
                if (!persistObject.DurationMonthsIsNull)
                {
                    sqlparams["@durationMonths"].Value = persistObject.DurationMonths;
                }
                // Store the parameter for the IncreaseRatePercent attribute.
                if (!persistObject.IncreaseRatePercentIsNull)
                {
                    sqlparams["@increaseRatePercent"].Value = persistObject.IncreaseRatePercent;
                }
                // Store the parameter for the LenderFundingIndicator attribute.
                sqlparams["@lenderFundingIndicator"].Value = persistObject.LenderFundingIndicator;
                // Store the parameter for the PermanentIndicator attribute.
                sqlparams["@permanentIndicator"].Value = persistObject.PermanentIndicator;
                // Store the parameter for the BaseDataType attribute.
                if (!persistObject.BaseDataTypeIsNull)
                {
                    sqlparams["@baseDataType"].Value = persistObject.BaseDataType;
                }
                // Store the parameter for the ContributorType attribute.
                if (!persistObject.ContributorTypeIsNull)
                {
                    sqlparams["@contributorType"].Value = persistObject.ContributorType;
                }
                // Store the parameter for the Id attribute.
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                    // Store the parameter for the Id attribute.
                    sqlparams["@id"].Value = persistObject.Id;
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(cnn, CommandType.StoredProcedure, "gsp_CreateBuydown", sqlparams));
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateBuydown", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(sqlTrans, CommandType.StoredProcedure, "gsp_CreateBuydown", sqlparams));
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateBuydown", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(GovernmentMonitoring persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(GovernmentMonitoring.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(GovernmentMonitoring.GetConnectionString(), "gsp_UpdateGovernmentMonitoring");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(GovernmentMonitoring.GetConnectionString(), "gsp_CreateGovernmentMonitoring");
                }


                // Store the parameter for the GenderType attribute.
                if (!persistObject.GenderTypeIsNull)
                {
                    sqlparams["@genderType"].Value = persistObject.GenderType;
                }
                // Store the parameter for the OtherRaceNationalOriginDescription attribute.
                if (!persistObject.OtherRaceNationalOriginDescriptionIsNull)
                {
                    sqlparams["@otherRaceNationalOriginDescription"].Value = persistObject.OtherRaceNationalOriginDescription;
                }
                // Store the parameter for the RaceNationalOriginRefusalIndicator attribute.
                sqlparams["@raceNationalOriginRefusalIndicator"].Value = persistObject.RaceNationalOriginRefusalIndicator;
                // Store the parameter for the RaceNationalOriginType attribute.
                if (!persistObject.RaceNationalOriginTypeIsNull)
                {
                    sqlparams["@raceNationalOriginType"].Value = persistObject.RaceNationalOriginType;
                }
                // Store the parameter for the HMDAEthnicityType attribute.
                if (!persistObject.HMDAEthnicityTypeIsNull)
                {
                    sqlparams["@hMDAEthnicityType"].Value = persistObject.HMDAEthnicityType;
                }
                // Store the parameter for the BorrowerId attribute.
                sqlparams["@borrowerId"].Value = persistObject.BorrowerId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateGovernmentMonitoring", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateGovernmentMonitoring", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateGovernmentMonitoring", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateGovernmentMonitoring", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(AffordableLending persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(AffordableLending.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(AffordableLending.GetConnectionString(), "gsp_UpdateAffordableLending");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(AffordableLending.GetConnectionString(), "gsp_CreateAffordableLending");
                }


                // Store the parameter for the FNMCommunityLendingProductName attribute.
                if (!persistObject.FNMCommunityLendingProductNameIsNull)
                {
                    sqlparams["@fNMCommunityLendingProductName"].Value = persistObject.FNMCommunityLendingProductName;
                }
                // Store the parameter for the FNMCommunityLendingProductTypeOtherDescription attribute.
                if (!persistObject.FNMCommunityLendingProductTypeOtherDescriptionIsNull)
                {
                    sqlparams["@fNMCommunityLendingProductTypeOtherDescription"].Value = persistObject.FNMCommunityLendingProductTypeOtherDescription;
                }
                // Store the parameter for the FNMCommunitySecondsIndicator attribute.
                sqlparams["@fNMCommunitySecondsIndicator"].Value = persistObject.FNMCommunitySecondsIndicator;
                // Store the parameter for the FNMNeighborsMortgageEligibilityIndicator attribute.
                sqlparams["@fNMNeighborsMortgageEligibilityIndicator"].Value = persistObject.FNMNeighborsMortgageEligibilityIndicator;
                // Store the parameter for the FREAffordableProgramIdentifier attribute.
                if (!persistObject.FREAffordableProgramIdentifierIsNull)
                {
                    sqlparams["@fREAffordableProgramIdentifier"].Value = persistObject.FREAffordableProgramIdentifier;
                }
                // Store the parameter for the HUDIncomeLimitAdjustmentFactor attribute.
                if (!persistObject.HUDIncomeLimitAdjustmentFactorIsNull)
                {
                    sqlparams["@hUDIncomeLimitAdjustmentFactor"].Value = persistObject.HUDIncomeLimitAdjustmentFactor;
                }
                // Store the parameter for the HUDLendingIncomeLimitAmount attribute.
                if (!persistObject.HUDLendingIncomeLimitAmountIsNull)
                {
                    sqlparams["@hUDLendingIncomeLimitAmount"].Value = persistObject.HUDLendingIncomeLimitAmount;
                }
                // Store the parameter for the HUDMedianIncomeAmount attribute.
                if (!persistObject.HUDMedianIncomeAmountIsNull)
                {
                    sqlparams["@hUDMedianIncomeAmount"].Value = persistObject.HUDMedianIncomeAmount;
                }
                // Store the parameter for the MSAIdentifier attribute.
                if (!persistObject.MSAIdentifierIsNull)
                {
                    sqlparams["@mSAIdentifier"].Value = persistObject.MSAIdentifier;
                }
                // Store the parameter for the FNMCommunityLendingProductType attribute.
                if (!persistObject.FNMCommunityLendingProductTypeIsNull)
                {
                    sqlparams["@fNMCommunityLendingProductType"].Value = persistObject.FNMCommunityLendingProductType;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateAffordableLending", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateAffordableLending", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateAffordableLending", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateAffordableLending", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(Borrower persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(Borrower.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(Borrower.GetConnectionString(), "gsp_UpdateBorrower");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(Borrower.GetConnectionString(), "gsp_CreateBorrower");
                }


                // Store the parameter for the JointAssetBorrowerID attribute.
                if (!persistObject.JointAssetBorrowerIDIsNull)
                {
                    sqlparams["@jointAssetBorrowerID"].Value = persistObject.JointAssetBorrowerID;
                }
                // Store the parameter for the LoanApplicationId attribute.
                if (!persistObject.LoanApplicationIdIsNull)
                {
                    sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                }
                // Store the parameter for the FirstName attribute.
                if (!persistObject.FirstNameIsNull)
                {
                    sqlparams["@firstName"].Value = persistObject.FirstName;
                }
                // Store the parameter for the MiddleName attribute.
                if (!persistObject.MiddleNameIsNull)
                {
                    sqlparams["@middleName"].Value = persistObject.MiddleName;
                }
                // Store the parameter for the LastName attribute.
                if (!persistObject.LastNameIsNull)
                {
                    sqlparams["@lastName"].Value = persistObject.LastName;
                }
                // Store the parameter for the NameSuffix attribute.
                if (!persistObject.NameSuffixIsNull)
                {
                    sqlparams["@nameSuffix"].Value = persistObject.NameSuffix;
                }
                // Store the parameter for the AgeAtApplicationYears attribute.
                if (!persistObject.AgeAtApplicationYearsIsNull)
                {
                    sqlparams["@ageAtApplicationYears"].Value = persistObject.AgeAtApplicationYears;
                }
                // Store the parameter for the BirthDate attribute.
                if (!persistObject.BirthDateIsNull)
                {
                    sqlparams["@birthDate"].Value = persistObject.BirthDate;
                }
                // Store the parameter for the ApplicationSignedDate attribute.
                if (!persistObject.ApplicationSignedDateIsNull)
                {
                    sqlparams["@applicationSignedDate"].Value = persistObject.ApplicationSignedDate;
                }
                // Store the parameter for the HomeTelephoneNumber attribute.
                if (!persistObject.HomeTelephoneNumberIsNull)
                {
                    sqlparams["@homeTelephoneNumber"].Value = persistObject.HomeTelephoneNumber;
                }
                // Store the parameter for the SSN attribute.
                if (!persistObject.SSNIsNull)
                {
                    sqlparams["@sSN"].Value = persistObject.SSN;
                }
                // Store the parameter for the DependentCount attribute.
                if (!persistObject.DependentCountIsNull)
                {
                    sqlparams["@dependentCount"].Value = persistObject.DependentCount;
                }
                // Store the parameter for the SchoolingYears attribute.
                if (!persistObject.SchoolingYearsIsNull)
                {
                    sqlparams["@schoolingYears"].Value = persistObject.SchoolingYears;
                }
                // Store the parameter for the CreditReportIdentifier attribute.
                if (!persistObject.CreditReportIdentifierIsNull)
                {
                    sqlparams["@creditReportIdentifier"].Value = persistObject.CreditReportIdentifier;
                }
                // Store the parameter for the MaritalStatusType attribute.
                if (!persistObject.MaritalStatusTypeIsNull)
                {
                    sqlparams["@maritalStatusType"].Value = persistObject.MaritalStatusType;
                }
                // Store the parameter for the PrintPositionType attribute.
                if (!persistObject.PrintPositionTypeIsNull)
                {
                    sqlparams["@printPositionType"].Value = persistObject.PrintPositionType;
                }
                // Store the parameter for the JointAssetLiabilityReportingType attribute.
                if (!persistObject.JointAssetLiabilityReportingTypeIsNull)
                {
                    sqlparams["@jointAssetLiabilityReportingType"].Value = persistObject.JointAssetLiabilityReportingType;
                }
                // Store the parameter for the Id attribute.
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                    // Store the parameter for the Id attribute.
                    sqlparams["@id"].Value = persistObject.Id;
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(cnn, CommandType.StoredProcedure, "gsp_CreateBorrower", sqlparams));
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateBorrower", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(sqlTrans, CommandType.StoredProcedure, "gsp_CreateBorrower", sqlparams));
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateBorrower", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 17
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(Appraiser persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(Appraiser.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(Appraiser.GetConnectionString(), "gsp_UpdateAppraiser");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(Appraiser.GetConnectionString(), "gsp_CreateAppraiser");
                }


                // Store the parameter for the Name attribute.
                if (!persistObject.NameIsNull)
                {
                    sqlparams["@name"].Value = persistObject.Name;
                }
                // Store the parameter for the CompanyName attribute.
                if (!persistObject.CompanyNameIsNull)
                {
                    sqlparams["@companyName"].Value = persistObject.CompanyName;
                }
                // Store the parameter for the LicenseIdentifier attribute.
                if (!persistObject.LicenseIdentifierIsNull)
                {
                    sqlparams["@licenseIdentifier"].Value = persistObject.LicenseIdentifier;
                }
                // Store the parameter for the LicenseState attribute.
                if (!persistObject.LicenseStateIsNull)
                {
                    sqlparams["@licenseState"].Value = persistObject.LicenseState;
                }
                // Store the parameter for the Id attribute.
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                    // Store the parameter for the Id attribute.
                    sqlparams["@id"].Value = persistObject.Id;
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            persistObject._id = Convert.ToInt32(SqlHelper.ExecuteScalar(cnn, CommandType.StoredProcedure, "gsp_CreateAppraiser", sqlparams));
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateAppraiser", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        persistObject._id = Convert.ToInt32(SqlHelper.ExecuteScalar(sqlTrans, CommandType.StoredProcedure, "gsp_CreateAppraiser", sqlparams));
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateAppraiser", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 18
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(FHAVALoan persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(FHAVALoan.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(FHAVALoan.GetConnectionString(), "gsp_UpdateFHAVALoan");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(FHAVALoan.GetConnectionString(), "gsp_CreateFHAVALoan");
                }


                // Store the parameter for the BorrowerPaidFHA_VAClosingCostsAmount attribute.
                if (!persistObject.BorrowerPaidFHA_VAClosingCostsAmountIsNull)
                {
                    sqlparams["@borrowerPaidFHA_VAClosingCostsAmount"].Value = persistObject.BorrowerPaidFHA_VAClosingCostsAmount;
                }
                // Store the parameter for the BorrowerPaidFHA_VAClosingCostsPercent attribute.
                if (!persistObject.BorrowerPaidFHA_VAClosingCostsPercentIsNull)
                {
                    sqlparams["@borrowerPaidFHA_VAClosingCostsPercent"].Value = persistObject.BorrowerPaidFHA_VAClosingCostsPercent;
                }
                // Store the parameter for the GovernmentMortgageCreditCertificateAmount attribute.
                if (!persistObject.GovernmentMortgageCreditCertificateAmountIsNull)
                {
                    sqlparams["@governmentMortgageCreditCertificateAmount"].Value = persistObject.GovernmentMortgageCreditCertificateAmount;
                }
                // Store the parameter for the GovernmentRefinanceType attribute.
                if (!persistObject.GovernmentRefinanceTypeIsNull)
                {
                    sqlparams["@governmentRefinanceType"].Value = persistObject.GovernmentRefinanceType;
                }
                // Store the parameter for the OtherPartyPaidFHA_VAClosingCostsAmount attribute.
                if (!persistObject.OtherPartyPaidFHA_VAClosingCostsAmountIsNull)
                {
                    sqlparams["@otherPartyPaidFHA_VAClosingCostsAmount"].Value = persistObject.OtherPartyPaidFHA_VAClosingCostsAmount;
                }
                // Store the parameter for the OtherPartyPaidFHA_VAClosingCostsPercent attribute.
                if (!persistObject.OtherPartyPaidFHA_VAClosingCostsPercentIsNull)
                {
                    sqlparams["@otherPartyPaidFHA_VAClosingCostsPercent"].Value = persistObject.OtherPartyPaidFHA_VAClosingCostsPercent;
                }
                // Store the parameter for the PropertyEnergyEfficientHomeIndicator attribute.
                if (!persistObject.PropertyEnergyEfficientHomeIndicatorIsNull)
                {
                    sqlparams["@propertyEnergyEfficientHomeIndicator"].Value = persistObject.PropertyEnergyEfficientHomeIndicator;
                }
                // Store the parameter for the SellerPaidFHA_VAClosingCostsPercent attribute.
                if (!persistObject.SellerPaidFHA_VAClosingCostsPercentIsNull)
                {
                    sqlparams["@sellerPaidFHA_VAClosingCostsPercent"].Value = persistObject.SellerPaidFHA_VAClosingCostsPercent;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateFHAVALoan", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateFHAVALoan", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateFHAVALoan", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateFHAVALoan", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(ConstructionRefinanceData persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(ConstructionRefinanceData.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(ConstructionRefinanceData.GetConnectionString(), "gsp_UpdateConstructionRefinanceData");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(ConstructionRefinanceData.GetConnectionString(), "gsp_CreateConstructionRefinanceData");
                }


                // Store the parameter for the ConstructionImprovementCostsAmount attribute.
                if (!persistObject.ConstructionImprovementCostsAmountIsNull)
                {
                    sqlparams["@constructionImprovementCostsAmount"].Value = persistObject.ConstructionImprovementCostsAmount;
                }
                // Store the parameter for the FRECashOutAmount attribute.
                if (!persistObject.FRECashOutAmountIsNull)
                {
                    sqlparams["@fRECashOutAmount"].Value = persistObject.FRECashOutAmount;
                }
                // Store the parameter for the LandEstimatedValueAmount attribute.
                if (!persistObject.LandEstimatedValueAmountIsNull)
                {
                    sqlparams["@landEstimatedValueAmount"].Value = persistObject.LandEstimatedValueAmount;
                }
                // Store the parameter for the LandOriginalCostAmount attribute.
                if (!persistObject.LandOriginalCostAmountIsNull)
                {
                    sqlparams["@landOriginalCostAmount"].Value = persistObject.LandOriginalCostAmount;
                }
                // Store the parameter for the PropertyAcquiredYear attribute.
                if (!persistObject.PropertyAcquiredYearIsNull)
                {
                    sqlparams["@propertyAcquiredYear"].Value = persistObject.PropertyAcquiredYear;
                }
                // Store the parameter for the PropertyExistingLienAmount attribute.
                if (!persistObject.PropertyExistingLienAmountIsNull)
                {
                    sqlparams["@propertyExistingLienAmount"].Value = persistObject.PropertyExistingLienAmount;
                }
                // Store the parameter for the PropertyOriginalCostAmount attribute.
                if (!persistObject.PropertyOriginalCostAmountIsNull)
                {
                    sqlparams["@propertyOriginalCostAmount"].Value = persistObject.PropertyOriginalCostAmount;
                }
                // Store the parameter for the RefinanceImprovementCostsAmount attribute.
                if (!persistObject.RefinanceImprovementCostsAmountIsNull)
                {
                    sqlparams["@refinanceImprovementCostsAmount"].Value = persistObject.RefinanceImprovementCostsAmount;
                }
                // Store the parameter for the RefinanceProposedImprovementsDescription attribute.
                if (!persistObject.RefinanceProposedImprovementsDescriptionIsNull)
                {
                    sqlparams["@refinanceProposedImprovementsDescription"].Value = persistObject.RefinanceProposedImprovementsDescription;
                }
                // Store the parameter for the SecondaryFinancingRefinanceIndicator attribute.
                sqlparams["@secondaryFinancingRefinanceIndicator"].Value = persistObject.SecondaryFinancingRefinanceIndicator;
                // Store the parameter for the FNMSecondMortgageFinancingOriginalPropertyIndicator attribute.
                sqlparams["@fNMSecondMortgageFinancingOriginalPropertyIndicator"].Value = persistObject.FNMSecondMortgageFinancingOriginalPropertyIndicator;
                // Store the parameter for the StructuralAlterationsConventionalAmount attribute.
                if (!persistObject.StructuralAlterationsConventionalAmountIsNull)
                {
                    sqlparams["@structuralAlterationsConventionalAmount"].Value = persistObject.StructuralAlterationsConventionalAmount;
                }
                // Store the parameter for the NonStructuralAlterationsConventionalAmount attribute.
                if (!persistObject.NonStructuralAlterationsConventionalAmountIsNull)
                {
                    sqlparams["@nonStructuralAlterationsConventionalAmount"].Value = persistObject.NonStructuralAlterationsConventionalAmount;
                }
                // Store the parameter for the ConstructionPurposeType attribute.
                if (!persistObject.ConstructionPurposeTypeIsNull)
                {
                    sqlparams["@constructionPurposeType"].Value = persistObject.ConstructionPurposeType;
                }
                // Store the parameter for the RefinanceImprovementsType attribute.
                if (!persistObject.RefinanceImprovementsTypeIsNull)
                {
                    sqlparams["@refinanceImprovementsType"].Value = persistObject.RefinanceImprovementsType;
                }
                // Store the parameter for the GSERefinancePurposeType attribute.
                if (!persistObject.GSERefinancePurposeTypeIsNull)
                {
                    sqlparams["@gSERefinancePurposeType"].Value = persistObject.GSERefinancePurposeType;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateConstructionRefinanceData", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateConstructionRefinanceData", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateConstructionRefinanceData", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateConstructionRefinanceData", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(REOProperty persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(REOProperty.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(REOProperty.GetConnectionString(), "gsp_UpdateREOProperty");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(REOProperty.GetConnectionString(), "gsp_CreateREOProperty");
                }


                // Store the parameter for the LoanApplicationId attribute.
                if (!persistObject.LoanApplicationIdIsNull)
                {
                    sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                }
                // Store the parameter for the StreetAddress attribute.
                if (!persistObject.StreetAddressIsNull)
                {
                    sqlparams["@streetAddress"].Value = persistObject.StreetAddress;
                }
                // Store the parameter for the StreetAddress2 attribute.
                if (!persistObject.StreetAddress2IsNull)
                {
                    sqlparams["@streetAddress2"].Value = persistObject.StreetAddress2;
                }
                // Store the parameter for the City attribute.
                if (!persistObject.CityIsNull)
                {
                    sqlparams["@city"].Value = persistObject.City;
                }
                // Store the parameter for the State attribute.
                if (!persistObject.StateIsNull)
                {
                    sqlparams["@state"].Value = persistObject.State;
                }
                // Store the parameter for the PostalCode attribute.
                if (!persistObject.PostalCodeIsNull)
                {
                    sqlparams["@postalCode"].Value = persistObject.PostalCode;
                }
                // Store the parameter for the CurrentResidenceIndicator attribute.
                sqlparams["@currentResidenceIndicator"].Value = persistObject.CurrentResidenceIndicator;
                // Store the parameter for the LienInstallmentAmount attribute.
                if (!persistObject.LienInstallmentAmountIsNull)
                {
                    sqlparams["@lienInstallmentAmount"].Value = persistObject.LienInstallmentAmount;
                }
                // Store the parameter for the LienUPBAmount attribute.
                if (!persistObject.LienUPBAmountIsNull)
                {
                    sqlparams["@lienUPBAmount"].Value = persistObject.LienUPBAmount;
                }
                // Store the parameter for the MaintenanceExpenseAmount attribute.
                if (!persistObject.MaintenanceExpenseAmountIsNull)
                {
                    sqlparams["@maintenanceExpenseAmount"].Value = persistObject.MaintenanceExpenseAmount;
                }
                // Store the parameter for the MarketValueAmount attribute.
                if (!persistObject.MarketValueAmountIsNull)
                {
                    sqlparams["@marketValueAmount"].Value = persistObject.MarketValueAmount;
                }
                // Store the parameter for the RentalIncomeGrossAmount attribute.
                if (!persistObject.RentalIncomeGrossAmountIsNull)
                {
                    sqlparams["@rentalIncomeGrossAmount"].Value = persistObject.RentalIncomeGrossAmount;
                }
                // Store the parameter for the RentalIncomeNetAmount attribute.
                if (!persistObject.RentalIncomeNetAmountIsNull)
                {
                    sqlparams["@rentalIncomeNetAmount"].Value = persistObject.RentalIncomeNetAmount;
                }
                // Store the parameter for the SubjectIndicator attribute.
                sqlparams["@subjectIndicator"].Value = persistObject.SubjectIndicator;
                // Store the parameter for the BorrowerID attribute.
                if (!persistObject.BorrowerIDIsNull)
                {
                    sqlparams["@borrowerID"].Value = persistObject.BorrowerID;
                }
                // Store the parameter for the LiabilityID attribute.
                if (!persistObject.LiabilityIDIsNull)
                {
                    sqlparams["@liabilityID"].Value = persistObject.LiabilityID;
                }
                // Store the parameter for the GSEPropertyType attribute.
                if (!persistObject.GSEPropertyTypeIsNull)
                {
                    sqlparams["@gSEPropertyType"].Value = persistObject.GSEPropertyType;
                }
                // Store the parameter for the DispositionStatusType attribute.
                if (!persistObject.DispositionStatusTypeIsNull)
                {
                    sqlparams["@dispositionStatusType"].Value = persistObject.DispositionStatusType;
                }
                // Store the parameter for the Id attribute.
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                    // Store the parameter for the Id attribute.
                    sqlparams["@id"].Value = persistObject.Id;
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(cnn, CommandType.StoredProcedure, "gsp_CreateREOProperty", sqlparams));
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateREOProperty", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(sqlTrans, CommandType.StoredProcedure, "gsp_CreateREOProperty", sqlparams));
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateREOProperty", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(Liability persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(Liability.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(Liability.GetConnectionString(), "gsp_UpdateLiability");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(Liability.GetConnectionString(), "gsp_CreateLiability");
                }


                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                // Store the parameter for the BorrowerId attribute.
                sqlparams["@borrowerId"].Value = persistObject.BorrowerId;
                // Store the parameter for the REO_ID attribute.
                if (!persistObject.REO_IDIsNull)
                {
                    sqlparams["@rEO_ID"].Value = persistObject.REO_ID;
                }
                // Store the parameter for the HolderStreetAddress attribute.
                if (!persistObject.HolderStreetAddressIsNull)
                {
                    sqlparams["@holderStreetAddress"].Value = persistObject.HolderStreetAddress;
                }
                // Store the parameter for the HolderCity attribute.
                if (!persistObject.HolderCityIsNull)
                {
                    sqlparams["@holderCity"].Value = persistObject.HolderCity;
                }
                // Store the parameter for the HolderState attribute.
                if (!persistObject.HolderStateIsNull)
                {
                    sqlparams["@holderState"].Value = persistObject.HolderState;
                }
                // Store the parameter for the HolderPostalCode attribute.
                if (!persistObject.HolderPostalCodeIsNull)
                {
                    sqlparams["@holderPostalCode"].Value = persistObject.HolderPostalCode;
                }
                // Store the parameter for the AlimonyOwedToName attribute.
                if (!persistObject.AlimonyOwedToNameIsNull)
                {
                    sqlparams["@alimonyOwedToName"].Value = persistObject.AlimonyOwedToName;
                }
                // Store the parameter for the AccountIdentifier attribute.
                if (!persistObject.AccountIdentifierIsNull)
                {
                    sqlparams["@accountIdentifier"].Value = persistObject.AccountIdentifier;
                }
                // Store the parameter for the ExclusionIndicator attribute.
                sqlparams["@exclusionIndicator"].Value = persistObject.ExclusionIndicator;
                // Store the parameter for the HolderName attribute.
                if (!persistObject.HolderNameIsNull)
                {
                    sqlparams["@holderName"].Value = persistObject.HolderName;
                }
                // Store the parameter for the MonthlyPaymentAmount attribute.
                if (!persistObject.MonthlyPaymentAmountIsNull)
                {
                    sqlparams["@monthlyPaymentAmount"].Value = persistObject.MonthlyPaymentAmount;
                }
                // Store the parameter for the PayoffStatusIndicator attribute.
                sqlparams["@payoffStatusIndicator"].Value = persistObject.PayoffStatusIndicator;
                // Store the parameter for the PayoffWithCurrentAssetsIndicator attribute.
                sqlparams["@payoffWithCurrentAssetsIndicator"].Value = persistObject.PayoffWithCurrentAssetsIndicator;
                // Store the parameter for the RemainingTermMonths attribute.
                if (!persistObject.RemainingTermMonthsIsNull)
                {
                    sqlparams["@remainingTermMonths"].Value = persistObject.RemainingTermMonths;
                }
                // Store the parameter for the Type attribute.
                sqlparams["@type"].Value = persistObject.Type;
                // Store the parameter for the UnpaidBalanceAmount attribute.
                if (!persistObject.UnpaidBalanceAmountIsNull)
                {
                    sqlparams["@unpaidBalanceAmount"].Value = persistObject.UnpaidBalanceAmount;
                }
                // Store the parameter for the SubjectLoanResubordinationIndicator attribute.
                sqlparams["@subjectLoanResubordinationIndicator"].Value = persistObject.SubjectLoanResubordinationIndicator;
                // Store the parameter for the Id attribute.
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                    // Store the parameter for the Id attribute.
                    sqlparams["@id"].Value = persistObject.Id;
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(cnn, CommandType.StoredProcedure, "gsp_CreateLiability", sqlparams));
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateLiability", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(sqlTrans, CommandType.StoredProcedure, "gsp_CreateLiability", sqlparams));
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateLiability", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(TransmittalData persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(TransmittalData.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(TransmittalData.GetConnectionString(), "gsp_UpdateTransmittalData");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(TransmittalData.GetConnectionString(), "gsp_CreateTransmittalData");
                }


                // Store the parameter for the ArmsLengthIndicator attribute.
                sqlparams["@armsLengthIndicator"].Value = persistObject.ArmsLengthIndicator;
                // Store the parameter for the BelowMarketSubordinateFinancingIndicator attribute.
                sqlparams["@belowMarketSubordinateFinancingIndicator"].Value = persistObject.BelowMarketSubordinateFinancingIndicator;
                // Store the parameter for the BuydownRatePercent attribute.
                if (!persistObject.BuydownRatePercentIsNull)
                {
                    sqlparams["@buydownRatePercent"].Value = persistObject.BuydownRatePercent;
                }
                // Store the parameter for the CreditReportAuthorizationIndicator attribute.
                sqlparams["@creditReportAuthorizationIndicator"].Value = persistObject.CreditReportAuthorizationIndicator;
                // Store the parameter for the LenderBranchIdentifier attribute.
                if (!persistObject.LenderBranchIdentifierIsNull)
                {
                    sqlparams["@lenderBranchIdentifier"].Value = persistObject.LenderBranchIdentifier;
                }
                // Store the parameter for the LenderRegistrationIdentifier attribute.
                if (!persistObject.LenderRegistrationIdentifierIsNull)
                {
                    sqlparams["@lenderRegistrationIdentifier"].Value = persistObject.LenderRegistrationIdentifier;
                }
                // Store the parameter for the PropertyAppraisedValueAmount attribute.
                if (!persistObject.PropertyAppraisedValueAmountIsNull)
                {
                    sqlparams["@propertyAppraisedValueAmount"].Value = persistObject.PropertyAppraisedValueAmount;
                }
                // Store the parameter for the PropertyEstimatedValueAmount attribute.
                if (!persistObject.PropertyEstimatedValueAmountIsNull)
                {
                    sqlparams["@propertyEstimatedValueAmount"].Value = persistObject.PropertyEstimatedValueAmount;
                }
                // Store the parameter for the InvestorLoanIdentifier attribute.
                if (!persistObject.InvestorLoanIdentifierIsNull)
                {
                    sqlparams["@investorLoanIdentifier"].Value = persistObject.InvestorLoanIdentifier;
                }
                // Store the parameter for the InvestorInstitutionIdentifier attribute.
                if (!persistObject.InvestorInstitutionIdentifierIsNull)
                {
                    sqlparams["@investorInstitutionIdentifier"].Value = persistObject.InvestorInstitutionIdentifier;
                }
                // Store the parameter for the CommitmentReferenceIdentifier attribute.
                if (!persistObject.CommitmentReferenceIdentifierIsNull)
                {
                    sqlparams["@commitmentReferenceIdentifier"].Value = persistObject.CommitmentReferenceIdentifier;
                }
                // Store the parameter for the ConcurrentOriginationIndicator attribute.
                sqlparams["@concurrentOriginationIndicator"].Value = persistObject.ConcurrentOriginationIndicator;
                // Store the parameter for the ConcurrentOriginationLenderIndicator attribute.
                sqlparams["@concurrentOriginationLenderIndicator"].Value = persistObject.ConcurrentOriginationLenderIndicator;
                // Store the parameter for the RateLockPeriodDays attribute.
                if (!persistObject.RateLockPeriodDaysIsNull)
                {
                    sqlparams["@rateLockPeriodDays"].Value = persistObject.RateLockPeriodDays;
                }
                // Store the parameter for the RateLockRequestedExtensionDays attribute.
                if (!persistObject.RateLockRequestedExtensionDaysIsNull)
                {
                    sqlparams["@rateLockRequestedExtensionDays"].Value = persistObject.RateLockRequestedExtensionDays;
                }
                // Store the parameter for the CaseStateType attribute.
                if (!persistObject.CaseStateTypeIsNull)
                {
                    sqlparams["@caseStateType"].Value = persistObject.CaseStateType;
                }
                // Store the parameter for the RateLockType attribute.
                if (!persistObject.RateLockTypeIsNull)
                {
                    sqlparams["@rateLockType"].Value = persistObject.RateLockType;
                }
                // Store the parameter for the CurrentFirstMortgageHolderType attribute.
                if (!persistObject.CurrentFirstMortgageHolderTypeIsNull)
                {
                    sqlparams["@currentFirstMortgageHolderType"].Value = persistObject.CurrentFirstMortgageHolderType;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateTransmittalData", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateTransmittalData", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateTransmittalData", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateTransmittalData", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 23
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(ARM persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(ARM.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(ARM.GetConnectionString(), "gsp_UpdateARM");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(ARM.GetConnectionString(), "gsp_CreateARM");
                }


                // Store the parameter for the IndexCurrentValuePercent attribute.
                if (!persistObject.IndexCurrentValuePercentIsNull)
                {
                    sqlparams["@indexCurrentValuePercent"].Value = persistObject.IndexCurrentValuePercent;
                }
                // Store the parameter for the IndexMarginPercent attribute.
                if (!persistObject.IndexMarginPercentIsNull)
                {
                    sqlparams["@indexMarginPercent"].Value = persistObject.IndexMarginPercent;
                }
                // Store the parameter for the IndexType attribute.
                if (!persistObject.IndexTypeIsNull)
                {
                    sqlparams["@indexType"].Value = persistObject.IndexType;
                }
                // Store the parameter for the QualifyingRatePercent attribute.
                if (!persistObject.QualifyingRatePercentIsNull)
                {
                    sqlparams["@qualifyingRatePercent"].Value = persistObject.QualifyingRatePercent;
                }
                // Store the parameter for the ConversionOptionIndicator attribute.
                sqlparams["@conversionOptionIndicator"].Value = persistObject.ConversionOptionIndicator;
                // Store the parameter for the PaymentAdjustmentLifetimeCapAmount attribute.
                if (!persistObject.PaymentAdjustmentLifetimeCapAmountIsNull)
                {
                    sqlparams["@paymentAdjustmentLifetimeCapAmount"].Value = persistObject.PaymentAdjustmentLifetimeCapAmount;
                }
                // Store the parameter for the PaymentAdjustmentLifetimeCapPercent attribute.
                if (!persistObject.PaymentAdjustmentLifetimeCapPercentIsNull)
                {
                    sqlparams["@paymentAdjustmentLifetimeCapPercent"].Value = persistObject.PaymentAdjustmentLifetimeCapPercent;
                }
                // Store the parameter for the RateAdjustmentLifetimeCapPercent attribute.
                if (!persistObject.RateAdjustmentLifetimeCapPercentIsNull)
                {
                    sqlparams["@rateAdjustmentLifetimeCapPercent"].Value = persistObject.RateAdjustmentLifetimeCapPercent;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateARM", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateARM", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateARM", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateARM", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 24
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(VALoan persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(VALoan.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(VALoan.GetConnectionString(), "gsp_UpdateVALoan");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(VALoan.GetConnectionString(), "gsp_CreateVALoan");
                }


                // Store the parameter for the VABorrowerCoBorrowerMarriedIndicator attribute.
                sqlparams["@vABorrowerCoBorrowerMarriedIndicator"].Value = persistObject.VABorrowerCoBorrowerMarriedIndicator;
                // Store the parameter for the BorrowerFundingFeePercent attribute.
                if (!persistObject.BorrowerFundingFeePercentIsNull)
                {
                    sqlparams["@borrowerFundingFeePercent"].Value = persistObject.BorrowerFundingFeePercent;
                }
                // Store the parameter for the VAEntitlementAmount attribute.
                if (!persistObject.VAEntitlementAmountIsNull)
                {
                    sqlparams["@vAEntitlementAmount"].Value = persistObject.VAEntitlementAmount;
                }
                // Store the parameter for the VAMaintenanceExpenseMonthlyAmount attribute.
                if (!persistObject.VAMaintenanceExpenseMonthlyAmountIsNull)
                {
                    sqlparams["@vAMaintenanceExpenseMonthlyAmount"].Value = persistObject.VAMaintenanceExpenseMonthlyAmount;
                }
                // Store the parameter for the VAResidualIncomeAmount attribute.
                if (!persistObject.VAResidualIncomeAmountIsNull)
                {
                    sqlparams["@vAResidualIncomeAmount"].Value = persistObject.VAResidualIncomeAmount;
                }
                // Store the parameter for the VAUtilityExpenseMonthlyAmount attribute.
                if (!persistObject.VAUtilityExpenseMonthlyAmountIsNull)
                {
                    sqlparams["@vAUtilityExpenseMonthlyAmount"].Value = persistObject.VAUtilityExpenseMonthlyAmount;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateVALoan", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateVALoan", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateVALoan", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateVALoan", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 25
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(LoanPurpose persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(LoanPurpose.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(LoanPurpose.GetConnectionString(), "gsp_UpdateLoanPurpose");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(LoanPurpose.GetConnectionString(), "gsp_CreateLoanPurpose");
                }


                // Store the parameter for the GSETitleMannerHeldDescription attribute.
                if (!persistObject.GSETitleMannerHeldDescriptionIsNull)
                {
                    sqlparams["@gSETitleMannerHeldDescription"].Value = persistObject.GSETitleMannerHeldDescription;
                }
                // Store the parameter for the OtherLoanPurposeDescription attribute.
                if (!persistObject.OtherLoanPurposeDescriptionIsNull)
                {
                    sqlparams["@otherLoanPurposeDescription"].Value = persistObject.OtherLoanPurposeDescription;
                }
                // Store the parameter for the PropertyLeaseholdExpirationDate attribute.
                if (!persistObject.PropertyLeaseholdExpirationDateIsNull)
                {
                    sqlparams["@propertyLeaseholdExpirationDate"].Value = persistObject.PropertyLeaseholdExpirationDate;
                }
                // Store the parameter for the PropertyUsageType attribute.
                if (!persistObject.PropertyUsageTypeIsNull)
                {
                    sqlparams["@propertyUsageType"].Value = persistObject.PropertyUsageType;
                }
                // Store the parameter for the PropertyRightsType attribute.
                if (!persistObject.PropertyRightsTypeIsNull)
                {
                    sqlparams["@propertyRightsType"].Value = persistObject.PropertyRightsType;
                }
                // Store the parameter for the Type attribute.
                if (!persistObject.TypeIsNull)
                {
                    sqlparams["@type"].Value = persistObject.Type;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateLoanPurpose", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateLoanPurpose", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateLoanPurpose", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateLoanPurpose", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 26
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(MailTo persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(MailTo.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(MailTo.GetConnectionString(), "gsp_UpdateMailTo");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(MailTo.GetConnectionString(), "gsp_CreateMailTo");
                }


                // Store the parameter for the StreetAddress attribute.
                if (!persistObject.StreetAddressIsNull)
                {
                    sqlparams["@streetAddress"].Value = persistObject.StreetAddress;
                }
                // Store the parameter for the StreetAddress2 attribute.
                if (!persistObject.StreetAddress2IsNull)
                {
                    sqlparams["@streetAddress2"].Value = persistObject.StreetAddress2;
                }
                // Store the parameter for the City attribute.
                if (!persistObject.CityIsNull)
                {
                    sqlparams["@city"].Value = persistObject.City;
                }
                // Store the parameter for the State attribute.
                if (!persistObject.StateIsNull)
                {
                    sqlparams["@state"].Value = persistObject.State;
                }
                // Store the parameter for the PostalCode attribute.
                if (!persistObject.PostalCodeIsNull)
                {
                    sqlparams["@postalCode"].Value = persistObject.PostalCode;
                }
                // Store the parameter for the Country attribute.
                if (!persistObject.CountryIsNull)
                {
                    sqlparams["@country"].Value = persistObject.Country;
                }
                // Store the parameter for the BorrowerId attribute.
                sqlparams["@borrowerId"].Value = persistObject.BorrowerId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateMailTo", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateMailTo", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateMailTo", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateMailTo", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(FHAVABorrower persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(FHAVABorrower.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(FHAVABorrower.GetConnectionString(), "gsp_UpdateFHAVABorrower");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(FHAVABorrower.GetConnectionString(), "gsp_CreateFHAVABorrower");
                }


                // Store the parameter for the CAIVRSIdentifier attribute.
                if (!persistObject.CAIVRSIdentifierIsNull)
                {
                    sqlparams["@cAIVRSIdentifier"].Value = persistObject.CAIVRSIdentifier;
                }
                // Store the parameter for the FNMBankruptcyCount attribute.
                if (!persistObject.FNMBankruptcyCountIsNull)
                {
                    sqlparams["@fNMBankruptcyCount"].Value = persistObject.FNMBankruptcyCount;
                }
                // Store the parameter for the FNMBorrowerCreditRating attribute.
                if (!persistObject.FNMBorrowerCreditRatingIsNull)
                {
                    sqlparams["@fNMBorrowerCreditRating"].Value = persistObject.FNMBorrowerCreditRating;
                }
                // Store the parameter for the FNMCreditReportScoreType attribute.
                if (!persistObject.FNMCreditReportScoreTypeIsNull)
                {
                    sqlparams["@fNMCreditReportScoreType"].Value = persistObject.FNMCreditReportScoreType;
                }
                // Store the parameter for the FNMForeclosureCount attribute.
                if (!persistObject.FNMForeclosureCountIsNull)
                {
                    sqlparams["@fNMForeclosureCount"].Value = persistObject.FNMForeclosureCount;
                }
                // Store the parameter for the VeteranStatusIndicator attribute.
                sqlparams["@veteranStatusIndicator"].Value = persistObject.VeteranStatusIndicator;
                // Store the parameter for the BorrowerId attribute.
                sqlparams["@borrowerId"].Value = persistObject.BorrowerId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateFHAVABorrower", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateFHAVABorrower", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateFHAVABorrower", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateFHAVABorrower", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(ProposedHousingExpense persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(ProposedHousingExpense.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(ProposedHousingExpense.GetConnectionString(), "gsp_UpdateProposedHousingExpense");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(ProposedHousingExpense.GetConnectionString(), "gsp_CreateProposedHousingExpense");
                }


                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                // Store the parameter for the PaymentAmount attribute.
                sqlparams["@paymentAmount"].Value = persistObject.PaymentAmount;
                // Store the parameter for the HousingExpenseType attribute.
                sqlparams["@housingExpenseType"].Value = persistObject.HousingExpenseType;
                // Store the parameter for the Id attribute.
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                    // Store the parameter for the Id attribute.
                    sqlparams["@id"].Value = persistObject.Id;
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(cnn, CommandType.StoredProcedure, "gsp_CreateProposedHousingExpense", sqlparams));
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateProposedHousingExpense", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        persistObject._id = Convert.ToInt64(SqlHelper.ExecuteScalar(sqlTrans, CommandType.StoredProcedure, "gsp_CreateProposedHousingExpense", sqlparams));
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateProposedHousingExpense", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
Esempio n. 29
0
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(DispositionStatusType persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(DispositionStatusType.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(DispositionStatusType.GetConnectionString(), "gsp_UpdateDispositionStatusType");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(DispositionStatusType.GetConnectionString(), "gsp_CreateDispositionStatusType");
                }


                // Store the parameter for the Name attribute.
                sqlparams["@name"].Value = persistObject.Name;
                // Store the parameter for the EnumeratedName attribute.
                sqlparams["@enumeratedName"].Value = persistObject.EnumeratedName;
                // Store the parameter for the Description attribute.
                if (!persistObject.DescriptionIsNull)
                {
                    sqlparams["@description"].Value = persistObject.Description;
                }
                // Store the parameter for the Id attribute.
                sqlparams["@id"].Value = persistObject.Id;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateDispositionStatusType", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateDispositionStatusType", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateDispositionStatusType", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateDispositionStatusType", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }
        /// <summary>
        /// Persists the object.
        /// </summary>
        public virtual void Persist(GovernmentReporting persistObject, SqlTransaction sqlTrans)
        {
            // create local variable array for the sql parameters
            SqlParameterHash sqlparams = null;
            // Create a local variable for the connection
            SqlConnection cnn = null;


            // Use the parameter overload or create a new instance
            if (sqlTrans == null)
            {
                cnn = new SqlConnection(GovernmentReporting.GetConnectionString());
            }


            try
            {
                // discover the parameters
                if (persistObject.Persisted)
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(GovernmentReporting.GetConnectionString(), "gsp_UpdateGovernmentReporting");
                }
                else
                {
                    sqlparams = SqlHelperParameterCache.GetSpParameterSet(GovernmentReporting.GetConnectionString(), "gsp_CreateGovernmentReporting");
                }


                // Store the parameter for the HMDAPurposeOfLoanType attribute.
                if (!persistObject.HMDAPurposeOfLoanTypeIsNull)
                {
                    sqlparams["@hMDAPurposeOfLoanType"].Value = persistObject.HMDAPurposeOfLoanType;
                }
                // Store the parameter for the HMDAPreapprovalType attribute.
                if (!persistObject.HMDAPreapprovalTypeIsNull)
                {
                    sqlparams["@hMDAPreapprovalType"].Value = persistObject.HMDAPreapprovalType;
                }
                // Store the parameter for the HMDA_HOEPALoanStatusIndicator attribute.
                sqlparams["@hMDA_HOEPALoanStatusIndicator"].Value = persistObject.HMDA_HOEPALoanStatusIndicator;
                // Store the parameter for the HMDARateSpreadPercent attribute.
                if (!persistObject.HMDARateSpreadPercentIsNull)
                {
                    sqlparams["@hMDARateSpreadPercent"].Value = persistObject.HMDARateSpreadPercent;
                }
                // Store the parameter for the LoanApplicationId attribute.
                sqlparams["@loanApplicationId"].Value = persistObject.LoanApplicationId;
                if (!persistObject.Persisted)
                {
                    // store the create only (historical fixed) values
                }
                else
                {
                    // store the update only (historical changeable) values
                }


                if (sqlTrans == null)
                {
                    // Process using the isolated connection
                    using (cnn)
                    {
                        // open the connection
                        cnn.Open();


                        if (!persistObject.Persisted)
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_CreateGovernmentReporting", sqlparams);
                        }
                        else
                        {
                            SqlHelper.ExecuteNonQuery(cnn, CommandType.StoredProcedure, "gsp_UpdateGovernmentReporting", sqlparams);
                        }


                        // close the connection after usage
                        cnn.Close();
                    }


                    // nullify the connection var
                    cnn = null;
                }
                else
                {
                    // Process using the shared transaction
                    if (!persistObject.Persisted)
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_CreateGovernmentReporting", sqlparams);
                    }
                    else
                    {
                        SqlHelper.ExecuteNonQuery(sqlTrans, CommandType.StoredProcedure, "gsp_UpdateGovernmentReporting", sqlparams);
                    }
                }
            }
            catch (SqlException sqlex)
            {
                throw sqlex;
            }
        }