예제 #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="INVInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVInventory</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			5/3/2015 10:23:04 PM				Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static INVInventory SelectOneWithSALSalesReturnHeaderUsingInventoryID(INVInventoryPrimaryKey pk)
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool           ExecutionState  = false;
            INVInventory   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_INVInventory_SelectOneWithSALSalesReturnHeaderUsingInventoryID", ref ExecutionState);

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

                dr.NextResult();

                //Get the child records.
                obj.SALSalesReturnHeaderCollectionUsingInventoryID = SALSalesReturnHeader.PopulateObjectsFromReader(dr);
            }
            dr.Close();
            oDatabaseHelper.Dispose();
            return(obj);
        }
예제 #2
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVInventory" type="INVInventory">This INVInventory  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(INVInventory iNVInventory)
        {
            _iNVInventory = POS.DataLayer.INVInventory.SelectOne(new POS.DataLayer.INVInventoryPrimaryKey(iNVInventory.InventoryID));

            _iNVInventory.InventoryName = iNVInventory.InventoryName;
            _iNVInventory.Notes         = iNVInventory.Notes;

            return(_iNVInventory.Update());
        }
예제 #3
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVInventory" type="INVInventory">This INVInventory  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(INVInventory iNVInventory)
        {
            _iNVInventory               = new POS.DataLayer.INVInventory();
            _iNVInventory.InventoryID   = iNVInventory.InventoryID;
            _iNVInventory.InventoryName = iNVInventory.InventoryName;
            _iNVInventory.Notes         = iNVInventory.Notes;

            return(_iNVInventory.Insert());
        }
예제 #4
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVInventory</returns>
        public INVInventory SelectOne(INVInventoryPrimaryKey pk)
        {
            _iNVInventoryWCF = new INVInventory();
            _iNVInventory    = POS.DataLayer.INVInventoryBase.SelectOne(new POS.DataLayer.INVInventoryPrimaryKey(pk.InventoryID));

            _iNVInventoryWCF.InventoryID   = _iNVInventory.InventoryID;
            _iNVInventoryWCF.InventoryName = _iNVInventory.InventoryName;
            _iNVInventoryWCF.Notes         = _iNVInventory.Notes;

            return(_iNVInventoryWCF);
        }
예제 #5
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 INVInventoryCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			5/3/2015 10:23:04 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVInventoryCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            INVInventoryCollection list = new INVInventoryCollection();

            while (rdr.Read())
            {
                INVInventory obj = new INVInventory();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
            }
            return(list);
        }
예제 #6
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="INVInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVInventory</returns>
		public INVInventory SelectOne(INVInventoryPrimaryKey pk)
		{
			_iNVInventoryWCF = new INVInventory();
			_iNVInventory = POS.DataLayer.INVInventoryBase.SelectOne(new POS.DataLayer.INVInventoryPrimaryKey(pk.InventoryID));
			
				_iNVInventoryWCF.InventoryID = _iNVInventory.InventoryID;
				_iNVInventoryWCF.InventoryName = _iNVInventory.InventoryName;
				_iNVInventoryWCF.Notes = _iNVInventory.Notes;
				_iNVInventoryWCF.IsBasic = _iNVInventory.IsBasic;
				
			return _iNVInventoryWCF;
		}
예제 #7
0
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class INVInventory in the form of object of INVInventoryCollection </returns>
		public INVInventoryCollection SelectAll()
		{
			INVInventoryCollection iNVInventoryCollection = new INVInventoryCollection();
			foreach (POS.DataLayer.INVInventory _iNVInventory in POS.DataLayer.INVInventoryBase.SelectAll())
			{
				_iNVInventoryWCF = new INVInventory();
				
				_iNVInventoryWCF.InventoryID = _iNVInventory.InventoryID;
				_iNVInventoryWCF.InventoryName = _iNVInventory.InventoryName;
				_iNVInventoryWCF.Notes = _iNVInventory.Notes;
				_iNVInventoryWCF.IsBasic = _iNVInventory.IsBasic;
				
				iNVInventoryCollection.Add(_iNVInventoryWCF);
			}
			return iNVInventoryCollection;
		}
예제 #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 INVInventoryCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			5/3/2015 10:23:04 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVInventoryCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            INVInventoryCollection list = new INVInventoryCollection();

            if (rdr.Read())
            {
                INVInventory obj = new INVInventory();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new INVInventory();
                    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 INVInventoryCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			5/3/2015 10:23:04 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVInventoryCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			INVInventoryCollection list = new INVInventoryCollection();
			
			while (rdr.Read())
			{
				INVInventory obj = new INVInventory();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}
예제 #10
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="INVInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVInventory</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			5/3/2015 10:23:04 PM				Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static INVInventory SelectOneWithSALSalesReturnHeaderUsingInventoryID(INVInventoryPrimaryKey pk)
		{
			DatabaseHelper oDatabaseHelper = new DatabaseHelper();
			bool ExecutionState = false;
			INVInventory 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_INVInventory_SelectOneWithSALSalesReturnHeaderUsingInventoryID", ref ExecutionState);
			if (dr.Read())
			{
				obj= new INVInventory();
				PopulateObjectFromReader(obj,dr);
				
				dr.NextResult();
				
				//Get the child records.
				obj.SALSalesReturnHeaderCollectionUsingInventoryID=SALSalesReturnHeader.PopulateObjectsFromReader(dr);
			}
			dr.Close();  
			oDatabaseHelper.Dispose();
			return obj;
			
		}
예제 #11
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 INVInventoryCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			5/3/2015 10:23:04 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVInventoryCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			INVInventoryCollection list = new INVInventoryCollection();
			
            if (rdr.Read())
			{
				INVInventory obj = new INVInventory();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new INVInventory();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
예제 #12
0
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVInventory" type="INVInventory">This INVInventory  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(INVInventory iNVInventory)
		{
			_iNVInventory=POS.DataLayer.INVInventory.SelectOne(new POS.DataLayer.INVInventoryPrimaryKey(iNVInventory.InventoryID));
			
			_iNVInventory.InventoryName=iNVInventory.InventoryName;
			_iNVInventory.Notes=iNVInventory.Notes;
			_iNVInventory.IsBasic=iNVInventory.IsBasic;
			
			return _iNVInventory.Update();
		}
예제 #13
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 INVInventory</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 INVInventory in the form of an object of class INVInventoryCollection</returns>
		public INVInventoryCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			INVInventoryCollection iNVInventoryCollection = new INVInventoryCollection();
			foreach (POS.DataLayer.INVInventory _iNVInventory in POS.DataLayer.INVInventoryBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_iNVInventoryWCF = new INVInventory();
				
				_iNVInventoryWCF.InventoryID = _iNVInventory.InventoryID;
				_iNVInventoryWCF.InventoryName = _iNVInventory.InventoryName;
				_iNVInventoryWCF.Notes = _iNVInventory.Notes;
				_iNVInventoryWCF.IsBasic = _iNVInventory.IsBasic;
				
				iNVInventoryCollection.Add(_iNVInventoryWCF);
			}
			return iNVInventoryCollection;
		}
예제 #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.
		/// </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 INVInventory in the form of an object of class INVInventoryCollection </returns>
		public INVInventoryCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			INVInventoryCollection iNVInventoryCollection = new INVInventoryCollection();
			foreach (POS.DataLayer.INVInventory _iNVInventory in POS.DataLayer.INVInventoryBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_iNVInventoryWCF = new INVInventory();
				
				_iNVInventoryWCF.InventoryID = _iNVInventory.InventoryID;
				_iNVInventoryWCF.InventoryName = _iNVInventory.InventoryName;
				_iNVInventoryWCF.Notes = _iNVInventory.Notes;
				_iNVInventoryWCF.IsBasic = _iNVInventory.IsBasic;
				
				iNVInventoryCollection.Add(_iNVInventoryWCF);
			}
			return iNVInventoryCollection;
		}
예제 #15
0
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVInventory" type="INVInventory">This INVInventory  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(INVInventory iNVInventory)
		{
			_iNVInventory = new POS.DataLayer.INVInventory();
			_iNVInventory.InventoryID=iNVInventory.InventoryID;
			_iNVInventory.InventoryName=iNVInventory.InventoryName;
			_iNVInventory.Notes=iNVInventory.Notes;
			_iNVInventory.IsBasic=iNVInventory.IsBasic;
			
			return _iNVInventory.Insert();
		}
예제 #16
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 INVInventory</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 INVInventory in the form of an object of class INVInventoryCollection</returns>
		public INVInventoryCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
		{
			INVInventoryCollection iNVInventoryCollection = new INVInventoryCollection();
			foreach (POS.DataLayer.INVInventory _iNVInventory in POS.DataLayer.INVInventoryBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
			{
				_iNVInventoryWCF = new INVInventory();
				
				_iNVInventoryWCF.InventoryID = _iNVInventory.InventoryID;
				_iNVInventoryWCF.InventoryName = _iNVInventory.InventoryName;
				_iNVInventoryWCF.Notes = _iNVInventory.Notes;
				_iNVInventoryWCF.IsBasic = _iNVInventory.IsBasic;
				
				iNVInventoryCollection.Add(_iNVInventoryWCF);
			}
			return iNVInventoryCollection;
		}