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

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

                dr.NextResult();

                //Get the child records.
                obj.SALSalesHeaderCollectionUsingRefuseReasonID = SALSalesHeader.PopulateObjectsFromReader(dr);
            }
            dr.Close();
            oDatabaseHelper.Dispose();
            return(obj);
        }
Exemplo n.º 2
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="bDRefuseReason" type="BDRefuseReason">This BDRefuseReason  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(BDRefuseReason bDRefuseReason)
        {
            _bDRefuseReason = POS.DataLayer.BDRefuseReason.SelectOne(new POS.DataLayer.BDRefuseReasonPrimaryKey(bDRefuseReason.RefuseReasonID));

            _bDRefuseReason.RefuseReasonName = bDRefuseReason.RefuseReasonName;

            return(_bDRefuseReason.Update());
        }
Exemplo n.º 3
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="bDRefuseReason" type="BDRefuseReason">This BDRefuseReason  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(BDRefuseReason bDRefuseReason)
        {
            _bDRefuseReason = new POS.DataLayer.BDRefuseReason();
            _bDRefuseReason.RefuseReasonID   = bDRefuseReason.RefuseReasonID;
            _bDRefuseReason.RefuseReasonName = bDRefuseReason.RefuseReasonName;

            return(_bDRefuseReason.Insert());
        }
Exemplo n.º 4
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="BDRefuseReasonPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class BDRefuseReason</returns>
        public BDRefuseReason SelectOne(BDRefuseReasonPrimaryKey pk)
        {
            _bDRefuseReasonWCF = new BDRefuseReason();
            _bDRefuseReason    = POS.DataLayer.BDRefuseReasonBase.SelectOne(new POS.DataLayer.BDRefuseReasonPrimaryKey(pk.RefuseReasonID));

            _bDRefuseReasonWCF.RefuseReasonID   = _bDRefuseReason.RefuseReasonID;
            _bDRefuseReasonWCF.RefuseReasonName = _bDRefuseReason.RefuseReasonName;

            return(_bDRefuseReasonWCF);
        }
Exemplo n.º 5
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="BDRefuseReasonPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class BDRefuseReason</returns>
		public BDRefuseReason SelectOne(BDRefuseReasonPrimaryKey pk)
		{
			_bDRefuseReasonWCF = new BDRefuseReason();
			_bDRefuseReason = POS.DataLayer.BDRefuseReasonBase.SelectOne(new POS.DataLayer.BDRefuseReasonPrimaryKey(pk.RefuseReasonID));
			
				_bDRefuseReasonWCF.RefuseReasonID = _bDRefuseReason.RefuseReasonID;
				_bDRefuseReasonWCF.RefuseReasonName = _bDRefuseReason.RefuseReasonName;
				
			return _bDRefuseReasonWCF;
		}
Exemplo n.º 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 BDRefuseReasonCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:55:54 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static BDRefuseReasonCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            BDRefuseReasonCollection list = new BDRefuseReasonCollection();

            while (rdr.Read())
            {
                BDRefuseReason obj = new BDRefuseReason();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
            }
            return(list);
        }
Exemplo n.º 7
0
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class BDRefuseReason in the form of object of BDRefuseReasonCollection </returns>
		public BDRefuseReasonCollection SelectAll()
		{
			BDRefuseReasonCollection bDRefuseReasonCollection = new BDRefuseReasonCollection();
			foreach (POS.DataLayer.BDRefuseReason _bDRefuseReason in POS.DataLayer.BDRefuseReasonBase.SelectAll())
			{
				_bDRefuseReasonWCF = new BDRefuseReason();
				
				_bDRefuseReasonWCF.RefuseReasonID = _bDRefuseReason.RefuseReasonID;
				_bDRefuseReasonWCF.RefuseReasonName = _bDRefuseReason.RefuseReasonName;
				
				bDRefuseReasonCollection.Add(_bDRefuseReasonWCF);
			}
			return bDRefuseReasonCollection;
		}
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 BDRefuseReasonCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:55:54 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static BDRefuseReasonCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            BDRefuseReasonCollection list = new BDRefuseReasonCollection();

            if (rdr.Read())
            {
                BDRefuseReason obj = new BDRefuseReason();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new BDRefuseReason();
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return(list);
            }
            else
            {
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
Exemplo n.º 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 BDRefuseReason</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 BDRefuseReason in the form of an object of class BDRefuseReasonCollection</returns>
		public BDRefuseReasonCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
		{
			BDRefuseReasonCollection bDRefuseReasonCollection = new BDRefuseReasonCollection();
			foreach (POS.DataLayer.BDRefuseReason _bDRefuseReason in POS.DataLayer.BDRefuseReasonBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
			{
				_bDRefuseReasonWCF = new BDRefuseReason();
				
				_bDRefuseReasonWCF.RefuseReasonID = _bDRefuseReason.RefuseReasonID;
				_bDRefuseReasonWCF.RefuseReasonName = _bDRefuseReason.RefuseReasonName;
				
				bDRefuseReasonCollection.Add(_bDRefuseReasonWCF);
			}
			return bDRefuseReasonCollection;
		}
Exemplo n.º 10
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 BDRefuseReason</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 BDRefuseReason in the form of an object of class BDRefuseReasonCollection</returns>
		public BDRefuseReasonCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			BDRefuseReasonCollection bDRefuseReasonCollection = new BDRefuseReasonCollection();
			foreach (POS.DataLayer.BDRefuseReason _bDRefuseReason in POS.DataLayer.BDRefuseReasonBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_bDRefuseReasonWCF = new BDRefuseReason();
				
				_bDRefuseReasonWCF.RefuseReasonID = _bDRefuseReason.RefuseReasonID;
				_bDRefuseReasonWCF.RefuseReasonName = _bDRefuseReason.RefuseReasonName;
				
				bDRefuseReasonCollection.Add(_bDRefuseReasonWCF);
			}
			return bDRefuseReasonCollection;
		}
Exemplo n.º 11
0
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="bDRefuseReason" type="BDRefuseReason">This BDRefuseReason  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(BDRefuseReason bDRefuseReason)
		{
			_bDRefuseReason=POS.DataLayer.BDRefuseReason.SelectOne(new POS.DataLayer.BDRefuseReasonPrimaryKey(bDRefuseReason.RefuseReasonID));
			
			_bDRefuseReason.RefuseReasonName=bDRefuseReason.RefuseReasonName;
			
			return _bDRefuseReason.Update();
		}
Exemplo n.º 12
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 BDRefuseReason in the form of an object of class BDRefuseReasonCollection </returns>
		public BDRefuseReasonCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			BDRefuseReasonCollection bDRefuseReasonCollection = new BDRefuseReasonCollection();
			foreach (POS.DataLayer.BDRefuseReason _bDRefuseReason in POS.DataLayer.BDRefuseReasonBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_bDRefuseReasonWCF = new BDRefuseReason();
				
				_bDRefuseReasonWCF.RefuseReasonID = _bDRefuseReason.RefuseReasonID;
				_bDRefuseReasonWCF.RefuseReasonName = _bDRefuseReason.RefuseReasonName;
				
				bDRefuseReasonCollection.Add(_bDRefuseReasonWCF);
			}
			return bDRefuseReasonCollection;
		}
Exemplo n.º 13
0
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="bDRefuseReason" type="BDRefuseReason">This BDRefuseReason  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(BDRefuseReason bDRefuseReason)
		{
			_bDRefuseReason = new POS.DataLayer.BDRefuseReason();
			_bDRefuseReason.RefuseReasonID=bDRefuseReason.RefuseReasonID;
			_bDRefuseReason.RefuseReasonName=bDRefuseReason.RefuseReasonName;
			
			return _bDRefuseReason.Insert();
		}
Exemplo n.º 14
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 BDRefuseReasonCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:05 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static BDRefuseReasonCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			BDRefuseReasonCollection list = new BDRefuseReasonCollection();
			
            if (rdr.Read())
			{
				BDRefuseReason obj = new BDRefuseReason();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new BDRefuseReason();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
Exemplo n.º 15
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 BDRefuseReasonCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:05 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static BDRefuseReasonCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			BDRefuseReasonCollection list = new BDRefuseReasonCollection();
			
			while (rdr.Read())
			{
				BDRefuseReason obj = new BDRefuseReason();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}
Exemplo n.º 16
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="BDRefuseReasonPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class BDRefuseReason</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:05 PM				Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static BDRefuseReason SelectOneWithSALSalesHeaderUsingRefuseReasonID(BDRefuseReasonPrimaryKey pk)
		{
			DatabaseHelper oDatabaseHelper = new DatabaseHelper();
			bool ExecutionState = false;
			BDRefuseReason 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_BDRefuseReason_SelectOneWithSALSalesHeaderUsingRefuseReasonID", ref ExecutionState);
			if (dr.Read())
			{
				obj= new BDRefuseReason();
				PopulateObjectFromReader(obj,dr);
				
				dr.NextResult();
				
				//Get the child records.
				obj.SALSalesHeaderCollectionUsingRefuseReasonID=SALSalesHeader.PopulateObjectsFromReader(dr);
			}
			dr.Close();  
			oDatabaseHelper.Dispose();
			return obj;
			
		}