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

            if (dr.Read())
            {
                INVStockType obj = new INVStockType();
                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="iNVStockType" type="INVStockType">This INVStockType  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(INVStockType iNVStockType)
        {
            _iNVStockType = POS.DataLayer.INVStockType.SelectOne(new POS.DataLayer.INVStockTypePrimaryKey(iNVStockType.StockTypeID));

            _iNVStockType.StockTypeName = iNVStockType.StockTypeName;

            return(_iNVStockType.Update());
        }
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVStockType" type="INVStockType">This INVStockType  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(INVStockType iNVStockType)
        {
            _iNVStockType               = new POS.DataLayer.INVStockType();
            _iNVStockType.StockTypeID   = iNVStockType.StockTypeID;
            _iNVStockType.StockTypeName = iNVStockType.StockTypeName;

            return(_iNVStockType.Insert());
        }
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVStockTypePrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVStockType</returns>
        public INVStockType SelectOne(INVStockTypePrimaryKey pk)
        {
            _iNVStockTypeWCF = new INVStockType();
            _iNVStockType    = POS.DataLayer.INVStockTypeBase.SelectOne(new POS.DataLayer.INVStockTypePrimaryKey(pk.StockTypeID));

            _iNVStockTypeWCF.StockTypeID   = _iNVStockType.StockTypeID;
            _iNVStockTypeWCF.StockTypeName = _iNVStockType.StockTypeName;

            return(_iNVStockTypeWCF);
        }
示例#5
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="INVStockTypePrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVStockType</returns>
		public INVStockType SelectOne(INVStockTypePrimaryKey pk)
		{
			_iNVStockTypeWCF = new INVStockType();
			_iNVStockType = POS.DataLayer.INVStockTypeBase.SelectOne(new POS.DataLayer.INVStockTypePrimaryKey(pk.StockTypeID));
			
				_iNVStockTypeWCF.StockTypeID = _iNVStockType.StockTypeID;
				_iNVStockTypeWCF.StockTypeName = _iNVStockType.StockTypeName;
				
			return _iNVStockTypeWCF;
		}
示例#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 INVStockTypeCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:12 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVStockTypeCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            INVStockTypeCollection list = new INVStockTypeCollection();

            while (rdr.Read())
            {
                INVStockType obj = new INVStockType();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
            }
            return(list);
        }
示例#7
0
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class INVStockType in the form of object of INVStockTypeCollection </returns>
		public INVStockTypeCollection SelectAll()
		{
			INVStockTypeCollection iNVStockTypeCollection = new INVStockTypeCollection();
			foreach (POS.DataLayer.INVStockType _iNVStockType in POS.DataLayer.INVStockTypeBase.SelectAll())
			{
				_iNVStockTypeWCF = new INVStockType();
				
				_iNVStockTypeWCF.StockTypeID = _iNVStockType.StockTypeID;
				_iNVStockTypeWCF.StockTypeName = _iNVStockType.StockTypeName;
				
				iNVStockTypeCollection.Add(_iNVStockTypeWCF);
			}
			return iNVStockTypeCollection;
		}
示例#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 INVStockTypeCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:12 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVStockTypeCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            INVStockTypeCollection list = new INVStockTypeCollection();

            if (rdr.Read())
            {
                INVStockType obj = new INVStockType();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new INVStockType();
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return(list);
            }
            else
            {
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
示例#9
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 INVStockTypeCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:12 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVStockTypeCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			INVStockTypeCollection list = new INVStockTypeCollection();
			
            if (rdr.Read())
			{
				INVStockType obj = new INVStockType();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new INVStockType();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
示例#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 INVStockTypeCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:12 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVStockTypeCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			INVStockTypeCollection list = new INVStockTypeCollection();
			
			while (rdr.Read())
			{
				INVStockType obj = new INVStockType();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}
示例#11
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="INVStockTypePrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVStockType</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:12 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static INVStockType SelectOne(INVStockTypePrimaryKey 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_INVStockType_SelectbyPrimaryKey", ref ExecutionState);
			if (dr.Read())
			{
				INVStockType obj=new INVStockType();	
				PopulateObjectFromReader(obj,dr);
				dr.Close();              
				oDatabaseHelper.Dispose();
				return obj;
			}
			else
			{
				dr.Close();
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
示例#12
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 INVStockType</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 INVStockType in the form of an object of class INVStockTypeCollection</returns>
		public INVStockTypeCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
		{
			INVStockTypeCollection iNVStockTypeCollection = new INVStockTypeCollection();
			foreach (POS.DataLayer.INVStockType _iNVStockType in POS.DataLayer.INVStockTypeBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
			{
				_iNVStockTypeWCF = new INVStockType();
				
				_iNVStockTypeWCF.StockTypeID = _iNVStockType.StockTypeID;
				_iNVStockTypeWCF.StockTypeName = _iNVStockType.StockTypeName;
				
				iNVStockTypeCollection.Add(_iNVStockTypeWCF);
			}
			return iNVStockTypeCollection;
		}
示例#13
0
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVStockType" type="INVStockType">This INVStockType  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(INVStockType iNVStockType)
		{
			_iNVStockType=POS.DataLayer.INVStockType.SelectOne(new POS.DataLayer.INVStockTypePrimaryKey(iNVStockType.StockTypeID));
			
			_iNVStockType.StockTypeName=iNVStockType.StockTypeName;
			
			return _iNVStockType.Update();
		}
示例#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 
		/// using the value of the field specified
		/// </summary>
		///
		/// <param name="field" type="string">Field of the class INVStockType</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 INVStockType in the form of an object of class INVStockTypeCollection</returns>
		public INVStockTypeCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			INVStockTypeCollection iNVStockTypeCollection = new INVStockTypeCollection();
			foreach (POS.DataLayer.INVStockType _iNVStockType in POS.DataLayer.INVStockTypeBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_iNVStockTypeWCF = new INVStockType();
				
				_iNVStockTypeWCF.StockTypeID = _iNVStockType.StockTypeID;
				_iNVStockTypeWCF.StockTypeName = _iNVStockType.StockTypeName;
				
				iNVStockTypeCollection.Add(_iNVStockTypeWCF);
			}
			return iNVStockTypeCollection;
		}
示例#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.
		/// </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 INVStockType in the form of an object of class INVStockTypeCollection </returns>
		public INVStockTypeCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			INVStockTypeCollection iNVStockTypeCollection = new INVStockTypeCollection();
			foreach (POS.DataLayer.INVStockType _iNVStockType in POS.DataLayer.INVStockTypeBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_iNVStockTypeWCF = new INVStockType();
				
				_iNVStockTypeWCF.StockTypeID = _iNVStockType.StockTypeID;
				_iNVStockTypeWCF.StockTypeName = _iNVStockType.StockTypeName;
				
				iNVStockTypeCollection.Add(_iNVStockTypeWCF);
			}
			return iNVStockTypeCollection;
		}
示例#16
0
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVStockType" type="INVStockType">This INVStockType  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(INVStockType iNVStockType)
		{
			_iNVStockType = new POS.DataLayer.INVStockType();
			_iNVStockType.StockTypeID=iNVStockType.StockTypeID;
			_iNVStockType.StockTypeName=iNVStockType.StockTypeName;
			
			return _iNVStockType.Insert();
		}