Beispiel #1
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVTransferLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVTransferLineBatch</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:02 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static INVTransferLineBatch SelectOne(INVTransferLineBatchPrimaryKey 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_INVTransferLineBatch_SelectbyPrimaryKey", ref ExecutionState);

            if (dr.Read())
            {
                INVTransferLineBatch obj = new INVTransferLineBatch();
                PopulateObjectFromReader(obj, dr);
                dr.Close();
                oDatabaseHelper.Dispose();
                return(obj);
            }
            else
            {
                dr.Close();
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVTransferLineBatch" type="INVTransferLineBatch">This INVTransferLineBatch  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(INVTransferLineBatch iNVTransferLineBatch)
        {
            _iNVTransferLineBatch = POS.DataLayer.INVTransferLineBatch.SelectOne(new POS.DataLayer.INVTransferLineBatchPrimaryKey(iNVTransferLineBatch.TransferLineBatchID));

            _iNVTransferLineBatch.TransferLineID = iNVTransferLineBatch.TransferLineID;
            _iNVTransferLineBatch.BatchID        = iNVTransferLineBatch.BatchID;
            _iNVTransferLineBatch.Qty            = iNVTransferLineBatch.Qty;

            return(_iNVTransferLineBatch.Update());
        }
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVTransferLineBatch" type="INVTransferLineBatch">This INVTransferLineBatch  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(INVTransferLineBatch iNVTransferLineBatch)
        {
            _iNVTransferLineBatch = new POS.DataLayer.INVTransferLineBatch();
            _iNVTransferLineBatch.TransferLineBatchID = iNVTransferLineBatch.TransferLineBatchID;
            _iNVTransferLineBatch.TransferLineID      = iNVTransferLineBatch.TransferLineID;
            _iNVTransferLineBatch.BatchID             = iNVTransferLineBatch.BatchID;
            _iNVTransferLineBatch.Qty = iNVTransferLineBatch.Qty;

            return(_iNVTransferLineBatch.Insert());
        }
Beispiel #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 INVTransferLineBatchCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:02 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVTransferLineBatchCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            INVTransferLineBatchCollection list = new INVTransferLineBatchCollection();

            while (rdr.Read())
            {
                INVTransferLineBatch obj = new INVTransferLineBatch();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
            }
            return(list);
        }
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVTransferLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVTransferLineBatch</returns>
        public INVTransferLineBatch SelectOne(INVTransferLineBatchPrimaryKey pk)
        {
            _iNVTransferLineBatchWCF = new INVTransferLineBatch();
            _iNVTransferLineBatch    = POS.DataLayer.INVTransferLineBatchBase.SelectOne(new POS.DataLayer.INVTransferLineBatchPrimaryKey(pk.TransferLineBatchID));

            _iNVTransferLineBatchWCF.TransferLineBatchID = _iNVTransferLineBatch.TransferLineBatchID;
            _iNVTransferLineBatchWCF.TransferLineID      = _iNVTransferLineBatch.TransferLineID;
            _iNVTransferLineBatchWCF.BatchID             = _iNVTransferLineBatch.BatchID;
            _iNVTransferLineBatchWCF.Qty = _iNVTransferLineBatch.Qty;

            return(_iNVTransferLineBatchWCF);
        }
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="INVTransferLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVTransferLineBatch</returns>
		public INVTransferLineBatch SelectOne(INVTransferLineBatchPrimaryKey pk)
		{
			_iNVTransferLineBatchWCF = new INVTransferLineBatch();
			_iNVTransferLineBatch = POS.DataLayer.INVTransferLineBatchBase.SelectOne(new POS.DataLayer.INVTransferLineBatchPrimaryKey(pk.TransferLineBatchID));
			
				_iNVTransferLineBatchWCF.TransferLineBatchID = _iNVTransferLineBatch.TransferLineBatchID;
				_iNVTransferLineBatchWCF.TransferLineID = _iNVTransferLineBatch.TransferLineID;
				_iNVTransferLineBatchWCF.BatchID = _iNVTransferLineBatch.BatchID;
				_iNVTransferLineBatchWCF.Qty = _iNVTransferLineBatch.Qty;
				
			return _iNVTransferLineBatchWCF;
		}
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class INVTransferLineBatch in the form of object of INVTransferLineBatchCollection </returns>
		public INVTransferLineBatchCollection SelectAll()
		{
			INVTransferLineBatchCollection iNVTransferLineBatchCollection = new INVTransferLineBatchCollection();
			foreach (POS.DataLayer.INVTransferLineBatch _iNVTransferLineBatch in POS.DataLayer.INVTransferLineBatchBase.SelectAll())
			{
				_iNVTransferLineBatchWCF = new INVTransferLineBatch();
				
				_iNVTransferLineBatchWCF.TransferLineBatchID = _iNVTransferLineBatch.TransferLineBatchID;
				_iNVTransferLineBatchWCF.TransferLineID = _iNVTransferLineBatch.TransferLineID;
				_iNVTransferLineBatchWCF.BatchID = _iNVTransferLineBatch.BatchID;
				_iNVTransferLineBatchWCF.Qty = _iNVTransferLineBatch.Qty;
				
				iNVTransferLineBatchCollection.Add(_iNVTransferLineBatchWCF);
			}
			return iNVTransferLineBatchCollection;
		}
Beispiel #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 INVTransferLineBatchCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:02 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVTransferLineBatchCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            INVTransferLineBatchCollection list = new INVTransferLineBatchCollection();

            if (rdr.Read())
            {
                INVTransferLineBatch obj = new INVTransferLineBatch();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new INVTransferLineBatch();
                    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 INVTransferLineBatchCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:02 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVTransferLineBatchCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			INVTransferLineBatchCollection list = new INVTransferLineBatchCollection();
			
            if (rdr.Read())
			{
				INVTransferLineBatch obj = new INVTransferLineBatch();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new INVTransferLineBatch();
					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 INVTransferLineBatchCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:02 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVTransferLineBatchCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			INVTransferLineBatchCollection list = new INVTransferLineBatchCollection();
			
			while (rdr.Read())
			{
				INVTransferLineBatch obj = new INVTransferLineBatch();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="INVTransferLineBatchPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVTransferLineBatch</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:02 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static INVTransferLineBatch SelectOne(INVTransferLineBatchPrimaryKey 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_INVTransferLineBatch_SelectbyPrimaryKey", ref ExecutionState);
			if (dr.Read())
			{
				INVTransferLineBatch obj=new INVTransferLineBatch();	
				PopulateObjectFromReader(obj,dr);
				dr.Close();              
				oDatabaseHelper.Dispose();
				return obj;
			}
			else
			{
				dr.Close();
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVTransferLineBatch" type="INVTransferLineBatch">This INVTransferLineBatch  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(INVTransferLineBatch iNVTransferLineBatch)
		{
			_iNVTransferLineBatch=POS.DataLayer.INVTransferLineBatch.SelectOne(new POS.DataLayer.INVTransferLineBatchPrimaryKey(iNVTransferLineBatch.TransferLineBatchID));
			
			_iNVTransferLineBatch.TransferLineID=iNVTransferLineBatch.TransferLineID;
			_iNVTransferLineBatch.BatchID=iNVTransferLineBatch.BatchID;
			_iNVTransferLineBatch.Qty=iNVTransferLineBatch.Qty;
			
			return _iNVTransferLineBatch.Update();
		}
		/// <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 INVTransferLineBatch</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 INVTransferLineBatch in the form of an object of class INVTransferLineBatchCollection</returns>
		public INVTransferLineBatchCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			INVTransferLineBatchCollection iNVTransferLineBatchCollection = new INVTransferLineBatchCollection();
			foreach (POS.DataLayer.INVTransferLineBatch _iNVTransferLineBatch in POS.DataLayer.INVTransferLineBatchBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_iNVTransferLineBatchWCF = new INVTransferLineBatch();
				
				_iNVTransferLineBatchWCF.TransferLineBatchID = _iNVTransferLineBatch.TransferLineBatchID;
				_iNVTransferLineBatchWCF.TransferLineID = _iNVTransferLineBatch.TransferLineID;
				_iNVTransferLineBatchWCF.BatchID = _iNVTransferLineBatch.BatchID;
				_iNVTransferLineBatchWCF.Qty = _iNVTransferLineBatch.Qty;
				
				iNVTransferLineBatchCollection.Add(_iNVTransferLineBatchWCF);
			}
			return iNVTransferLineBatchCollection;
		}
		/// <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 INVTransferLineBatch in the form of an object of class INVTransferLineBatchCollection </returns>
		public INVTransferLineBatchCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			INVTransferLineBatchCollection iNVTransferLineBatchCollection = new INVTransferLineBatchCollection();
			foreach (POS.DataLayer.INVTransferLineBatch _iNVTransferLineBatch in POS.DataLayer.INVTransferLineBatchBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_iNVTransferLineBatchWCF = new INVTransferLineBatch();
				
				_iNVTransferLineBatchWCF.TransferLineBatchID = _iNVTransferLineBatch.TransferLineBatchID;
				_iNVTransferLineBatchWCF.TransferLineID = _iNVTransferLineBatch.TransferLineID;
				_iNVTransferLineBatchWCF.BatchID = _iNVTransferLineBatch.BatchID;
				_iNVTransferLineBatchWCF.Qty = _iNVTransferLineBatch.Qty;
				
				iNVTransferLineBatchCollection.Add(_iNVTransferLineBatchWCF);
			}
			return iNVTransferLineBatchCollection;
		}
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVTransferLineBatch" type="INVTransferLineBatch">This INVTransferLineBatch  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(INVTransferLineBatch iNVTransferLineBatch)
		{
			_iNVTransferLineBatch = new POS.DataLayer.INVTransferLineBatch();
			_iNVTransferLineBatch.TransferLineBatchID=iNVTransferLineBatch.TransferLineBatchID;
			_iNVTransferLineBatch.TransferLineID=iNVTransferLineBatch.TransferLineID;
			_iNVTransferLineBatch.BatchID=iNVTransferLineBatch.BatchID;
			_iNVTransferLineBatch.Qty=iNVTransferLineBatch.Qty;
			
			return _iNVTransferLineBatch.Insert();
		}
		/// <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 INVTransferLineBatch</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 INVTransferLineBatch in the form of an object of class INVTransferLineBatchCollection</returns>
		public INVTransferLineBatchCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
		{
			INVTransferLineBatchCollection iNVTransferLineBatchCollection = new INVTransferLineBatchCollection();
			foreach (POS.DataLayer.INVTransferLineBatch _iNVTransferLineBatch in POS.DataLayer.INVTransferLineBatchBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
			{
				_iNVTransferLineBatchWCF = new INVTransferLineBatch();
				
				_iNVTransferLineBatchWCF.TransferLineBatchID = _iNVTransferLineBatch.TransferLineBatchID;
				_iNVTransferLineBatchWCF.TransferLineID = _iNVTransferLineBatch.TransferLineID;
				_iNVTransferLineBatchWCF.BatchID = _iNVTransferLineBatch.BatchID;
				_iNVTransferLineBatchWCF.Qty = _iNVTransferLineBatch.Qty;
				
				iNVTransferLineBatchCollection.Add(_iNVTransferLineBatchWCF);
			}
			return iNVTransferLineBatchCollection;
		}