Esempio n. 1
0
        /// <summary>
        /// Populates the fields of a single objects from the columns found in an open reader.
        /// </summary>
        /// <param name="obj" type="VPURPurchaseOrder">Object of VPURPurchaseOrder to populate</param>
        /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			11/4/2015 9:57:47 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static void PopulateObjectFromReader(VPURPurchaseOrderBase obj, IDataReader rdr)
        {
            obj.SupplierID     = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.SupplierID));
            obj.SupplierName   = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.SupplierName));
            obj.Qty            = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.Qty));
            obj.PurchaseLineID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.PurchaseLineID));
            obj.TotalQty       = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.TotalQty));
            obj.UnitPrice      = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.UnitPrice));
            obj.BatchNumber    = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.BatchNumber));
            obj.ExpiryDate     = rdr.GetDateTime(rdr.GetOrdinal(VPURPurchaseOrderFields.ExpiryDate));
            if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.TaxValue)))
            {
                obj.TaxValue = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.TaxValue));
            }

            obj.PurcaseHeaderID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.PurcaseHeaderID));
            obj.PurchaseDate    = rdr.GetDateTime(rdr.GetOrdinal(VPURPurchaseOrderFields.PurchaseDate));
            if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.InvoiceNumber)))
            {
                obj.InvoiceNumber = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.InvoiceNumber));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.InvoiceDate)))
            {
                obj.InvoiceDate = rdr.GetDateTime(rdr.GetOrdinal(VPURPurchaseOrderFields.InvoiceDate));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.PaymentTypeID)))
            {
                obj.PaymentTypeID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.PaymentTypeID));
            }

            obj.TotalDiscountRatio = rdr.GetDouble(rdr.GetOrdinal(VPURPurchaseOrderFields.TotalDiscountRatio));
            if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.TaxTypeName)))
            {
                obj.TaxTypeName = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.TaxTypeName));
            }

            obj.IsClosed = rdr.GetBoolean(rdr.GetOrdinal(VPURPurchaseOrderFields.IsClosed));
            obj.IsVoid   = rdr.GetBoolean(rdr.GetOrdinal(VPURPurchaseOrderFields.IsVoid));
            if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.ChequeNumber)))
            {
                obj.ChequeNumber = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.ChequeNumber));
            }

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

            obj.IsAcceptBatch = rdr.GetBoolean(rdr.GetOrdinal(VPURPurchaseOrderFields.IsAcceptBatch));
            obj.UserFullName  = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.UserFullName));
            obj.ProductID     = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.ProductID));
        }
Esempio n. 2
0
		/// <summary>
		/// Populates the fields of a single objects from the columns found in an open reader.
		/// </summary>
		/// <param name="obj" type="VPURPurchaseOrder">Object of VPURPurchaseOrder to populate</param>
		/// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			11/4/2015 9:57:47 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static void PopulateObjectFromReader(VPURPurchaseOrderBase obj,IDataReader rdr) 
		{

			obj.SupplierID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.SupplierID));
			obj.SupplierName = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.SupplierName));
			obj.Qty = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.Qty));
			obj.PurchaseLineID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.PurchaseLineID));
			obj.TotalQty = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.TotalQty));
			obj.UnitPrice = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.UnitPrice));
			obj.BatchNumber = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.BatchNumber));
			obj.ExpiryDate = rdr.GetDateTime(rdr.GetOrdinal(VPURPurchaseOrderFields.ExpiryDate));
			if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.TaxValue)))
			{
				obj.TaxValue = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.TaxValue));
			}
			
			obj.PurcaseHeaderID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.PurcaseHeaderID));
			obj.PurchaseDate = rdr.GetDateTime(rdr.GetOrdinal(VPURPurchaseOrderFields.PurchaseDate));
			if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.InvoiceNumber)))
			{
				obj.InvoiceNumber = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.InvoiceNumber));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.InvoiceDate)))
			{
				obj.InvoiceDate = rdr.GetDateTime(rdr.GetOrdinal(VPURPurchaseOrderFields.InvoiceDate));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.PaymentTypeID)))
			{
				obj.PaymentTypeID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.PaymentTypeID));
			}
			
			obj.TotalDiscountRatio = rdr.GetDouble(rdr.GetOrdinal(VPURPurchaseOrderFields.TotalDiscountRatio));
			if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.TaxTypeName)))
			{
				obj.TaxTypeName = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.TaxTypeName));
			}
			
			obj.IsClosed = rdr.GetBoolean(rdr.GetOrdinal(VPURPurchaseOrderFields.IsClosed));
			obj.IsVoid = rdr.GetBoolean(rdr.GetOrdinal(VPURPurchaseOrderFields.IsVoid));
			if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.ChequeNumber)))
			{
				obj.ChequeNumber = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.ChequeNumber));
			}
			
			obj.ProductName = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.ProductName));
			if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.ProductCode)))
			{
				obj.ProductCode = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.ProductCode));
			}
			
			obj.IsAcceptBatch = rdr.GetBoolean(rdr.GetOrdinal(VPURPurchaseOrderFields.IsAcceptBatch));
			obj.UserFullName = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.UserFullName));
			obj.ProductID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.ProductID));

		}