コード例 #1
0
        /// <summary>
        /// This method will Delete row(s) from the database using the value of the field specified
        /// </summary>
        ///
        /// <param name="field" type="VPURPurchaseOrderFields">Field of the class VPURPurchaseOrder</param>
        /// <param name="fieldValue" type="object">Value for the field specified.</param>
        /// <returns>True if succeeded</returns>
        //public bool DeleteByField(string field, object fieldValue)
        //{
        //    //return POS.DataLayer.VPURPurchaseOrderBase.DeleteByField(field, fieldValue);
        //}

        ///<summary>
        ///This method will Delete the object from the database
        ///</summary>
        ///<param name="pk" type="VPURPurchaseOrderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        /// <returns>True if succeeded</returns>
        //public bool Delete(VPURPurchaseOrderPrimaryKey pk)
        //{
        //    return POS.DataLayer.VPURPurchaseOrderBase.Delete(new POS.DataLayer.VPURPurchaseOrderPrimaryKey(pk.SupplierID, pk.PurchaseLineID, pk.PurcaseHeaderID, pk.ProductID));
        //}

        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="VPURPurchaseOrderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class VPURPurchaseOrder</returns>
        public VPURPurchaseOrder SelectOne(VPURPurchaseOrderPrimaryKey pk)
        {
            _vPURPurchaseOrderWCF = new VPURPurchaseOrder();
            _vPURPurchaseOrder    = POS.DataLayer.VPURPurchaseOrderBase.SelectOne(new POS.DataLayer.VPURPurchaseOrderPrimaryKey(pk.SupplierID, pk.PurchaseLineID, pk.PurcaseHeaderID, pk.ProductID));

            _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;

            return(_vPURPurchaseOrderWCF);
        }
コード例 #2
0
		/// <summary>
		/// This method will Delete row(s) from the database using the value of the field specified
		/// </summary>
		///
		/// <param name="field" type="VPURPurchaseOrderFields">Field of the class VPURPurchaseOrder</param>
		/// <param name="fieldValue" type="object">Value for the field specified.</param>
		/// <returns>True if succeeded</returns>
        //public bool DeleteByField(string field, object fieldValue)
        //{
        //    //return POS.DataLayer.VPURPurchaseOrderBase.DeleteByField(field, fieldValue);
        //}

		///<summary>
		///This method will Delete the object from the database
		///</summary>
		///<param name="pk" type="VPURPurchaseOrderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		/// <returns>True if succeeded</returns>
        //public bool Delete(VPURPurchaseOrderPrimaryKey pk)
        //{
        //    return POS.DataLayer.VPURPurchaseOrderBase.Delete(new POS.DataLayer.VPURPurchaseOrderPrimaryKey(pk.SupplierID, pk.PurchaseLineID, pk.PurcaseHeaderID, pk.ProductID));
        //}

		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="VPURPurchaseOrderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class VPURPurchaseOrder</returns>
		public VPURPurchaseOrder SelectOne(VPURPurchaseOrderPrimaryKey pk)
		{
			_vPURPurchaseOrderWCF = new VPURPurchaseOrder();
			_vPURPurchaseOrder = POS.DataLayer.VPURPurchaseOrderBase.SelectOne(new POS.DataLayer.VPURPurchaseOrderPrimaryKey(pk.SupplierID, pk.PurchaseLineID, pk.PurcaseHeaderID, pk.ProductID));
			
				_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;
				
			return _vPURPurchaseOrderWCF;
		}
コード例 #3
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="VPURPurchaseOrderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class VPURPurchaseOrder</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			11/4/2015 9:57:47 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static VPURPurchaseOrder SelectOne(VPURPurchaseOrderPrimaryKey pk)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool           ExecutionState  = false;

            // Pass the values of all key parameters to the stored procedure.
            System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues();
            foreach (string key in nvc.Keys)
            {
                oDatabaseHelper.AddParameter("@" + key, nvc[key]);
            }
            // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            IDataReader dr = oDatabaseHelper.ExecuteReader("gsp_VPURPurchaseOrder_SelectbyPrimaryKey", ref ExecutionState);

            if (dr.Read())
            {
                VPURPurchaseOrder obj = new VPURPurchaseOrder();
                PopulateObjectFromReader(obj, dr);
                dr.Close();
                oDatabaseHelper.Dispose();
                return(obj);
            }
            else
            {
                dr.Close();
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
コード例 #4
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);
        }
コード例 #5
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);
            }
        }
コード例 #6
0
ファイル: VPURPurchaseOrder.cs プロジェクト: kimboox44/POS
        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;

        }
コード例 #7
0
ファイル: VPURPurchaseOrder.cs プロジェクト: taiab/POS
        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);
        }
コード例 #8
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;
		}
コード例 #9
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;
		}
コード例 #10
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;
			}
			
		}
コード例 #11
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;
			
		}
コード例 #12
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="VPURPurchaseOrderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class VPURPurchaseOrder</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			11/4/2015 9:57:47 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static VPURPurchaseOrder SelectOne(VPURPurchaseOrderPrimaryKey pk)
		{
			DatabaseHelper oDatabaseHelper = new DatabaseHelper();
			bool ExecutionState = false;
			
			// Pass the values of all key parameters to the stored procedure.
			System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues();
			foreach (string key in nvc.Keys)
			{
				oDatabaseHelper.AddParameter("@" + key,nvc[key] );
			}
			// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
			oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
			
			IDataReader dr=oDatabaseHelper.ExecuteReader("gsp_VPURPurchaseOrder_SelectbyPrimaryKey", ref ExecutionState);
			if (dr.Read())
			{
				VPURPurchaseOrder obj=new VPURPurchaseOrder();	
				PopulateObjectFromReader(obj,dr);
				dr.Close();              
				oDatabaseHelper.Dispose();
				return obj;
			}
			else
			{
				dr.Close();
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}