예제 #1
0
        /// <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="INVBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVBatch</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:56:17 PM				Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static INVBatch SelectOneWithPURPurchaseLineBatchUsingBatchID(INVBatchPrimaryKey pk)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool           ExecutionState  = false;
            INVBatch       obj             = null;

            // 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_INVBatch_SelectOneWithPURPurchaseLineBatchUsingBatchID", ref ExecutionState);

            if (dr.Read())
            {
                obj = new INVBatch();
                PopulateObjectFromReader(obj, dr);

                dr.NextResult();

                //Get the child records.
                obj.PURPurchaseLineBatchCollectionUsingBatchID = PURPurchaseLineBatch.PopulateObjectsFromReader(dr);
            }
            dr.Close();
            oDatabaseHelper.Dispose();
            return(obj);
        }
예제 #2
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="PURPurchaseLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class PURPurchaseLineBatch</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:56:14 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static PURPurchaseLineBatch SelectOne(PURPurchaseLineBatchPrimaryKey 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_PURPurchaseLineBatch_SelectbyPrimaryKey", ref ExecutionState);

            if (dr.Read())
            {
                PURPurchaseLineBatch obj = new PURPurchaseLineBatch();
                PopulateObjectFromReader(obj, dr);
                dr.Close();
                oDatabaseHelper.Dispose();
                return(obj);
            }
            else
            {
                dr.Close();
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
예제 #3
0
        /// <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="PURPurchaseLinePrimaryKey">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 PURPurchaseLineBatchCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:56:14 PM				Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static PURPurchaseLineBatchCollection SelectAllByForeignKeyPurchaseLineIDPaged(PURPurchaseLinePrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
        {
            DatabaseHelper oDatabaseHelper     = new DatabaseHelper();
            bool           ExecutionState      = false;
            PURPurchaseLineBatchCollection obj = null;

            // 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]);
            }
            oDatabaseHelper.AddParameter("@PageSize", pageSize);
            oDatabaseHelper.AddParameter("@SkipPages", skipPages);
            oDatabaseHelper.AddParameter("@OrderByStatement", orderByStatement);

            // 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_PURPurchaseLineBatch_SelectAllByForeignKeyPurchaseLineIDPaged", ref ExecutionState);

            obj = new PURPurchaseLineBatchCollection();
            obj = PURPurchaseLineBatch.PopulateObjectsFromReaderWithCheckingReader(dr, oDatabaseHelper);

            dr.Close();
            oDatabaseHelper.Dispose();
            return(obj);
        }
예제 #4
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="pURPurchaseLineBatch" type="PURPurchaseLineBatch">This PURPurchaseLineBatch  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(PURPurchaseLineBatch pURPurchaseLineBatch)
        {
            _pURPurchaseLineBatch = new POS.DataLayer.PURPurchaseLineBatch();
            _pURPurchaseLineBatch.PurchaseLineBatchID = pURPurchaseLineBatch.PurchaseLineBatchID;
            _pURPurchaseLineBatch.PurchaseLineID      = pURPurchaseLineBatch.PurchaseLineID;
            _pURPurchaseLineBatch.BatchID             = pURPurchaseLineBatch.BatchID;

            return(_pURPurchaseLineBatch.Insert());
        }
예제 #5
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="pURPurchaseLineBatch" type="PURPurchaseLineBatch">This PURPurchaseLineBatch  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(PURPurchaseLineBatch pURPurchaseLineBatch)
        {
            _pURPurchaseLineBatch = POS.DataLayer.PURPurchaseLineBatch.SelectOne(new POS.DataLayer.PURPurchaseLineBatchPrimaryKey(pURPurchaseLineBatch.PurchaseLineBatchID));

            _pURPurchaseLineBatch.PurchaseLineID = pURPurchaseLineBatch.PurchaseLineID;
            _pURPurchaseLineBatch.BatchID        = pURPurchaseLineBatch.BatchID;

            return(_pURPurchaseLineBatch.Update());
        }
예제 #6
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="PURPurchaseLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class PURPurchaseLineBatch</returns>
        public PURPurchaseLineBatch SelectOne(PURPurchaseLineBatchPrimaryKey pk)
        {
            _pURPurchaseLineBatchWCF = new PURPurchaseLineBatch();
            _pURPurchaseLineBatch    = POS.DataLayer.PURPurchaseLineBatchBase.SelectOne(new POS.DataLayer.PURPurchaseLineBatchPrimaryKey(pk.PurchaseLineBatchID));

            _pURPurchaseLineBatchWCF.PurchaseLineBatchID = _pURPurchaseLineBatch.PurchaseLineBatchID;
            _pURPurchaseLineBatchWCF.PurchaseLineID      = _pURPurchaseLineBatch.PurchaseLineID;
            _pURPurchaseLineBatchWCF.BatchID             = _pURPurchaseLineBatch.BatchID;

            return(_pURPurchaseLineBatchWCF);
        }
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="PURPurchaseLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class PURPurchaseLineBatch</returns>
		public PURPurchaseLineBatch SelectOne(PURPurchaseLineBatchPrimaryKey pk)
		{
			_pURPurchaseLineBatchWCF = new PURPurchaseLineBatch();
			_pURPurchaseLineBatch = POS.DataLayer.PURPurchaseLineBatchBase.SelectOne(new POS.DataLayer.PURPurchaseLineBatchPrimaryKey(pk.PurchaseLineBatchID));
			
				_pURPurchaseLineBatchWCF.PurchaseLineBatchID = _pURPurchaseLineBatch.PurchaseLineBatchID;
				_pURPurchaseLineBatchWCF.PurchaseLineID = _pURPurchaseLineBatch.PurchaseLineID;
				_pURPurchaseLineBatchWCF.BatchID = _pURPurchaseLineBatch.BatchID;
				_pURPurchaseLineBatchWCF.Qty = _pURPurchaseLineBatch.Qty;
				
			return _pURPurchaseLineBatchWCF;
		}
예제 #8
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 PURPurchaseLineBatchCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:56:14 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static PURPurchaseLineBatchCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            PURPurchaseLineBatchCollection list = new PURPurchaseLineBatchCollection();

            while (rdr.Read())
            {
                PURPurchaseLineBatch obj = new PURPurchaseLineBatch();
                PopulateObjectFromReader(obj, rdr);
                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 PURPurchaseLineBatch in the form of object of PURPurchaseLineBatchCollection </returns>
		public PURPurchaseLineBatchCollection SelectAll()
		{
			PURPurchaseLineBatchCollection pURPurchaseLineBatchCollection = new PURPurchaseLineBatchCollection();
			foreach (POS.DataLayer.PURPurchaseLineBatch _pURPurchaseLineBatch in POS.DataLayer.PURPurchaseLineBatchBase.SelectAll())
			{
				_pURPurchaseLineBatchWCF = new PURPurchaseLineBatch();
				
				_pURPurchaseLineBatchWCF.PurchaseLineBatchID = _pURPurchaseLineBatch.PurchaseLineBatchID;
				_pURPurchaseLineBatchWCF.PurchaseLineID = _pURPurchaseLineBatch.PurchaseLineID;
				_pURPurchaseLineBatchWCF.BatchID = _pURPurchaseLineBatch.BatchID;
				_pURPurchaseLineBatchWCF.Qty = _pURPurchaseLineBatch.Qty;
				
				pURPurchaseLineBatchCollection.Add(_pURPurchaseLineBatchWCF);
			}
			return pURPurchaseLineBatchCollection;
		}
예제 #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 PURPurchaseLineBatchCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:56:14 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static PURPurchaseLineBatchCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            PURPurchaseLineBatchCollection list = new PURPurchaseLineBatchCollection();

            if (rdr.Read())
            {
                PURPurchaseLineBatch obj = new PURPurchaseLineBatch();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new PURPurchaseLineBatch();
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return(list);
            }
            else
            {
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
		/// <summary>
		/// This method will get row(s) from the database using the value of the field specified
		/// </summary>
		///
		/// <param name="field" type="string">Field of the class PURPurchaseLineBatch</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>
		///
		/// <returns>List of object of class PURPurchaseLineBatch in the form of an object of class PURPurchaseLineBatchCollection</returns>
		public PURPurchaseLineBatchCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
		{
			PURPurchaseLineBatchCollection pURPurchaseLineBatchCollection = new PURPurchaseLineBatchCollection();
			foreach (POS.DataLayer.PURPurchaseLineBatch _pURPurchaseLineBatch in POS.DataLayer.PURPurchaseLineBatchBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
			{
				_pURPurchaseLineBatchWCF = new PURPurchaseLineBatch();
				
				_pURPurchaseLineBatchWCF.PurchaseLineBatchID = _pURPurchaseLineBatch.PurchaseLineBatchID;
				_pURPurchaseLineBatchWCF.PurchaseLineID = _pURPurchaseLineBatch.PurchaseLineID;
				_pURPurchaseLineBatchWCF.BatchID = _pURPurchaseLineBatch.BatchID;
				_pURPurchaseLineBatchWCF.Qty = _pURPurchaseLineBatch.Qty;
				
				pURPurchaseLineBatchCollection.Add(_pURPurchaseLineBatchWCF);
			}
			return pURPurchaseLineBatchCollection;
		}
		/// <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="PURPurchaseLinePrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class PURPurchaseLineBatchCollection</returns>
		public PURPurchaseLineBatchCollection SelectAllByForeignKeyPurchaseLineID(PURPurchaseLinePrimaryKey pk)
		{
			PURPurchaseLineBatchCollection pURPurchaseLineBatchCollection=new PURPurchaseLineBatchCollection();
			foreach (POS.DataLayer.PURPurchaseLineBatch _pURPurchaseLineBatch in POS.DataLayer.PURPurchaseLineBatchBase.SelectAllByForeignKeyPurchaseLineID(new POS.DataLayer.PURPurchaseLinePrimaryKey(pk.PurchaseLineID)))
			{
				_pURPurchaseLineBatchWCF = new PURPurchaseLineBatch();
				_pURPurchaseLineBatchWCF.PurchaseLineBatchID = _pURPurchaseLineBatch.PurchaseLineBatchID;
				_pURPurchaseLineBatchWCF.PurchaseLineID = _pURPurchaseLineBatch.PurchaseLineID;
				_pURPurchaseLineBatchWCF.BatchID = _pURPurchaseLineBatch.BatchID;
				_pURPurchaseLineBatchWCF.Qty = _pURPurchaseLineBatch.Qty;
				
				pURPurchaseLineBatchCollection.Add(_pURPurchaseLineBatchWCF);
			}
			return pURPurchaseLineBatchCollection;
		}
		/// <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="PURPurchaseLinePrimaryKey">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 PURPurchaseLineBatchCollection</returns>
		public PURPurchaseLineBatchCollection SelectAllByForeignKeyPurchaseLineIDPaged(PURPurchaseLinePrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			PURPurchaseLineBatchCollection pURPurchaseLineBatchCollection=new PURPurchaseLineBatchCollection();
			foreach (POS.DataLayer.PURPurchaseLineBatch _pURPurchaseLineBatch in POS.DataLayer.PURPurchaseLineBatchBase.SelectAllByForeignKeyPurchaseLineIDPaged(new POS.DataLayer.PURPurchaseLinePrimaryKey(pk.PurchaseLineID), pageSize, skipPages, orderByStatement))
			{
				_pURPurchaseLineBatchWCF = new PURPurchaseLineBatch();
				_pURPurchaseLineBatchWCF.PurchaseLineBatchID = _pURPurchaseLineBatch.PurchaseLineBatchID;
				_pURPurchaseLineBatchWCF.PurchaseLineID = _pURPurchaseLineBatch.PurchaseLineID;
				_pURPurchaseLineBatchWCF.BatchID = _pURPurchaseLineBatch.BatchID;
				_pURPurchaseLineBatchWCF.Qty = _pURPurchaseLineBatch.Qty;
				
				pURPurchaseLineBatchCollection.Add(_pURPurchaseLineBatchWCF);
			}
			return pURPurchaseLineBatchCollection;
		}
		/// <summary>
		/// This method will return a list of objects representing the specified number of entries from the specified record number in the table.
		/// </summary>
		///
		/// <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>list of objects of class PURPurchaseLineBatch in the form of an object of class PURPurchaseLineBatchCollection </returns>
		public PURPurchaseLineBatchCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			PURPurchaseLineBatchCollection pURPurchaseLineBatchCollection = new PURPurchaseLineBatchCollection();
			foreach (POS.DataLayer.PURPurchaseLineBatch _pURPurchaseLineBatch in POS.DataLayer.PURPurchaseLineBatchBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_pURPurchaseLineBatchWCF = new PURPurchaseLineBatch();
				
				_pURPurchaseLineBatchWCF.PurchaseLineBatchID = _pURPurchaseLineBatch.PurchaseLineBatchID;
				_pURPurchaseLineBatchWCF.PurchaseLineID = _pURPurchaseLineBatch.PurchaseLineID;
				_pURPurchaseLineBatchWCF.BatchID = _pURPurchaseLineBatch.BatchID;
				_pURPurchaseLineBatchWCF.Qty = _pURPurchaseLineBatch.Qty;
				
				pURPurchaseLineBatchCollection.Add(_pURPurchaseLineBatchWCF);
			}
			return pURPurchaseLineBatchCollection;
		}
예제 #15
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 PURPurchaseLineBatchCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:28 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static PURPurchaseLineBatchCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			PURPurchaseLineBatchCollection list = new PURPurchaseLineBatchCollection();
			
			while (rdr.Read())
			{
				PURPurchaseLineBatch obj = new PURPurchaseLineBatch();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}
예제 #16
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="PURPurchaseLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class PURPurchaseLineBatch</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:28 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static PURPurchaseLineBatch SelectOne(PURPurchaseLineBatchPrimaryKey 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_PURPurchaseLineBatch_SelectbyPrimaryKey", ref ExecutionState);
			if (dr.Read())
			{
				PURPurchaseLineBatch obj=new PURPurchaseLineBatch();	
				PopulateObjectFromReader(obj,dr);
				dr.Close();              
				oDatabaseHelper.Dispose();
				return obj;
			}
			else
			{
				dr.Close();
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
예제 #17
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 PURPurchaseLineBatchCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:28 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static PURPurchaseLineBatchCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			PURPurchaseLineBatchCollection list = new PURPurchaseLineBatchCollection();
			
            if (rdr.Read())
			{
				PURPurchaseLineBatch obj = new PURPurchaseLineBatch();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new PURPurchaseLineBatch();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
		/// <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 PURPurchaseLineBatch</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 PURPurchaseLineBatch in the form of an object of class PURPurchaseLineBatchCollection</returns>
		public PURPurchaseLineBatchCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			PURPurchaseLineBatchCollection pURPurchaseLineBatchCollection = new PURPurchaseLineBatchCollection();
			foreach (POS.DataLayer.PURPurchaseLineBatch _pURPurchaseLineBatch in POS.DataLayer.PURPurchaseLineBatchBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_pURPurchaseLineBatchWCF = new PURPurchaseLineBatch();
				
				_pURPurchaseLineBatchWCF.PurchaseLineBatchID = _pURPurchaseLineBatch.PurchaseLineBatchID;
				_pURPurchaseLineBatchWCF.PurchaseLineID = _pURPurchaseLineBatch.PurchaseLineID;
				_pURPurchaseLineBatchWCF.BatchID = _pURPurchaseLineBatch.BatchID;
				_pURPurchaseLineBatchWCF.Qty = _pURPurchaseLineBatch.Qty;
				
				pURPurchaseLineBatchCollection.Add(_pURPurchaseLineBatchWCF);
			}
			return pURPurchaseLineBatchCollection;
		}
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="pURPurchaseLineBatch" type="PURPurchaseLineBatch">This PURPurchaseLineBatch  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(PURPurchaseLineBatch pURPurchaseLineBatch)
		{
			_pURPurchaseLineBatch = new POS.DataLayer.PURPurchaseLineBatch();
			_pURPurchaseLineBatch.PurchaseLineBatchID=pURPurchaseLineBatch.PurchaseLineBatchID;
			_pURPurchaseLineBatch.PurchaseLineID=pURPurchaseLineBatch.PurchaseLineID;
			_pURPurchaseLineBatch.BatchID=pURPurchaseLineBatch.BatchID;
			_pURPurchaseLineBatch.Qty=pURPurchaseLineBatch.Qty;
			
			return _pURPurchaseLineBatch.Insert();
		}
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="pURPurchaseLineBatch" type="PURPurchaseLineBatch">This PURPurchaseLineBatch  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(PURPurchaseLineBatch pURPurchaseLineBatch)
		{
			_pURPurchaseLineBatch=POS.DataLayer.PURPurchaseLineBatch.SelectOne(new POS.DataLayer.PURPurchaseLineBatchPrimaryKey(pURPurchaseLineBatch.PurchaseLineBatchID));
			
			_pURPurchaseLineBatch.PurchaseLineID=pURPurchaseLineBatch.PurchaseLineID;
			_pURPurchaseLineBatch.BatchID=pURPurchaseLineBatch.BatchID;
			_pURPurchaseLineBatch.Qty=pURPurchaseLineBatch.Qty;
			
			return _pURPurchaseLineBatch.Update();
		}