コード例 #1
0
		/// <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;
		}
コード例 #2
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;
			
		}
コード例 #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			3/7/2015 2:37:28 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>
		/// 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;
			}
			
		}
コード例 #5
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 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;
		}
コード例 #6
0
		/// <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;
		}
コード例 #7
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>
		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;
		}
コード例 #8
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>
		///
		/// <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;
		}
コード例 #9
0
		/// <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;
		}