Ejemplo n.º 1
0
        /// <summary>
        /// Populates the fields of a single objects from the columns found in an open reader.
        /// </summary>
        /// <param name="obj" type="BDSupplier">Object of BDSupplier 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:05 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static void PopulateObjectFromReader(BDSupplierBase obj, IDataReader rdr)
        {
            obj.SupplierID = rdr.GetInt32(rdr.GetOrdinal(BDSupplierFields.SupplierID));
            if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.SupplierCode)))
            {
                obj.SupplierCode = rdr.GetString(rdr.GetOrdinal(BDSupplierFields.SupplierCode));
            }

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

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

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

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

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

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

            if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.IsActive)))
            {
                obj.IsActive = rdr.GetBoolean(rdr.GetOrdinal(BDSupplierFields.IsActive));
            }

            obj.Debit  = rdr.GetDecimal(rdr.GetOrdinal(BDSupplierFields.Debit));
            obj.Credit = rdr.GetDecimal(rdr.GetOrdinal(BDSupplierFields.Credit));
        }
Ejemplo n.º 2
0
		/// <summary>
		/// Populates the fields of a single objects from the columns found in an open reader.
		/// </summary>
		/// <param name="obj" type="BDSupplier">Object of BDSupplier 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:05 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static void PopulateObjectFromReader(BDSupplierBase obj,IDataReader rdr) 
		{

			obj.SupplierID = rdr.GetInt32(rdr.GetOrdinal(BDSupplierFields.SupplierID));
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.SupplierCode)))
			{
				obj.SupplierCode = rdr.GetString(rdr.GetOrdinal(BDSupplierFields.SupplierCode));
			}
			
			obj.SupplierName = rdr.GetString(rdr.GetOrdinal(BDSupplierFields.SupplierName));
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.Address)))
			{
				obj.Address = rdr.GetString(rdr.GetOrdinal(BDSupplierFields.Address));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.Phone1)))
			{
				obj.Phone1 = rdr.GetString(rdr.GetOrdinal(BDSupplierFields.Phone1));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.Phone2)))
			{
				obj.Phone2 = rdr.GetString(rdr.GetOrdinal(BDSupplierFields.Phone2));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.Mobile1)))
			{
				obj.Mobile1 = rdr.GetString(rdr.GetOrdinal(BDSupplierFields.Mobile1));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.Mobile2)))
			{
				obj.Mobile2 = rdr.GetString(rdr.GetOrdinal(BDSupplierFields.Mobile2));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.Email)))
			{
				obj.Email = rdr.GetString(rdr.GetOrdinal(BDSupplierFields.Email));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(BDSupplierFields.IsActive)))
			{
				obj.IsActive = rdr.GetBoolean(rdr.GetOrdinal(BDSupplierFields.IsActive));
			}
			
			obj.Debit = rdr.GetDecimal(rdr.GetOrdinal(BDSupplierFields.Debit));
			obj.Credit = rdr.GetDecimal(rdr.GetOrdinal(BDSupplierFields.Credit));

		}