Exemplo n.º 1
0
        /// <summary>
        /// Populates the fields of a single objects from the columns found in an open reader.
        /// </summary>
        /// <param name="obj" type="BDCustomer">Object of BDCustomer to populate</param>
        /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:56:00 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static void PopulateObjectFromReader(BDCustomerBase obj, IDataReader rdr)
        {
            obj.CustomerID   = rdr.GetInt32(rdr.GetOrdinal(BDCustomerFields.CustomerID));
            obj.CustomerName = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.CustomerName));
            if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.CustomerCode)))
            {
                obj.CustomerCode = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.CustomerCode));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Address)))
            {
                obj.Address = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Address));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Phone1)))
            {
                obj.Phone1 = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Phone1));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Phone2)))
            {
                obj.Phone2 = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Phone2));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Mobile1)))
            {
                obj.Mobile1 = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Mobile1));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Mobile2)))
            {
                obj.Mobile2 = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Mobile2));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Email)))
            {
                obj.Email = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Email));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.IsActive)))
            {
                obj.IsActive = rdr.GetBoolean(rdr.GetOrdinal(BDCustomerFields.IsActive));
            }
        }
Exemplo n.º 2
0
		/// <summary>
		/// Populates the fields of a single objects from the columns found in an open reader.
		/// </summary>
		/// <param name="obj" type="BDCustomer">Object of BDCustomer to populate</param>
		/// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:01 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static void PopulateObjectFromReader(BDCustomerBase obj,IDataReader rdr) 
		{

			obj.CustomerID = rdr.GetInt32(rdr.GetOrdinal(BDCustomerFields.CustomerID));
			obj.CustomerName = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.CustomerName));
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.CustomerCode)))
			{
				obj.CustomerCode = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.CustomerCode));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Address)))
			{
				obj.Address = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Address));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Phone1)))
			{
				obj.Phone1 = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Phone1));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Phone2)))
			{
				obj.Phone2 = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Phone2));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Mobile1)))
			{
				obj.Mobile1 = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Mobile1));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Mobile2)))
			{
				obj.Mobile2 = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Mobile2));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.Email)))
			{
				obj.Email = rdr.GetString(rdr.GetOrdinal(BDCustomerFields.Email));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDCustomerFields.IsActive)))
			{
				obj.IsActive = rdr.GetBoolean(rdr.GetOrdinal(BDCustomerFields.IsActive));
			}
			
			obj.Debit = rdr.GetDecimal(rdr.GetOrdinal(BDCustomerFields.Debit));
			obj.Credit = rdr.GetDecimal(rdr.GetOrdinal(BDCustomerFields.Credit));

		}