Ejemplo n.º 1
0
        private PURPurchaseReturnHeader GetPurchaseReturnHeader(int salesReturnHeaderID)
        {
            PURPurchaseReturnHeaderPrimaryKey pk = new PURPurchaseReturnHeaderPrimaryKey();

            pk.PurchaseReturnID = salesReturnHeaderID;
            return(pURPurchaseReturnHeaderWrapper.SelectOne(pk));
        }
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="PURPurchaseReturnHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class PURPurchaseReturnHeader</returns>
		public PURPurchaseReturnHeader SelectOne(PURPurchaseReturnHeaderPrimaryKey pk)
		{
			_pURPurchaseReturnHeaderWCF = new PURPurchaseReturnHeader();
			_pURPurchaseReturnHeader = POS.DataLayer.PURPurchaseReturnHeaderBase.SelectOne(new POS.DataLayer.PURPurchaseReturnHeaderPrimaryKey(pk.PurchaseReturnID));
			
				_pURPurchaseReturnHeaderWCF.PurchaseReturnID = _pURPurchaseReturnHeader.PurchaseReturnID;
				_pURPurchaseReturnHeaderWCF.ReturnDate = _pURPurchaseReturnHeader.ReturnDate;
				_pURPurchaseReturnHeaderWCF.OriginalHeaderID = _pURPurchaseReturnHeader.OriginalHeaderID;
				_pURPurchaseReturnHeaderWCF.CreatedBy = _pURPurchaseReturnHeader.CreatedBy;
				_pURPurchaseReturnHeaderWCF.CreateDate = _pURPurchaseReturnHeader.CreateDate;
				_pURPurchaseReturnHeaderWCF.UpdatedBy = _pURPurchaseReturnHeader.UpdatedBy;
				_pURPurchaseReturnHeaderWCF.UpdateDate = _pURPurchaseReturnHeader.UpdateDate;
				_pURPurchaseReturnHeaderWCF.IsDeleted = _pURPurchaseReturnHeader.IsDeleted;
				_pURPurchaseReturnHeaderWCF.DeletedBy = _pURPurchaseReturnHeader.DeletedBy;
				_pURPurchaseReturnHeaderWCF.DeleteDate = _pURPurchaseReturnHeader.DeleteDate;
				_pURPurchaseReturnHeaderWCF.IsClosed = _pURPurchaseReturnHeader.IsClosed;
				_pURPurchaseReturnHeaderWCF.IsVoid = _pURPurchaseReturnHeader.IsVoid;
				_pURPurchaseReturnHeaderWCF.ReturnMoney = _pURPurchaseReturnHeader.ReturnMoney;
				
			return _pURPurchaseReturnHeaderWCF;
		}
		/// <summary>
		/// This method will get row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="PURPurchaseReturnHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		/// <param name="pageSize" type="int">Number of records returned.</param>
		/// <param name="skipPages" type="int">The number of missing pages.</param>
		/// <param name="orderByStatement" type="string">The field value to number.</param>
		///
		/// <returns>object of class PURPurchaseReturnLineCollection</returns>
		public PURPurchaseReturnLineCollection SelectAllByForeignKeyPurchaseReturnHeaderIDPaged(PURPurchaseReturnHeaderPrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			PURPurchaseReturnLineCollection pURPurchaseReturnLineCollection=new PURPurchaseReturnLineCollection();
			foreach (POS.DataLayer.PURPurchaseReturnLine _pURPurchaseReturnLine in POS.DataLayer.PURPurchaseReturnLineBase.SelectAllByForeignKeyPurchaseReturnHeaderIDPaged(new POS.DataLayer.PURPurchaseReturnHeaderPrimaryKey(pk.PurchaseReturnID), pageSize, skipPages, orderByStatement))
			{
				_pURPurchaseReturnLineWCF = new PURPurchaseReturnLine();
				_pURPurchaseReturnLineWCF.PurchaseReturnLineID = _pURPurchaseReturnLine.PurchaseReturnLineID;
				_pURPurchaseReturnLineWCF.Qty = _pURPurchaseReturnLine.Qty;
				_pURPurchaseReturnLineWCF.Reason = _pURPurchaseReturnLine.Reason;
				_pURPurchaseReturnLineWCF.OriginalpurchaseLineID = _pURPurchaseReturnLine.OriginalpurchaseLineID;
				_pURPurchaseReturnLineWCF.BatchID = _pURPurchaseReturnLine.BatchID;
				_pURPurchaseReturnLineWCF.BatchNumber = _pURPurchaseReturnLine.BatchNumber;
				_pURPurchaseReturnLineWCF.ExpiryDate = _pURPurchaseReturnLine.ExpiryDate;
				_pURPurchaseReturnLineWCF.PurchaseReturnHeaderID = _pURPurchaseReturnLine.PurchaseReturnHeaderID;
				
				pURPurchaseReturnLineCollection.Add(_pURPurchaseReturnLineWCF);
			}
			return pURPurchaseReturnLineCollection;
		}
		/// <summary>
		/// This method will get row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="PURPurchaseReturnHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class PURPurchaseReturnLineCollection</returns>
		public PURPurchaseReturnLineCollection SelectAllByForeignKeyPurchaseReturnHeaderID(PURPurchaseReturnHeaderPrimaryKey pk)
		{
			PURPurchaseReturnLineCollection pURPurchaseReturnLineCollection=new PURPurchaseReturnLineCollection();
			foreach (POS.DataLayer.PURPurchaseReturnLine _pURPurchaseReturnLine in POS.DataLayer.PURPurchaseReturnLineBase.SelectAllByForeignKeyPurchaseReturnHeaderID(new POS.DataLayer.PURPurchaseReturnHeaderPrimaryKey(pk.PurchaseReturnID)))
			{
				_pURPurchaseReturnLineWCF = new PURPurchaseReturnLine();
				_pURPurchaseReturnLineWCF.PurchaseReturnLineID = _pURPurchaseReturnLine.PurchaseReturnLineID;
				_pURPurchaseReturnLineWCF.Qty = _pURPurchaseReturnLine.Qty;
				_pURPurchaseReturnLineWCF.Reason = _pURPurchaseReturnLine.Reason;
				_pURPurchaseReturnLineWCF.OriginalpurchaseLineID = _pURPurchaseReturnLine.OriginalpurchaseLineID;
				_pURPurchaseReturnLineWCF.BatchID = _pURPurchaseReturnLine.BatchID;
				_pURPurchaseReturnLineWCF.BatchNumber = _pURPurchaseReturnLine.BatchNumber;
				_pURPurchaseReturnLineWCF.ExpiryDate = _pURPurchaseReturnLine.ExpiryDate;
				_pURPurchaseReturnLineWCF.PurchaseReturnHeaderID = _pURPurchaseReturnLine.PurchaseReturnHeaderID;
				
				pURPurchaseReturnLineCollection.Add(_pURPurchaseReturnLineWCF);
			}
			return pURPurchaseReturnLineCollection;
		}
		/// <summary>
		/// This method will delete row(s) from the database using the value of the field specified 
		/// along with the details of the child table.
		/// </summary>
		///
		/// <param name="pk" type="PURPurchaseReturnHeaderPrimaryKey">Primary Key information based on which data is to be deleted.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool DeleteAllByForeignKeyPurchaseReturnHeaderID(PURPurchaseReturnHeaderPrimaryKey pk)
		{
			return POS.DataLayer.PURPurchaseReturnLineBase.DeleteAllByForeignKeyPurchaseReturnHeaderID(new POS.DataLayer.PURPurchaseReturnHeaderPrimaryKey(pk.PurchaseReturnID));
		}
		///<summary>
		///This method will Delete the object from the database
		///</summary>
		///<param name="pk" type="PURPurchaseReturnHeaderPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		/// <returns>True if succeeded</returns>
		public bool Delete(PURPurchaseReturnHeaderPrimaryKey pk)
		{
			return POS.DataLayer.PURPurchaseReturnHeaderBase.Delete(new POS.DataLayer.PURPurchaseReturnHeaderPrimaryKey(pk.PurchaseReturnID));
		}