示例#1
0
        /// <summary>
        /// This method will return a list of objects representing all records in the table.
        /// </summary>
        ///
        /// <returns>list of objects of class VPURPurchaseOrder in the form of object of VPURPurchaseOrderCollection </returns>
        public VPURPurchaseOrderCollection SelectAll()
        {
            VPURPurchaseOrderCollection vPURPurchaseOrderCollection = new VPURPurchaseOrderCollection();

            foreach (POS.DataLayer.VPURPurchaseOrder _vPURPurchaseOrder in POS.DataLayer.VPURPurchaseOrderBase.SelectAll())
            {
                _vPURPurchaseOrderWCF = new VPURPurchaseOrder();

                _vPURPurchaseOrderWCF.SupplierID         = _vPURPurchaseOrder.SupplierID;
                _vPURPurchaseOrderWCF.SupplierName       = _vPURPurchaseOrder.SupplierName;
                _vPURPurchaseOrderWCF.Qty                = _vPURPurchaseOrder.Qty;
                _vPURPurchaseOrderWCF.PurchaseLineID     = _vPURPurchaseOrder.PurchaseLineID;
                _vPURPurchaseOrderWCF.TotalQty           = _vPURPurchaseOrder.TotalQty;
                _vPURPurchaseOrderWCF.UnitPrice          = _vPURPurchaseOrder.UnitPrice;
                _vPURPurchaseOrderWCF.BatchNumber        = _vPURPurchaseOrder.BatchNumber;
                _vPURPurchaseOrderWCF.ExpiryDate         = _vPURPurchaseOrder.ExpiryDate;
                _vPURPurchaseOrderWCF.TaxValue           = _vPURPurchaseOrder.TaxValue;
                _vPURPurchaseOrderWCF.PurcaseHeaderID    = _vPURPurchaseOrder.PurcaseHeaderID;
                _vPURPurchaseOrderWCF.PurchaseDate       = _vPURPurchaseOrder.PurchaseDate;
                _vPURPurchaseOrderWCF.InvoiceNumber      = _vPURPurchaseOrder.InvoiceNumber;
                _vPURPurchaseOrderWCF.InvoiceDate        = _vPURPurchaseOrder.InvoiceDate;
                _vPURPurchaseOrderWCF.PaymentTypeID      = _vPURPurchaseOrder.PaymentTypeID;
                _vPURPurchaseOrderWCF.TotalDiscountRatio = _vPURPurchaseOrder.TotalDiscountRatio;
                _vPURPurchaseOrderWCF.TaxTypeName        = _vPURPurchaseOrder.TaxTypeName;
                _vPURPurchaseOrderWCF.IsClosed           = _vPURPurchaseOrder.IsClosed;
                _vPURPurchaseOrderWCF.IsVoid             = _vPURPurchaseOrder.IsVoid;
                _vPURPurchaseOrderWCF.ChequeNumber       = _vPURPurchaseOrder.ChequeNumber;
                _vPURPurchaseOrderWCF.ProductName        = _vPURPurchaseOrder.ProductName;
                _vPURPurchaseOrderWCF.ProductCode        = _vPURPurchaseOrder.ProductCode;
                _vPURPurchaseOrderWCF.IsAcceptBatch      = _vPURPurchaseOrder.IsAcceptBatch;
                _vPURPurchaseOrderWCF.UserFullName       = _vPURPurchaseOrder.UserFullName;
                _vPURPurchaseOrderWCF.ProductID          = _vPURPurchaseOrder.ProductID;

                vPURPurchaseOrderCollection.Add(_vPURPurchaseOrderWCF);
            }
            return(vPURPurchaseOrderCollection);
        }
示例#2
0
        /// <summary>
        /// This method will return a list of objects representing the specified number of entries from the specified record number in the table
        /// using the value of the field specified
        /// </summary>
        ///
        /// <param name="field" type="string">Field of the class VPURPurchaseOrder</param>
        /// <param name="fieldValue" type="object">Value for the field specified.</param>
        /// <param name="fieldValue2" type="object">Value for the field specified.</param>
        /// <param name="typeOperation" type="TypeOperation">Operator that is used if fieldValue2=null or fieldValue2="".</param>
        /// <param name="orderByStatement" type="string">The field value to number.</param>
        /// <param name="pageSize" type="int">Number of records returned.</param>
        /// <param name="skipPages" type="int">The number of missing pages.</param>
        ///
        /// <returns>List of object of class VPURPurchaseOrder in the form of an object of class VPURPurchaseOrderCollection</returns>
        public VPURPurchaseOrderCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
        {
            VPURPurchaseOrderCollection vPURPurchaseOrderCollection = new VPURPurchaseOrderCollection();

            foreach (POS.DataLayer.VPURPurchaseOrder _vPURPurchaseOrder in POS.DataLayer.VPURPurchaseOrderBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
            {
                _vPURPurchaseOrderWCF = new VPURPurchaseOrder();

                _vPURPurchaseOrderWCF.SupplierID         = _vPURPurchaseOrder.SupplierID;
                _vPURPurchaseOrderWCF.SupplierName       = _vPURPurchaseOrder.SupplierName;
                _vPURPurchaseOrderWCF.Qty                = _vPURPurchaseOrder.Qty;
                _vPURPurchaseOrderWCF.PurchaseLineID     = _vPURPurchaseOrder.PurchaseLineID;
                _vPURPurchaseOrderWCF.TotalQty           = _vPURPurchaseOrder.TotalQty;
                _vPURPurchaseOrderWCF.UnitPrice          = _vPURPurchaseOrder.UnitPrice;
                _vPURPurchaseOrderWCF.BatchNumber        = _vPURPurchaseOrder.BatchNumber;
                _vPURPurchaseOrderWCF.ExpiryDate         = _vPURPurchaseOrder.ExpiryDate;
                _vPURPurchaseOrderWCF.TaxValue           = _vPURPurchaseOrder.TaxValue;
                _vPURPurchaseOrderWCF.PurcaseHeaderID    = _vPURPurchaseOrder.PurcaseHeaderID;
                _vPURPurchaseOrderWCF.PurchaseDate       = _vPURPurchaseOrder.PurchaseDate;
                _vPURPurchaseOrderWCF.InvoiceNumber      = _vPURPurchaseOrder.InvoiceNumber;
                _vPURPurchaseOrderWCF.InvoiceDate        = _vPURPurchaseOrder.InvoiceDate;
                _vPURPurchaseOrderWCF.PaymentTypeID      = _vPURPurchaseOrder.PaymentTypeID;
                _vPURPurchaseOrderWCF.TotalDiscountRatio = _vPURPurchaseOrder.TotalDiscountRatio;
                _vPURPurchaseOrderWCF.TaxTypeName        = _vPURPurchaseOrder.TaxTypeName;
                _vPURPurchaseOrderWCF.IsClosed           = _vPURPurchaseOrder.IsClosed;
                _vPURPurchaseOrderWCF.IsVoid             = _vPURPurchaseOrder.IsVoid;
                _vPURPurchaseOrderWCF.ChequeNumber       = _vPURPurchaseOrder.ChequeNumber;
                _vPURPurchaseOrderWCF.ProductName        = _vPURPurchaseOrder.ProductName;
                _vPURPurchaseOrderWCF.ProductCode        = _vPURPurchaseOrder.ProductCode;
                _vPURPurchaseOrderWCF.IsAcceptBatch      = _vPURPurchaseOrder.IsAcceptBatch;
                _vPURPurchaseOrderWCF.UserFullName       = _vPURPurchaseOrder.UserFullName;
                _vPURPurchaseOrderWCF.ProductID          = _vPURPurchaseOrder.ProductID;

                vPURPurchaseOrderCollection.Add(_vPURPurchaseOrderWCF);
            }
            return(vPURPurchaseOrderCollection);
        }
示例#3
0
        internal static VPURPurchaseOrderCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            VPURPurchaseOrderCollection list = new VPURPurchaseOrderCollection();

            while (rdr.Read())
            {
                VPURPurchaseOrder obj = new VPURPurchaseOrder();
                obj.SupplierID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.SupplierID));
                obj.SupplierName = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.SupplierName));
                if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.Qty)))
                {
                    obj.Qty = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.Qty));
                }
                if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.PurchaseLineID)))
                {
                    obj.PurchaseLineID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.PurchaseLineID));
                    
                } if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.TotalQty)))
                {
                    obj.TotalQty = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.TotalQty)); 
                }
                if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.UnitPrice)))
                {
                    obj.UnitPrice = rdr.GetDecimal(rdr.GetOrdinal(VPURPurchaseOrderFields.UnitPrice));
                    
                } if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.BatchNumber)))
                {
                    obj.BatchNumber = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.BatchNumber));
                }
                if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.ExpiryDate)))
                {
                    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));
                }

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

                if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.IsAcceptBatch)))
                {
                    obj.IsAcceptBatch = rdr.GetBoolean(rdr.GetOrdinal(VPURPurchaseOrderFields.IsAcceptBatch)); 
                }
                if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.UserFullName)))
                {
                    obj.UserFullName = rdr.GetString(rdr.GetOrdinal(VPURPurchaseOrderFields.UserFullName)); 
                }
                if (!rdr.IsDBNull(rdr.GetOrdinal(VPURPurchaseOrderFields.ProductID)))
                {
                    obj.ProductID = rdr.GetInt32(rdr.GetOrdinal(VPURPurchaseOrderFields.ProductID)); 
                }

                list.Add(obj);
            }
            return list;

        }
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class VPURPurchaseOrder in the form of object of VPURPurchaseOrderCollection </returns>
		public VPURPurchaseOrderCollection SelectAll()
		{
			VPURPurchaseOrderCollection vPURPurchaseOrderCollection = new VPURPurchaseOrderCollection();
			foreach (POS.DataLayer.VPURPurchaseOrder _vPURPurchaseOrder in POS.DataLayer.VPURPurchaseOrderBase.SelectAll())
			{
				_vPURPurchaseOrderWCF = new VPURPurchaseOrder();
				
				_vPURPurchaseOrderWCF.SupplierID = _vPURPurchaseOrder.SupplierID;
				_vPURPurchaseOrderWCF.SupplierName = _vPURPurchaseOrder.SupplierName;
				_vPURPurchaseOrderWCF.Qty = _vPURPurchaseOrder.Qty;
				_vPURPurchaseOrderWCF.PurchaseLineID = _vPURPurchaseOrder.PurchaseLineID;
				_vPURPurchaseOrderWCF.TotalQty = _vPURPurchaseOrder.TotalQty;
				_vPURPurchaseOrderWCF.UnitPrice = _vPURPurchaseOrder.UnitPrice;
				_vPURPurchaseOrderWCF.BatchNumber = _vPURPurchaseOrder.BatchNumber;
				_vPURPurchaseOrderWCF.ExpiryDate = _vPURPurchaseOrder.ExpiryDate;
				_vPURPurchaseOrderWCF.TaxValue = _vPURPurchaseOrder.TaxValue;
				_vPURPurchaseOrderWCF.PurcaseHeaderID = _vPURPurchaseOrder.PurcaseHeaderID;
				_vPURPurchaseOrderWCF.PurchaseDate = _vPURPurchaseOrder.PurchaseDate;
				_vPURPurchaseOrderWCF.InvoiceNumber = _vPURPurchaseOrder.InvoiceNumber;
				_vPURPurchaseOrderWCF.InvoiceDate = _vPURPurchaseOrder.InvoiceDate;
				_vPURPurchaseOrderWCF.PaymentTypeID = _vPURPurchaseOrder.PaymentTypeID;
				_vPURPurchaseOrderWCF.TotalDiscountRatio = _vPURPurchaseOrder.TotalDiscountRatio;
				_vPURPurchaseOrderWCF.TaxTypeName = _vPURPurchaseOrder.TaxTypeName;
				_vPURPurchaseOrderWCF.IsClosed = _vPURPurchaseOrder.IsClosed;
				_vPURPurchaseOrderWCF.IsVoid = _vPURPurchaseOrder.IsVoid;
				_vPURPurchaseOrderWCF.ChequeNumber = _vPURPurchaseOrder.ChequeNumber;
				_vPURPurchaseOrderWCF.ProductName = _vPURPurchaseOrder.ProductName;
				_vPURPurchaseOrderWCF.ProductCode = _vPURPurchaseOrder.ProductCode;
				_vPURPurchaseOrderWCF.IsAcceptBatch = _vPURPurchaseOrder.IsAcceptBatch;
				_vPURPurchaseOrderWCF.UserFullName = _vPURPurchaseOrder.UserFullName;
				_vPURPurchaseOrderWCF.ProductID = _vPURPurchaseOrder.ProductID;
				
				vPURPurchaseOrderCollection.Add(_vPURPurchaseOrderWCF);
			}
			return vPURPurchaseOrderCollection;
		}
		/// <summary>
		/// This method will return a list of objects representing the specified number of entries from the specified record number in the table 
		/// using the value of the field specified
		/// </summary>
		///
		/// <param name="field" type="string">Field of the class VPURPurchaseOrder</param>
		/// <param name="fieldValue" type="object">Value for the field specified.</param>
		/// <param name="fieldValue2" type="object">Value for the field specified.</param>
		/// <param name="typeOperation" type="TypeOperation">Operator that is used if fieldValue2=null or fieldValue2="".</param>
		/// <param name="orderByStatement" type="string">The field value to number.</param>
		/// <param name="pageSize" type="int">Number of records returned.</param>
		/// <param name="skipPages" type="int">The number of missing pages.</param>
		///
		/// <returns>List of object of class VPURPurchaseOrder in the form of an object of class VPURPurchaseOrderCollection</returns>
		public VPURPurchaseOrderCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			VPURPurchaseOrderCollection vPURPurchaseOrderCollection = new VPURPurchaseOrderCollection();
			foreach (POS.DataLayer.VPURPurchaseOrder _vPURPurchaseOrder in POS.DataLayer.VPURPurchaseOrderBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_vPURPurchaseOrderWCF = new VPURPurchaseOrder();
				
				_vPURPurchaseOrderWCF.SupplierID = _vPURPurchaseOrder.SupplierID;
				_vPURPurchaseOrderWCF.SupplierName = _vPURPurchaseOrder.SupplierName;
				_vPURPurchaseOrderWCF.Qty = _vPURPurchaseOrder.Qty;
				_vPURPurchaseOrderWCF.PurchaseLineID = _vPURPurchaseOrder.PurchaseLineID;
				_vPURPurchaseOrderWCF.TotalQty = _vPURPurchaseOrder.TotalQty;
				_vPURPurchaseOrderWCF.UnitPrice = _vPURPurchaseOrder.UnitPrice;
				_vPURPurchaseOrderWCF.BatchNumber = _vPURPurchaseOrder.BatchNumber;
				_vPURPurchaseOrderWCF.ExpiryDate = _vPURPurchaseOrder.ExpiryDate;
				_vPURPurchaseOrderWCF.TaxValue = _vPURPurchaseOrder.TaxValue;
				_vPURPurchaseOrderWCF.PurcaseHeaderID = _vPURPurchaseOrder.PurcaseHeaderID;
				_vPURPurchaseOrderWCF.PurchaseDate = _vPURPurchaseOrder.PurchaseDate;
				_vPURPurchaseOrderWCF.InvoiceNumber = _vPURPurchaseOrder.InvoiceNumber;
				_vPURPurchaseOrderWCF.InvoiceDate = _vPURPurchaseOrder.InvoiceDate;
				_vPURPurchaseOrderWCF.PaymentTypeID = _vPURPurchaseOrder.PaymentTypeID;
				_vPURPurchaseOrderWCF.TotalDiscountRatio = _vPURPurchaseOrder.TotalDiscountRatio;
				_vPURPurchaseOrderWCF.TaxTypeName = _vPURPurchaseOrder.TaxTypeName;
				_vPURPurchaseOrderWCF.IsClosed = _vPURPurchaseOrder.IsClosed;
				_vPURPurchaseOrderWCF.IsVoid = _vPURPurchaseOrder.IsVoid;
				_vPURPurchaseOrderWCF.ChequeNumber = _vPURPurchaseOrder.ChequeNumber;
				_vPURPurchaseOrderWCF.ProductName = _vPURPurchaseOrder.ProductName;
				_vPURPurchaseOrderWCF.ProductCode = _vPURPurchaseOrder.ProductCode;
				_vPURPurchaseOrderWCF.IsAcceptBatch = _vPURPurchaseOrder.IsAcceptBatch;
				_vPURPurchaseOrderWCF.UserFullName = _vPURPurchaseOrder.UserFullName;
				_vPURPurchaseOrderWCF.ProductID = _vPURPurchaseOrder.ProductID;
				
				vPURPurchaseOrderCollection.Add(_vPURPurchaseOrderWCF);
			}
			return vPURPurchaseOrderCollection;
		}
示例#6
0
		/// <summary>
		/// Populates the fields for multiple objects from the columns found in an open reader.
		/// </summary>
		///
		/// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
		///
		/// <returns>Object of VPURPurchaseOrderCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			11/4/2015 9:57:47 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static VPURPurchaseOrderCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			VPURPurchaseOrderCollection list = new VPURPurchaseOrderCollection();
			
            if (rdr.Read())
			{
				VPURPurchaseOrder obj = new VPURPurchaseOrder();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new VPURPurchaseOrder();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
示例#7
0
		/// <summary>
		/// Populates the fields for multiple objects from the columns found in an open reader.
		/// </summary>
		///
		/// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
		///
		/// <returns>Object of VPURPurchaseOrderCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			11/4/2015 9:57:47 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static VPURPurchaseOrderCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			VPURPurchaseOrderCollection list = new VPURPurchaseOrderCollection();
			
			while (rdr.Read())
			{
				VPURPurchaseOrder obj = new VPURPurchaseOrder();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}