コード例 #1
0
        /// <summary>
        /// Populates the fields of a single objects from the columns found in an open reader.
        /// </summary>
        /// <param name="obj" type="VProducts">Object of VProducts 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:30 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static void PopulateObjectFromReader(VProductBase obj, IDataReader rdr)
        {
            obj.ProductID   = rdr.GetInt32(rdr.GetOrdinal(VProductFields.ProductID));
            obj.ProductName = rdr.GetString(rdr.GetOrdinal(VProductFields.ProductName));
            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.ProductGroupID)))
            {
                obj.ProductGroupID = rdr.GetInt32(rdr.GetOrdinal(VProductFields.ProductGroupID));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.ProductCode)))
            {
                obj.ProductCode = rdr.GetString(rdr.GetOrdinal(VProductFields.ProductCode));
            }

            obj.IsAcceptBatch = rdr.GetBoolean(rdr.GetOrdinal(VProductFields.IsAcceptBatch));
            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.ProductPrice)))
            {
                obj.ProductPrice = rdr.GetDecimal(rdr.GetOrdinal(VProductFields.ProductPrice));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.IsFixedPrice)))
            {
                obj.IsFixedPrice = rdr.GetBoolean(rdr.GetOrdinal(VProductFields.IsFixedPrice));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.HasDiscount)))
            {
                obj.HasDiscount = rdr.GetBoolean(rdr.GetOrdinal(VProductFields.HasDiscount));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.DiscountAmount)))
            {
                obj.DiscountAmount = rdr.GetDecimal(rdr.GetOrdinal(VProductFields.DiscountAmount));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.DescountRatio)))
            {
                obj.DescountRatio = rdr.GetDouble(rdr.GetOrdinal(VProductFields.DescountRatio));
            }

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

            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.Notes)))
            {
                obj.Notes = rdr.GetString(rdr.GetOrdinal(VProductFields.Notes));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.ProductGroupName)))
            {
                obj.ProductGroupName = rdr.GetDecimal(rdr.GetOrdinal(VProductFields.ProductGroupName));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.Expr1)))
            {
                obj.Expr1 = rdr.GetDecimal(rdr.GetOrdinal(VProductFields.Expr1));
            }
        }
コード例 #2
0
ファイル: VProductBase.cs プロジェクト: kimboox44/POS
		/// <summary>
		/// Populates the fields of a single objects from the columns found in an open reader.
		/// </summary>
		/// <param name="obj" type="VProducts">Object of VProducts to populate</param>
		/// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			4/25/2015 1:10:32 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static void PopulateObjectFromReader(VProductBase obj,IDataReader rdr) 
		{

			obj.ProductID = rdr.GetInt32(rdr.GetOrdinal(VProductFields.ProductID));
			obj.ProductName = rdr.GetString(rdr.GetOrdinal(VProductFields.ProductName));
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.ProductGroupID)))
			{
				obj.ProductGroupID = rdr.GetInt32(rdr.GetOrdinal(VProductFields.ProductGroupID));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.ProductCode)))
			{
				obj.ProductCode = rdr.GetString(rdr.GetOrdinal(VProductFields.ProductCode));
			}
			
			obj.IsAcceptBatch = rdr.GetBoolean(rdr.GetOrdinal(VProductFields.IsAcceptBatch));
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.ProductPrice)))
			{
				obj.ProductPrice = rdr.GetDecimal(rdr.GetOrdinal(VProductFields.ProductPrice));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.IsFixedPrice)))
			{
				obj.IsFixedPrice = rdr.GetBoolean(rdr.GetOrdinal(VProductFields.IsFixedPrice));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.HasDiscount)))
			{
				obj.HasDiscount = rdr.GetBoolean(rdr.GetOrdinal(VProductFields.HasDiscount));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.DiscountAmount)))
			{
				obj.DiscountAmount = rdr.GetDecimal(rdr.GetOrdinal(VProductFields.DiscountAmount));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.DescountRatio)))
			{
				obj.DescountRatio = rdr.GetDouble(rdr.GetOrdinal(VProductFields.DescountRatio));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.IsActive)))
			{
				obj.IsActive = rdr.GetBoolean(rdr.GetOrdinal(VProductFields.IsActive));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.Notes)))
			{
				obj.Notes = rdr.GetString(rdr.GetOrdinal(VProductFields.Notes));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.MinPrice)))
			{
				obj.MinPrice = rdr.GetDecimal(rdr.GetOrdinal(VProductFields.MinPrice));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VProductFields.MaxPrice)))
			{
				obj.MaxPrice = rdr.GetDecimal(rdr.GetOrdinal(VProductFields.MaxPrice));
			}
			
			obj.ProductGroupName = rdr.GetString(rdr.GetOrdinal(VProductFields.ProductGroupName));

		}