Exemple #1
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 INVTakingInventoryLine</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 INVTakingInventoryLine in the form of an object of class INVTakingInventoryLineCollection</returns>
        public INVTakingInventoryLineCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
        {
            INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection();

            foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in POS.DataLayer.INVTakingInventoryLineBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
            {
                _iNVTakingInventoryLineWCF = new INVTakingInventoryLine();

                _iNVTakingInventoryLineWCF.TakingLineID   = _iNVTakingInventoryLine.TakingLineID;
                _iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID;
                _iNVTakingInventoryLineWCF.ProductID      = _iNVTakingInventoryLine.ProductID;
                _iNVTakingInventoryLineWCF.ActualQty      = _iNVTakingInventoryLine.ActualQty;
                _iNVTakingInventoryLineWCF.ExpectedQty    = _iNVTakingInventoryLine.ExpectedQty;
                _iNVTakingInventoryLineWCF.CreatedBy      = _iNVTakingInventoryLine.CreatedBy;
                _iNVTakingInventoryLineWCF.CreateDate     = _iNVTakingInventoryLine.CreateDate;
                _iNVTakingInventoryLineWCF.UpdatedBy      = _iNVTakingInventoryLine.UpdatedBy;
                _iNVTakingInventoryLineWCF.UpdateDate     = _iNVTakingInventoryLine.UpdateDate;
                _iNVTakingInventoryLineWCF.IsDeleted      = _iNVTakingInventoryLine.IsDeleted;
                _iNVTakingInventoryLineWCF.DeletedBy      = _iNVTakingInventoryLine.DeletedBy;
                _iNVTakingInventoryLineWCF.DeleteDate     = _iNVTakingInventoryLine.DeleteDate;

                iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF);
            }
            return(iNVTakingInventoryLineCollection);
        }
Exemple #2
0
        /// <summary>
        /// This method will return a list of objects representing all records in the table.
        /// </summary>
        ///
        /// <returns>list of objects of class INVTakingInventoryLine in the form of object of INVTakingInventoryLineCollection </returns>
        public INVTakingInventoryLineCollection SelectAll()
        {
            INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection();

            foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in POS.DataLayer.INVTakingInventoryLineBase.SelectAll())
            {
                _iNVTakingInventoryLineWCF = new INVTakingInventoryLine();

                _iNVTakingInventoryLineWCF.TakingLineID   = _iNVTakingInventoryLine.TakingLineID;
                _iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID;
                _iNVTakingInventoryLineWCF.ProductID      = _iNVTakingInventoryLine.ProductID;
                _iNVTakingInventoryLineWCF.ActualQty      = _iNVTakingInventoryLine.ActualQty;
                _iNVTakingInventoryLineWCF.ExpectedQty    = _iNVTakingInventoryLine.ExpectedQty;
                _iNVTakingInventoryLineWCF.CreatedBy      = _iNVTakingInventoryLine.CreatedBy;
                _iNVTakingInventoryLineWCF.CreateDate     = _iNVTakingInventoryLine.CreateDate;
                _iNVTakingInventoryLineWCF.UpdatedBy      = _iNVTakingInventoryLine.UpdatedBy;
                _iNVTakingInventoryLineWCF.UpdateDate     = _iNVTakingInventoryLine.UpdateDate;
                _iNVTakingInventoryLineWCF.IsDeleted      = _iNVTakingInventoryLine.IsDeleted;
                _iNVTakingInventoryLineWCF.DeletedBy      = _iNVTakingInventoryLine.DeletedBy;
                _iNVTakingInventoryLineWCF.DeleteDate     = _iNVTakingInventoryLine.DeleteDate;

                iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF);
            }
            return(iNVTakingInventoryLineCollection);
        }
        /// <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="INVStockTypePrimaryKey">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 INVTakingInventoryLineCollection</returns>
        public INVTakingInventoryLineCollection SelectAllByForeignKeyStockTypeIDPaged(INVStockTypePrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
        {
            INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection();

            foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in POS.DataLayer.INVTakingInventoryLineBase.SelectAllByForeignKeyStockTypeIDPaged(new POS.DataLayer.INVStockTypePrimaryKey(pk.StockTypeID), pageSize, skipPages, orderByStatement))
            {
                _iNVTakingInventoryLineWCF = new INVTakingInventoryLine();
                _iNVTakingInventoryLineWCF.TakingLineID   = _iNVTakingInventoryLine.TakingLineID;
                _iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID;
                _iNVTakingInventoryLineWCF.ProductID      = _iNVTakingInventoryLine.ProductID;
                _iNVTakingInventoryLineWCF.ActualQty      = _iNVTakingInventoryLine.ActualQty;
                _iNVTakingInventoryLineWCF.ExpectedQty    = _iNVTakingInventoryLine.ExpectedQty;
                _iNVTakingInventoryLineWCF.CreatedBy      = _iNVTakingInventoryLine.CreatedBy;
                _iNVTakingInventoryLineWCF.CreateDate     = _iNVTakingInventoryLine.CreateDate;
                _iNVTakingInventoryLineWCF.UpdatedBy      = _iNVTakingInventoryLine.UpdatedBy;
                _iNVTakingInventoryLineWCF.UpdateDate     = _iNVTakingInventoryLine.UpdateDate;
                _iNVTakingInventoryLineWCF.IsDeleted      = _iNVTakingInventoryLine.IsDeleted;
                _iNVTakingInventoryLineWCF.DeletedBy      = _iNVTakingInventoryLine.DeletedBy;
                _iNVTakingInventoryLineWCF.DeleteDate     = _iNVTakingInventoryLine.DeleteDate;
                _iNVTakingInventoryLineWCF.StockTypeID    = _iNVTakingInventoryLine.StockTypeID;

                iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF);
            }
            return(iNVTakingInventoryLineCollection);
        }
Exemple #4
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 INVTakingInventoryLine in the form of an object of class INVTakingInventoryLineCollection </returns>
        public INVTakingInventoryLineCollection SelectAllPaged(int?pageSize, int?skipPages, string orderByStatement)
        {
            INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection();

            foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in POS.DataLayer.INVTakingInventoryLineBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
            {
                _iNVTakingInventoryLineWCF = new INVTakingInventoryLine();

                _iNVTakingInventoryLineWCF.TakingLineID   = _iNVTakingInventoryLine.TakingLineID;
                _iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID;
                _iNVTakingInventoryLineWCF.ProductID      = _iNVTakingInventoryLine.ProductID;
                _iNVTakingInventoryLineWCF.ActualQty      = _iNVTakingInventoryLine.ActualQty;
                _iNVTakingInventoryLineWCF.ExpectedQty    = _iNVTakingInventoryLine.ExpectedQty;
                _iNVTakingInventoryLineWCF.CreatedBy      = _iNVTakingInventoryLine.CreatedBy;
                _iNVTakingInventoryLineWCF.CreateDate     = _iNVTakingInventoryLine.CreateDate;
                _iNVTakingInventoryLineWCF.UpdatedBy      = _iNVTakingInventoryLine.UpdatedBy;
                _iNVTakingInventoryLineWCF.UpdateDate     = _iNVTakingInventoryLine.UpdateDate;
                _iNVTakingInventoryLineWCF.IsDeleted      = _iNVTakingInventoryLine.IsDeleted;
                _iNVTakingInventoryLineWCF.DeletedBy      = _iNVTakingInventoryLine.DeletedBy;
                _iNVTakingInventoryLineWCF.DeleteDate     = _iNVTakingInventoryLine.DeleteDate;

                iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF);
            }
            return(iNVTakingInventoryLineCollection);
        }
        public INVTakingInventoryLineCollection GetLines(int HeaderID)
        {
            INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection();

            foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in new POS.DataLayer.INVTakingInventoryLine().GetLines(HeaderID))
            {
                _iNVTakingInventoryLineWCF = new INVTakingInventoryLine();

                _iNVTakingInventoryLineWCF.TakingLineID      = _iNVTakingInventoryLine.TakingLineID;
                _iNVTakingInventoryLineWCF.TakingHeaderID    = _iNVTakingInventoryLine.TakingHeaderID;
                _iNVTakingInventoryLineWCF.ProductID         = _iNVTakingInventoryLine.ProductID;
                _iNVTakingInventoryLineWCF.ActualQty         = _iNVTakingInventoryLine.ActualQty;
                _iNVTakingInventoryLineWCF.ExpectedQty       = _iNVTakingInventoryLine.ExpectedQty;
                _iNVTakingInventoryLineWCF.ProductName       = _iNVTakingInventoryLine.ProductName;
                _iNVTakingInventoryLineWCF.IsAcceptBatch     = _iNVTakingInventoryLine.IsAcceptBatch;
                _iNVTakingInventoryLineWCF.TakingLineBatchID = _iNVTakingInventoryLine.TakingLineBatchID;
                _iNVTakingInventoryLineWCF.BatchNumber       = _iNVTakingInventoryLine.BatchNumber;
                _iNVTakingInventoryLineWCF.ExpiryDate        = _iNVTakingInventoryLine.ExpiryDate;
                _iNVTakingInventoryLineWCF.StockTypeID       = _iNVTakingInventoryLine.StockTypeID;
                _iNVTakingInventoryLineWCF.StockTypeName     = _iNVTakingInventoryLine.StockTypeName;
                iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF);
            }

            return(iNVTakingInventoryLineCollection);
        }
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class INVTakingInventoryLine in the form of object of INVTakingInventoryLineCollection </returns>
		public INVTakingInventoryLineCollection SelectAll()
		{
			INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection();
			foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in POS.DataLayer.INVTakingInventoryLineBase.SelectAll())
			{
				_iNVTakingInventoryLineWCF = new INVTakingInventoryLine();
				
				_iNVTakingInventoryLineWCF.TakingLineID = _iNVTakingInventoryLine.TakingLineID;
				_iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID;
				_iNVTakingInventoryLineWCF.ProductID = _iNVTakingInventoryLine.ProductID;
				_iNVTakingInventoryLineWCF.ActualQty = _iNVTakingInventoryLine.ActualQty;
				_iNVTakingInventoryLineWCF.ExpectedQty = _iNVTakingInventoryLine.ExpectedQty;
				_iNVTakingInventoryLineWCF.CreatedBy = _iNVTakingInventoryLine.CreatedBy;
				_iNVTakingInventoryLineWCF.CreateDate = _iNVTakingInventoryLine.CreateDate;
				_iNVTakingInventoryLineWCF.UpdatedBy = _iNVTakingInventoryLine.UpdatedBy;
				_iNVTakingInventoryLineWCF.UpdateDate = _iNVTakingInventoryLine.UpdateDate;
				_iNVTakingInventoryLineWCF.IsDeleted = _iNVTakingInventoryLine.IsDeleted;
				_iNVTakingInventoryLineWCF.DeletedBy = _iNVTakingInventoryLine.DeletedBy;
				_iNVTakingInventoryLineWCF.DeleteDate = _iNVTakingInventoryLine.DeleteDate;
				_iNVTakingInventoryLineWCF.StockTypeID = _iNVTakingInventoryLine.StockTypeID;
				
				iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF);
			}
			return iNVTakingInventoryLineCollection;
		}
        public INVTakingInventoryLineCollection GetLines(int HeaderID)
        {
            INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection();
            foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in new POS.DataLayer.INVTakingInventoryLine().GetLines(HeaderID))
            {
                _iNVTakingInventoryLineWCF = new INVTakingInventoryLine();

                _iNVTakingInventoryLineWCF.TakingLineID = _iNVTakingInventoryLine.TakingLineID;
                _iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID;
                _iNVTakingInventoryLineWCF.ProductID = _iNVTakingInventoryLine.ProductID;
                _iNVTakingInventoryLineWCF.ActualQty = _iNVTakingInventoryLine.ActualQty;
                _iNVTakingInventoryLineWCF.ExpectedQty = _iNVTakingInventoryLine.ExpectedQty;
                _iNVTakingInventoryLineWCF.ProductName = _iNVTakingInventoryLine.ProductName;
                _iNVTakingInventoryLineWCF.IsAcceptBatch = _iNVTakingInventoryLine.IsAcceptBatch;
                _iNVTakingInventoryLineWCF.TakingLineBatchID = _iNVTakingInventoryLine.TakingLineBatchID;
                _iNVTakingInventoryLineWCF.BatchNumber = _iNVTakingInventoryLine.BatchNumber;
                _iNVTakingInventoryLineWCF.ExpiryDate = _iNVTakingInventoryLine.ExpiryDate;
                _iNVTakingInventoryLineWCF.StockTypeID = _iNVTakingInventoryLine.StockTypeID;
                _iNVTakingInventoryLineWCF.StockTypeName = _iNVTakingInventoryLine.StockTypeName;
                iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF);
            }

            return iNVTakingInventoryLineCollection;
        }
		/// <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 INVTakingInventoryLine</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 INVTakingInventoryLine in the form of an object of class INVTakingInventoryLineCollection</returns>
		public INVTakingInventoryLineCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection();
			foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in POS.DataLayer.INVTakingInventoryLineBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_iNVTakingInventoryLineWCF = new INVTakingInventoryLine();
				
				_iNVTakingInventoryLineWCF.TakingLineID = _iNVTakingInventoryLine.TakingLineID;
				_iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID;
				_iNVTakingInventoryLineWCF.ProductID = _iNVTakingInventoryLine.ProductID;
				_iNVTakingInventoryLineWCF.ActualQty = _iNVTakingInventoryLine.ActualQty;
				_iNVTakingInventoryLineWCF.ExpectedQty = _iNVTakingInventoryLine.ExpectedQty;
				_iNVTakingInventoryLineWCF.CreatedBy = _iNVTakingInventoryLine.CreatedBy;
				_iNVTakingInventoryLineWCF.CreateDate = _iNVTakingInventoryLine.CreateDate;
				_iNVTakingInventoryLineWCF.UpdatedBy = _iNVTakingInventoryLine.UpdatedBy;
				_iNVTakingInventoryLineWCF.UpdateDate = _iNVTakingInventoryLine.UpdateDate;
				_iNVTakingInventoryLineWCF.IsDeleted = _iNVTakingInventoryLine.IsDeleted;
				_iNVTakingInventoryLineWCF.DeletedBy = _iNVTakingInventoryLine.DeletedBy;
				_iNVTakingInventoryLineWCF.DeleteDate = _iNVTakingInventoryLine.DeleteDate;
				_iNVTakingInventoryLineWCF.StockTypeID = _iNVTakingInventoryLine.StockTypeID;
				
				iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF);
			}
			return iNVTakingInventoryLineCollection;
		}
		/// <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 INVTakingInventoryLine in the form of an object of class INVTakingInventoryLineCollection </returns>
		public INVTakingInventoryLineCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			INVTakingInventoryLineCollection iNVTakingInventoryLineCollection = new INVTakingInventoryLineCollection();
			foreach (POS.DataLayer.INVTakingInventoryLine _iNVTakingInventoryLine in POS.DataLayer.INVTakingInventoryLineBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_iNVTakingInventoryLineWCF = new INVTakingInventoryLine();
				
				_iNVTakingInventoryLineWCF.TakingLineID = _iNVTakingInventoryLine.TakingLineID;
				_iNVTakingInventoryLineWCF.TakingHeaderID = _iNVTakingInventoryLine.TakingHeaderID;
				_iNVTakingInventoryLineWCF.ProductID = _iNVTakingInventoryLine.ProductID;
				_iNVTakingInventoryLineWCF.ActualQty = _iNVTakingInventoryLine.ActualQty;
				_iNVTakingInventoryLineWCF.ExpectedQty = _iNVTakingInventoryLine.ExpectedQty;
				_iNVTakingInventoryLineWCF.CreatedBy = _iNVTakingInventoryLine.CreatedBy;
				_iNVTakingInventoryLineWCF.CreateDate = _iNVTakingInventoryLine.CreateDate;
				_iNVTakingInventoryLineWCF.UpdatedBy = _iNVTakingInventoryLine.UpdatedBy;
				_iNVTakingInventoryLineWCF.UpdateDate = _iNVTakingInventoryLine.UpdateDate;
				_iNVTakingInventoryLineWCF.IsDeleted = _iNVTakingInventoryLine.IsDeleted;
				_iNVTakingInventoryLineWCF.DeletedBy = _iNVTakingInventoryLine.DeletedBy;
				_iNVTakingInventoryLineWCF.DeleteDate = _iNVTakingInventoryLine.DeleteDate;
				_iNVTakingInventoryLineWCF.StockTypeID = _iNVTakingInventoryLine.StockTypeID;
				
				iNVTakingInventoryLineCollection.Add(_iNVTakingInventoryLineWCF);
			}
			return iNVTakingInventoryLineCollection;
		}
        public INVTakingInventoryLineCollection GetLines(int HeaderID)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("TakingHeaderID", HeaderID);
           // oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

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

            INVTakingInventoryLineCollection list = new INVTakingInventoryLineCollection();

            while (dr.Read())
            {
                INVTakingInventoryLine obj = new INVTakingInventoryLine();
                 obj.TakingLineID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryLineFields.TakingLineID));
                 if (!dr.IsDBNull(dr.GetOrdinal("TakingLineBatchID")))
                 {
                     obj.TakingLineBatchID = dr.GetInt32(dr.GetOrdinal("TakingLineBatchID"));
                 }
                obj.ProductID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryLineFields.ProductID));
                obj.ProductName= dr.GetString(dr.GetOrdinal("ProductName"));
                obj.StockTypeName = dr.GetString(dr.GetOrdinal("StockTypeName"));
                obj.ExpectedQty = dr.GetDecimal(dr.GetOrdinal(INVTakingInventoryLineFields.ExpectedQty));
                obj.ActualQty = dr.GetDecimal(dr.GetOrdinal(INVTakingInventoryLineFields.ActualQty));
                obj.IsAcceptBatch = dr.GetBoolean(dr.GetOrdinal("IsAcceptBatch"));
                if (!dr.IsDBNull(dr.GetOrdinal("BatchNumber")))
                    obj.BatchNumber = dr.GetString(dr.GetOrdinal("BatchNumber"));
                if (!dr.IsDBNull(dr.GetOrdinal("ExpiryDate")))
                obj.ExpiryDate = dr.GetDateTime(dr.GetOrdinal("ExpiryDate"));
                list.Add(obj);
            }


            dr.Close();
            oDatabaseHelper.Dispose();
            return list;
            //usp_INVTakingInventory_GetNotCommited
        }
		/// <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="INVStockTypePrimaryKey">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 INVTakingInventoryLineCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			27/4/2015 7:28:58 PM				Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static INVTakingInventoryLineCollection SelectAllByForeignKeyStockTypeIDPaged(INVStockTypePrimaryKey pk, int pageSize, int skipPages, string orderByStatement)
		{
			DatabaseHelper oDatabaseHelper = new DatabaseHelper();
			bool ExecutionState = false;
			INVTakingInventoryLineCollection 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_INVTakingInventoryLine_SelectAllByForeignKeyStockTypeIDPaged", ref ExecutionState);
			obj = new INVTakingInventoryLineCollection();
			obj = INVTakingInventoryLine.PopulateObjectsFromReaderWithCheckingReader(dr, oDatabaseHelper);
			
			dr.Close();  
			oDatabaseHelper.Dispose();
			return obj;
			
		}
		/// <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 INVTakingInventoryLineCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			27/4/2015 7:28:58 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVTakingInventoryLineCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			INVTakingInventoryLineCollection list = new INVTakingInventoryLineCollection();
			
            if (rdr.Read())
			{
				INVTakingInventoryLine obj = new INVTakingInventoryLine();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new INVTakingInventoryLine();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
		/// <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 INVTakingInventoryLineCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			27/4/2015 7:28:58 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVTakingInventoryLineCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			INVTakingInventoryLineCollection list = new INVTakingInventoryLineCollection();
			
			while (rdr.Read())
			{
				INVTakingInventoryLine obj = new INVTakingInventoryLine();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}