Exemple #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="INVAdjustStockReasonPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVAdjustStockReason</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:55:52 PM				Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static INVAdjustStockReason SelectOneWithINVAdjustStockUsingAdjustReasonID(INVAdjustStockReasonPrimaryKey pk)
        {
            DatabaseHelper       oDatabaseHelper = new DatabaseHelper();
            bool                 ExecutionState  = false;
            INVAdjustStockReason 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_INVAdjustStockReason_SelectOneWithINVAdjustStockUsingAdjustReasonID", ref ExecutionState);

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

                dr.NextResult();

                //Get the child records.
                obj.INVAdjustStockCollectionUsingAdjustReasonID = INVAdjustStock.PopulateObjectsFromReader(dr);
            }
            dr.Close();
            oDatabaseHelper.Dispose();
            return(obj);
        }
Exemple #2
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVAdjustStockReason" type="INVAdjustStockReason">This INVAdjustStockReason  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(INVAdjustStockReason iNVAdjustStockReason)
        {
            _iNVAdjustStockReason = new POS.DataLayer.INVAdjustStockReason();
            _iNVAdjustStockReason.AdjustStockReasonID   = iNVAdjustStockReason.AdjustStockReasonID;
            _iNVAdjustStockReason.AdjustStockreasonName = iNVAdjustStockReason.AdjustStockreasonName;

            return(_iNVAdjustStockReason.Insert());
        }
Exemple #3
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVAdjustStockReason" type="INVAdjustStockReason">This INVAdjustStockReason  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(INVAdjustStockReason iNVAdjustStockReason)
        {
            _iNVAdjustStockReason = POS.DataLayer.INVAdjustStockReason.SelectOne(new POS.DataLayer.INVAdjustStockReasonPrimaryKey(iNVAdjustStockReason.AdjustStockReasonID));

            _iNVAdjustStockReason.AdjustStockreasonName = iNVAdjustStockReason.AdjustStockreasonName;

            return(_iNVAdjustStockReason.Update());
        }
Exemple #4
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVAdjustStockReasonPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVAdjustStockReason</returns>
        public INVAdjustStockReason SelectOne(INVAdjustStockReasonPrimaryKey pk)
        {
            _iNVAdjustStockReasonWCF = new INVAdjustStockReason();
            _iNVAdjustStockReason    = POS.DataLayer.INVAdjustStockReasonBase.SelectOne(new POS.DataLayer.INVAdjustStockReasonPrimaryKey(pk.AdjustStockReasonID));

            _iNVAdjustStockReasonWCF.AdjustStockReasonID   = _iNVAdjustStockReason.AdjustStockReasonID;
            _iNVAdjustStockReasonWCF.AdjustStockreasonName = _iNVAdjustStockReason.AdjustStockreasonName;

            return(_iNVAdjustStockReasonWCF);
        }
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="INVAdjustStockReasonPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVAdjustStockReason</returns>
		public INVAdjustStockReason SelectOne(INVAdjustStockReasonPrimaryKey pk)
		{
			_iNVAdjustStockReasonWCF = new INVAdjustStockReason();
			_iNVAdjustStockReason = POS.DataLayer.INVAdjustStockReasonBase.SelectOne(new POS.DataLayer.INVAdjustStockReasonPrimaryKey(pk.AdjustStockReasonID));
			
				_iNVAdjustStockReasonWCF.AdjustStockReasonID = _iNVAdjustStockReason.AdjustStockReasonID;
				_iNVAdjustStockReasonWCF.AdjustStockreasonName = _iNVAdjustStockReason.AdjustStockreasonName;
				
			return _iNVAdjustStockReasonWCF;
		}
Exemple #6
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 INVAdjustStockReasonCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:55:52 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVAdjustStockReasonCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            INVAdjustStockReasonCollection list = new INVAdjustStockReasonCollection();

            while (rdr.Read())
            {
                INVAdjustStockReason obj = new INVAdjustStockReason();
                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 INVAdjustStockReason in the form of object of INVAdjustStockReasonCollection </returns>
		public INVAdjustStockReasonCollection SelectAll()
		{
			INVAdjustStockReasonCollection iNVAdjustStockReasonCollection = new INVAdjustStockReasonCollection();
			foreach (POS.DataLayer.INVAdjustStockReason _iNVAdjustStockReason in POS.DataLayer.INVAdjustStockReasonBase.SelectAll())
			{
				_iNVAdjustStockReasonWCF = new INVAdjustStockReason();
				
				_iNVAdjustStockReasonWCF.AdjustStockReasonID = _iNVAdjustStockReason.AdjustStockReasonID;
				_iNVAdjustStockReasonWCF.AdjustStockreasonName = _iNVAdjustStockReason.AdjustStockreasonName;
				
				iNVAdjustStockReasonCollection.Add(_iNVAdjustStockReasonWCF);
			}
			return iNVAdjustStockReasonCollection;
		}
Exemple #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 INVAdjustStockReasonCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:55:52 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVAdjustStockReasonCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            INVAdjustStockReasonCollection list = new INVAdjustStockReasonCollection();

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

			INVAdjustStockReasonCollection list = new INVAdjustStockReasonCollection();
			
            if (rdr.Read())
			{
				INVAdjustStockReason obj = new INVAdjustStockReason();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new INVAdjustStockReason();
					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 INVAdjustStockReasonCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:09 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVAdjustStockReasonCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			INVAdjustStockReasonCollection list = new INVAdjustStockReasonCollection();
			
			while (rdr.Read())
			{
				INVAdjustStockReason obj = new INVAdjustStockReason();
				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="INVAdjustStockReasonPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVAdjustStockReason</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:09 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static INVAdjustStockReason SelectOne(INVAdjustStockReasonPrimaryKey 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_INVAdjustStockReason_SelectbyPrimaryKey", ref ExecutionState);
			if (dr.Read())
			{
				INVAdjustStockReason obj=new INVAdjustStockReason();	
				PopulateObjectFromReader(obj,dr);
				dr.Close();              
				oDatabaseHelper.Dispose();
				return obj;
			}
			else
			{
				dr.Close();
				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 INVAdjustStockReason</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 INVAdjustStockReason in the form of an object of class INVAdjustStockReasonCollection</returns>
		public INVAdjustStockReasonCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
		{
			INVAdjustStockReasonCollection iNVAdjustStockReasonCollection = new INVAdjustStockReasonCollection();
			foreach (POS.DataLayer.INVAdjustStockReason _iNVAdjustStockReason in POS.DataLayer.INVAdjustStockReasonBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
			{
				_iNVAdjustStockReasonWCF = new INVAdjustStockReason();
				
				_iNVAdjustStockReasonWCF.AdjustStockReasonID = _iNVAdjustStockReason.AdjustStockReasonID;
				_iNVAdjustStockReasonWCF.AdjustStockreasonName = _iNVAdjustStockReason.AdjustStockreasonName;
				
				iNVAdjustStockReasonCollection.Add(_iNVAdjustStockReasonWCF);
			}
			return iNVAdjustStockReasonCollection;
		}
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVAdjustStockReason" type="INVAdjustStockReason">This INVAdjustStockReason  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(INVAdjustStockReason iNVAdjustStockReason)
		{
			_iNVAdjustStockReason=POS.DataLayer.INVAdjustStockReason.SelectOne(new POS.DataLayer.INVAdjustStockReasonPrimaryKey(iNVAdjustStockReason.AdjustStockReasonID));
			
			_iNVAdjustStockReason.AdjustStockreasonName=iNVAdjustStockReason.AdjustStockreasonName;
			
			return _iNVAdjustStockReason.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 INVAdjustStockReason</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 INVAdjustStockReason in the form of an object of class INVAdjustStockReasonCollection</returns>
		public INVAdjustStockReasonCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			INVAdjustStockReasonCollection iNVAdjustStockReasonCollection = new INVAdjustStockReasonCollection();
			foreach (POS.DataLayer.INVAdjustStockReason _iNVAdjustStockReason in POS.DataLayer.INVAdjustStockReasonBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_iNVAdjustStockReasonWCF = new INVAdjustStockReason();
				
				_iNVAdjustStockReasonWCF.AdjustStockReasonID = _iNVAdjustStockReason.AdjustStockReasonID;
				_iNVAdjustStockReasonWCF.AdjustStockreasonName = _iNVAdjustStockReason.AdjustStockreasonName;
				
				iNVAdjustStockReasonCollection.Add(_iNVAdjustStockReasonWCF);
			}
			return iNVAdjustStockReasonCollection;
		}
		/// <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 INVAdjustStockReason in the form of an object of class INVAdjustStockReasonCollection </returns>
		public INVAdjustStockReasonCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			INVAdjustStockReasonCollection iNVAdjustStockReasonCollection = new INVAdjustStockReasonCollection();
			foreach (POS.DataLayer.INVAdjustStockReason _iNVAdjustStockReason in POS.DataLayer.INVAdjustStockReasonBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_iNVAdjustStockReasonWCF = new INVAdjustStockReason();
				
				_iNVAdjustStockReasonWCF.AdjustStockReasonID = _iNVAdjustStockReason.AdjustStockReasonID;
				_iNVAdjustStockReasonWCF.AdjustStockreasonName = _iNVAdjustStockReason.AdjustStockreasonName;
				
				iNVAdjustStockReasonCollection.Add(_iNVAdjustStockReasonWCF);
			}
			return iNVAdjustStockReasonCollection;
		}
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVAdjustStockReason" type="INVAdjustStockReason">This INVAdjustStockReason  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(INVAdjustStockReason iNVAdjustStockReason)
		{
			_iNVAdjustStockReason = new POS.DataLayer.INVAdjustStockReason();
			_iNVAdjustStockReason.AdjustStockReasonID=iNVAdjustStockReason.AdjustStockReasonID;
			_iNVAdjustStockReason.AdjustStockreasonName=iNVAdjustStockReason.AdjustStockreasonName;
			
			return _iNVAdjustStockReason.Insert();
		}