Exemplo n.º 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 SelectOneWithSALSalesLineBatchUsingBatchID(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_SelectOneWithSALSalesLineBatchUsingBatchID", ref ExecutionState);

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

                dr.NextResult();

                //Get the child records.
                obj.SALSalesLineBatchCollectionUsingBatchID = SALSalesLineBatch.PopulateObjectsFromReader(dr);
            }
            dr.Close();
            oDatabaseHelper.Dispose();
            return(obj);
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="SALSalesLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class SALSalesLineBatch</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:04 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static SALSalesLineBatch SelectOne(SALSalesLineBatchPrimaryKey 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_SALSalesLineBatch_SelectbyPrimaryKey", ref ExecutionState);

            if (dr.Read())
            {
                SALSalesLineBatch obj = new SALSalesLineBatch();
                PopulateObjectFromReader(obj, dr);
                dr.Close();
                oDatabaseHelper.Dispose();
                return(obj);
            }
            else
            {
                dr.Close();
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
Exemplo n.º 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="SALSalesLinePrimaryKey">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 SALSalesLineBatchCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:04 PM				Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static SALSalesLineBatchCollection SelectAllByForeignKeySalesLineIDPaged(SALSalesLinePrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
        {
            DatabaseHelper oDatabaseHelper  = new DatabaseHelper();
            bool           ExecutionState   = false;
            SALSalesLineBatchCollection 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_SALSalesLineBatch_SelectAllByForeignKeySalesLineIDPaged", ref ExecutionState);

            obj = new SALSalesLineBatchCollection();
            obj = SALSalesLineBatch.PopulateObjectsFromReaderWithCheckingReader(dr, oDatabaseHelper);

            dr.Close();
            oDatabaseHelper.Dispose();
            return(obj);
        }
Exemplo n.º 4
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="sALSalesLineBatch" type="SALSalesLineBatch">This SALSalesLineBatch  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(SALSalesLineBatch sALSalesLineBatch)
        {
            _sALSalesLineBatch = new POS.DataLayer.SALSalesLineBatch();
            _sALSalesLineBatch.SalesLineBatchID = sALSalesLineBatch.SalesLineBatchID;
            _sALSalesLineBatch.SalesLineID      = sALSalesLineBatch.SalesLineID;
            _sALSalesLineBatch.BatchID          = sALSalesLineBatch.BatchID;

            return(_sALSalesLineBatch.Insert());
        }
Exemplo n.º 5
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="sALSalesLineBatch" type="SALSalesLineBatch">This SALSalesLineBatch  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(SALSalesLineBatch sALSalesLineBatch)
        {
            _sALSalesLineBatch = POS.DataLayer.SALSalesLineBatch.SelectOne(new POS.DataLayer.SALSalesLineBatchPrimaryKey(sALSalesLineBatch.SalesLineBatchID));

            _sALSalesLineBatch.SalesLineID = sALSalesLineBatch.SalesLineID;
            _sALSalesLineBatch.BatchID     = sALSalesLineBatch.BatchID;

            return(_sALSalesLineBatch.Update());
        }
Exemplo n.º 6
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="SALSalesLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class SALSalesLineBatch</returns>
        public SALSalesLineBatch SelectOne(SALSalesLineBatchPrimaryKey pk)
        {
            _sALSalesLineBatchWCF = new SALSalesLineBatch();
            _sALSalesLineBatch    = POS.DataLayer.SALSalesLineBatchBase.SelectOne(new POS.DataLayer.SALSalesLineBatchPrimaryKey(pk.SalesLineBatchID));

            _sALSalesLineBatchWCF.SalesLineBatchID = _sALSalesLineBatch.SalesLineBatchID;
            _sALSalesLineBatchWCF.SalesLineID      = _sALSalesLineBatch.SalesLineID;
            _sALSalesLineBatchWCF.BatchID          = _sALSalesLineBatch.BatchID;

            return(_sALSalesLineBatchWCF);
        }
Exemplo n.º 7
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="SALSalesLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class SALSalesLineBatch</returns>
		public SALSalesLineBatch SelectOne(SALSalesLineBatchPrimaryKey pk)
		{
			_sALSalesLineBatchWCF = new SALSalesLineBatch();
			_sALSalesLineBatch = POS.DataLayer.SALSalesLineBatchBase.SelectOne(new POS.DataLayer.SALSalesLineBatchPrimaryKey(pk.SalesLineBatchID));
			
				_sALSalesLineBatchWCF.SalesLineBatchID = _sALSalesLineBatch.SalesLineBatchID;
				_sALSalesLineBatchWCF.SalesLineID = _sALSalesLineBatch.SalesLineID;
				_sALSalesLineBatchWCF.BatchID = _sALSalesLineBatch.BatchID;
				_sALSalesLineBatchWCF.Qty = _sALSalesLineBatch.Qty;
				
			return _sALSalesLineBatchWCF;
		}
Exemplo n.º 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 SALSalesLineBatchCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:04 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static SALSalesLineBatchCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            SALSalesLineBatchCollection list = new SALSalesLineBatchCollection();

            while (rdr.Read())
            {
                SALSalesLineBatch obj = new SALSalesLineBatch();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
            }
            return(list);
        }
Exemplo n.º 9
0
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class SALSalesLineBatch in the form of object of SALSalesLineBatchCollection </returns>
		public SALSalesLineBatchCollection SelectAll()
		{
			SALSalesLineBatchCollection sALSalesLineBatchCollection = new SALSalesLineBatchCollection();
			foreach (POS.DataLayer.SALSalesLineBatch _sALSalesLineBatch in POS.DataLayer.SALSalesLineBatchBase.SelectAll())
			{
				_sALSalesLineBatchWCF = new SALSalesLineBatch();
				
				_sALSalesLineBatchWCF.SalesLineBatchID = _sALSalesLineBatch.SalesLineBatchID;
				_sALSalesLineBatchWCF.SalesLineID = _sALSalesLineBatch.SalesLineID;
				_sALSalesLineBatchWCF.BatchID = _sALSalesLineBatch.BatchID;
				_sALSalesLineBatchWCF.Qty = _sALSalesLineBatch.Qty;
				
				sALSalesLineBatchCollection.Add(_sALSalesLineBatchWCF);
			}
			return sALSalesLineBatchCollection;
		}
Exemplo n.º 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 SALSalesLineBatchCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:04 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static SALSalesLineBatchCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            SALSalesLineBatchCollection list = new SALSalesLineBatchCollection();

            if (rdr.Read())
            {
                SALSalesLineBatch obj = new SALSalesLineBatch();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new SALSalesLineBatch();
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return(list);
            }
            else
            {
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
Exemplo n.º 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 SALSalesLineBatchCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:04 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static SALSalesLineBatchCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			SALSalesLineBatchCollection list = new SALSalesLineBatchCollection();
			
			while (rdr.Read())
			{
				SALSalesLineBatch obj = new SALSalesLineBatch();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}
Exemplo n.º 12
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="SALSalesLinePrimaryKey">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 SALSalesLineBatchCollection</returns>
		public SALSalesLineBatchCollection SelectAllByForeignKeySalesLineIDPaged(SALSalesLinePrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			SALSalesLineBatchCollection sALSalesLineBatchCollection=new SALSalesLineBatchCollection();
			foreach (POS.DataLayer.SALSalesLineBatch _sALSalesLineBatch in POS.DataLayer.SALSalesLineBatchBase.SelectAllByForeignKeySalesLineIDPaged(new POS.DataLayer.SALSalesLinePrimaryKey(pk.SalesLineID), pageSize, skipPages, orderByStatement))
			{
				_sALSalesLineBatchWCF = new SALSalesLineBatch();
				_sALSalesLineBatchWCF.SalesLineBatchID = _sALSalesLineBatch.SalesLineBatchID;
				_sALSalesLineBatchWCF.SalesLineID = _sALSalesLineBatch.SalesLineID;
				_sALSalesLineBatchWCF.BatchID = _sALSalesLineBatch.BatchID;
				_sALSalesLineBatchWCF.Qty = _sALSalesLineBatch.Qty;
				
				sALSalesLineBatchCollection.Add(_sALSalesLineBatchWCF);
			}
			return sALSalesLineBatchCollection;
		}
Exemplo n.º 13
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="SALSalesLinePrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class SALSalesLineBatchCollection</returns>
		public SALSalesLineBatchCollection SelectAllByForeignKeySalesLineID(SALSalesLinePrimaryKey pk)
		{
			SALSalesLineBatchCollection sALSalesLineBatchCollection=new SALSalesLineBatchCollection();
			foreach (POS.DataLayer.SALSalesLineBatch _sALSalesLineBatch in POS.DataLayer.SALSalesLineBatchBase.SelectAllByForeignKeySalesLineID(new POS.DataLayer.SALSalesLinePrimaryKey(pk.SalesLineID)))
			{
				_sALSalesLineBatchWCF = new SALSalesLineBatch();
				_sALSalesLineBatchWCF.SalesLineBatchID = _sALSalesLineBatch.SalesLineBatchID;
				_sALSalesLineBatchWCF.SalesLineID = _sALSalesLineBatch.SalesLineID;
				_sALSalesLineBatchWCF.BatchID = _sALSalesLineBatch.BatchID;
				_sALSalesLineBatchWCF.Qty = _sALSalesLineBatch.Qty;
				
				sALSalesLineBatchCollection.Add(_sALSalesLineBatchWCF);
			}
			return sALSalesLineBatchCollection;
		}
Exemplo n.º 14
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 SALSalesLineBatch in the form of an object of class SALSalesLineBatchCollection </returns>
		public SALSalesLineBatchCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			SALSalesLineBatchCollection sALSalesLineBatchCollection = new SALSalesLineBatchCollection();
			foreach (POS.DataLayer.SALSalesLineBatch _sALSalesLineBatch in POS.DataLayer.SALSalesLineBatchBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_sALSalesLineBatchWCF = new SALSalesLineBatch();
				
				_sALSalesLineBatchWCF.SalesLineBatchID = _sALSalesLineBatch.SalesLineBatchID;
				_sALSalesLineBatchWCF.SalesLineID = _sALSalesLineBatch.SalesLineID;
				_sALSalesLineBatchWCF.BatchID = _sALSalesLineBatch.BatchID;
				_sALSalesLineBatchWCF.Qty = _sALSalesLineBatch.Qty;
				
				sALSalesLineBatchCollection.Add(_sALSalesLineBatchWCF);
			}
			return sALSalesLineBatchCollection;
		}
Exemplo n.º 15
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 SALSalesLineBatch</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 SALSalesLineBatch in the form of an object of class SALSalesLineBatchCollection</returns>
		public SALSalesLineBatchCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			SALSalesLineBatchCollection sALSalesLineBatchCollection = new SALSalesLineBatchCollection();
			foreach (POS.DataLayer.SALSalesLineBatch _sALSalesLineBatch in POS.DataLayer.SALSalesLineBatchBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_sALSalesLineBatchWCF = new SALSalesLineBatch();
				
				_sALSalesLineBatchWCF.SalesLineBatchID = _sALSalesLineBatch.SalesLineBatchID;
				_sALSalesLineBatchWCF.SalesLineID = _sALSalesLineBatch.SalesLineID;
				_sALSalesLineBatchWCF.BatchID = _sALSalesLineBatch.BatchID;
				_sALSalesLineBatchWCF.Qty = _sALSalesLineBatch.Qty;
				
				sALSalesLineBatchCollection.Add(_sALSalesLineBatchWCF);
			}
			return sALSalesLineBatchCollection;
		}
Exemplo n.º 16
0
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="sALSalesLineBatch" type="SALSalesLineBatch">This SALSalesLineBatch  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(SALSalesLineBatch sALSalesLineBatch)
		{
			_sALSalesLineBatch=POS.DataLayer.SALSalesLineBatch.SelectOne(new POS.DataLayer.SALSalesLineBatchPrimaryKey(sALSalesLineBatch.SalesLineBatchID));
			
			_sALSalesLineBatch.SalesLineID=sALSalesLineBatch.SalesLineID;
			_sALSalesLineBatch.BatchID=sALSalesLineBatch.BatchID;
			_sALSalesLineBatch.Qty=sALSalesLineBatch.Qty;
			
			return _sALSalesLineBatch.Update();
		}
Exemplo n.º 17
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="SALSalesLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class SALSalesLineBatch</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:04 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static SALSalesLineBatch SelectOne(SALSalesLineBatchPrimaryKey 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_SALSalesLineBatch_SelectbyPrimaryKey", ref ExecutionState);
			if (dr.Read())
			{
				SALSalesLineBatch obj=new SALSalesLineBatch();	
				PopulateObjectFromReader(obj,dr);
				dr.Close();              
				oDatabaseHelper.Dispose();
				return obj;
			}
			else
			{
				dr.Close();
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
Exemplo n.º 18
0
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="sALSalesLineBatch" type="SALSalesLineBatch">This SALSalesLineBatch  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(SALSalesLineBatch sALSalesLineBatch)
		{
			_sALSalesLineBatch = new POS.DataLayer.SALSalesLineBatch();
			_sALSalesLineBatch.SalesLineBatchID=sALSalesLineBatch.SalesLineBatchID;
			_sALSalesLineBatch.SalesLineID=sALSalesLineBatch.SalesLineID;
			_sALSalesLineBatch.BatchID=sALSalesLineBatch.BatchID;
			_sALSalesLineBatch.Qty=sALSalesLineBatch.Qty;
			
			return _sALSalesLineBatch.Insert();
		}
Exemplo n.º 19
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 SALSalesLineBatchCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:04 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static SALSalesLineBatchCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			SALSalesLineBatchCollection list = new SALSalesLineBatchCollection();
			
            if (rdr.Read())
			{
				SALSalesLineBatch obj = new SALSalesLineBatch();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new SALSalesLineBatch();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
Exemplo n.º 20
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 SALSalesLineBatch</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 SALSalesLineBatch in the form of an object of class SALSalesLineBatchCollection</returns>
		public SALSalesLineBatchCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
		{
			SALSalesLineBatchCollection sALSalesLineBatchCollection = new SALSalesLineBatchCollection();
			foreach (POS.DataLayer.SALSalesLineBatch _sALSalesLineBatch in POS.DataLayer.SALSalesLineBatchBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
			{
				_sALSalesLineBatchWCF = new SALSalesLineBatch();
				
				_sALSalesLineBatchWCF.SalesLineBatchID = _sALSalesLineBatch.SalesLineBatchID;
				_sALSalesLineBatchWCF.SalesLineID = _sALSalesLineBatch.SalesLineID;
				_sALSalesLineBatchWCF.BatchID = _sALSalesLineBatch.BatchID;
				_sALSalesLineBatchWCF.Qty = _sALSalesLineBatch.Qty;
				
				sALSalesLineBatchCollection.Add(_sALSalesLineBatchWCF);
			}
			return sALSalesLineBatchCollection;
		}