/// <summary>
        /// The object factory for a particular data collection instance.
        /// </summary>
        public virtual void CreateObjectsFromData(Borrowers borrowers, System.Data.SqlClient.SqlDataReader data)
        {
            // Do nothing if we have nothing
            if (data == null) return;

            // Create a local variable for the new instance.
            Borrower newobj = null;
            // Iterate through the data reader
            while (data.Read())
            {
                // Create a new object instance
                newobj = System.Activator.CreateInstance(borrowers.ContainsType[0]) as Borrower;
                // Let the instance set its own members
                newobj.SetMembers(ref data);
                // Add the new object to the collection instance
                borrowers.Add(newobj);
            }
        }
        /// <summary>
        /// The object factory for a particular data collection instance.
        /// </summary>
        public virtual void CreateObjectsFromData(Borrowers borrowers, System.Data.DataSet data)
        {
            // Do nothing if we have nothing
            if (data == null || data.Tables.Count == 0 || data.Tables[0].Rows.Count == 0) return;

            // Create a local variable for the new instance.
            Borrower newobj = null;
            // Create a local variable for the data row instance.
            System.Data.DataRow dr = null;

            // Iterate through the table rows
            for (int i = 0; i<data.Tables[0].Rows.Count; i++)
            {
                // Get a reference to the data row
                dr = data.Tables[0].Rows[i];
                // Create a new object instance
                newobj = System.Activator.CreateInstance(borrowers.ContainsType[0]) as Borrower;
                // Let the instance set its own members
                newobj.SetMembers(ref dr);
                // Add the new object to the collection instance
                borrowers.Add(newobj);
            }
        }
        /// <summary>
        /// Gets the objects for the BORROWER relationship.
        /// </summary>
        public Borrowers GetBorrowers()
        {
            Borrowers borrowers = new Borrowers();

            BorrowerBase.ServiceObject.FillByLoanApplication(borrowers, _id);
            return borrowers;
        }
Example #4
0
        /// <summary>
        /// Gets the objects for the BORROWER relationship.
        /// </summary>
        public Borrowers GetBorrowers()
        {
            Borrowers borrowers = new Borrowers();

            BorrowerBase.ServiceObject.FillByBorrower(borrowers, _id);
            return borrowers;
        }
Example #5
0
        /// <summary>
        /// Gets other Borrower objects by the specified criteria parameters.
        /// </summary>
        public static Borrowers GetBySSN(System.String sSN)
        {
            // Create an empty collection to fill
            Borrowers collection = new Borrowers();

            // have the service object fill the collection the objects
            BorrowerBase.ServiceObject.GetBySSN(collection, sSN);
            return collection;
        }
        /// <summary>
        /// Gets the objects for the BORROWER relationship.
        /// </summary>
        public Borrowers GetBorrowers()
        {
            Borrowers borrowers = new Borrowers();

            BorrowerBase.ServiceObject.FillByPrintPositionType(borrowers, _id);
            return borrowers;
        }
        /// <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>
        /// Gets all the available objects.
        /// </summary>
        public virtual Borrowers GetAll()
        {
            // create a new instance of the return object
            Borrowers objects = new Borrowers();

            // fill the objects
            this.Fill(objects);

            // return the filled object from the service
            return objects;
        }
        /// <summary>
        /// Fill method for populating a collection by PrintPositionType
        /// </summary>
        public void FillByPrintPositionType(Borrowers borrowers, System.Int16 id)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(Borrower.GetConnectionString());

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

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

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

                    // create an instance of the reader to fill.
                    SqlDataReader datareader = SqlHelper.ExecuteReader(cnn, "gsp_SelectBorrowersByPrintPositionType", 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>
        /// Fill method for populating an entire collection of Borrowers
        /// </summary>
        public virtual void Fill(Borrowers borrowers)
        {
            // create the connection to use
            SqlConnection cnn = new SqlConnection(Borrower.GetConnectionString());

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

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

                    // 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>
        /// Gets the objects for the BORROWER relationship.
        /// </summary>
        public Borrowers GetBorrowers()
        {
            Borrowers borrowers = new Borrowers();

            BorrowerBase.ServiceObject.FillByMaritalStatusType(borrowers, _id);
            return borrowers;
        }
        /// <summary>
        /// Gets the objects for the BORROWER relationship.
        /// </summary>
        public Borrowers GetBorrowers()
        {
            Borrowers borrowers = new Borrowers();

            BorrowerBase.ServiceObject.FillByJointAssetLiabilityReportingType(borrowers, _id);
            return borrowers;
        }