Beispiel #1
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVTakingInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVTakingInventory</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:55:58 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        public static INVTakingInventory SelectOne(INVTakingInventoryPrimaryKey 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_INVTakingInventory_SelectbyPrimaryKey", ref ExecutionState);

            if (dr.Read())
            {
                INVTakingInventory obj = new INVTakingInventory();
                PopulateObjectFromReader(obj, dr);
                dr.Close();
                oDatabaseHelper.Dispose();
                return(obj);
            }
            else
            {
                dr.Close();
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
Beispiel #2
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 INVTakingInventoryCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:55:58 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVTakingInventoryCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            INVTakingInventoryCollection list = new INVTakingInventoryCollection();

            while (rdr.Read())
            {
                INVTakingInventory obj = new INVTakingInventory();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
            }
            return(list);
        }
Beispiel #3
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVTakingInventory" type="INVTakingInventory">This INVTakingInventory  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(INVTakingInventory iNVTakingInventory)
        {
            _iNVTakingInventory = POS.DataLayer.INVTakingInventory.SelectOne(new POS.DataLayer.INVTakingInventoryPrimaryKey(iNVTakingInventory.TakingHeaderID));

            _iNVTakingInventory.TakingDate  = iNVTakingInventory.TakingDate;
            _iNVTakingInventory.TakingName  = iNVTakingInventory.TakingName;
            _iNVTakingInventory.CreatedBy   = iNVTakingInventory.CreatedBy;
            _iNVTakingInventory.CreatedDate = iNVTakingInventory.CreatedDate;
            _iNVTakingInventory.UpdatedBy   = iNVTakingInventory.UpdatedBy;
            _iNVTakingInventory.UpdateDate  = iNVTakingInventory.UpdateDate;
            _iNVTakingInventory.IsDeleted   = iNVTakingInventory.IsDeleted;
            _iNVTakingInventory.DeletedBy   = iNVTakingInventory.DeletedBy;
            _iNVTakingInventory.DeletedDate = iNVTakingInventory.DeletedDate;
            _iNVTakingInventory.Notes       = iNVTakingInventory.Notes;

            return(_iNVTakingInventory.Update());
        }
Beispiel #4
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVTakingInventory" type="INVTakingInventory">This INVTakingInventory  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(INVTakingInventory iNVTakingInventory)
        {
            _iNVTakingInventory = new POS.DataLayer.INVTakingInventory();
            _iNVTakingInventory.TakingHeaderID = iNVTakingInventory.TakingHeaderID;
            _iNVTakingInventory.TakingDate     = iNVTakingInventory.TakingDate;
            _iNVTakingInventory.TakingName     = iNVTakingInventory.TakingName;
            _iNVTakingInventory.CreatedBy      = iNVTakingInventory.CreatedBy;
            _iNVTakingInventory.CreatedDate    = iNVTakingInventory.CreatedDate;
            _iNVTakingInventory.UpdatedBy      = iNVTakingInventory.UpdatedBy;
            _iNVTakingInventory.UpdateDate     = iNVTakingInventory.UpdateDate;
            _iNVTakingInventory.IsDeleted      = iNVTakingInventory.IsDeleted;
            _iNVTakingInventory.DeletedBy      = iNVTakingInventory.DeletedBy;
            _iNVTakingInventory.DeletedDate    = iNVTakingInventory.DeletedDate;
            _iNVTakingInventory.Notes          = iNVTakingInventory.Notes;

            return(_iNVTakingInventory.Insert());
        }
Beispiel #5
0
        public INVTakingInventoryCollection GetNotCommittedTaking()
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool           ExecutionState  = false;

            // 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("usp_INVTakingInventory_GetNotCommited", ref ExecutionState);

            INVTakingInventoryCollection list = new INVTakingInventoryCollection();

            while (dr.Read())
            {
                INVTakingInventory obj = new INVTakingInventory();
                obj.TakingHeaderID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryFields.TakingHeaderID));
                obj.TakingDate     = dr.GetDateTime(dr.GetOrdinal(INVTakingInventoryFields.TakingDate));
                obj.TakingName     = dr.GetString(dr.GetOrdinal(INVTakingInventoryFields.TakingName));

                if (!dr.IsDBNull(dr.GetOrdinal(INVTakingInventoryFields.Notes)))
                {
                    obj.Notes = dr.GetString(dr.GetOrdinal(INVTakingInventoryFields.Notes));
                }

                if (!dr.IsDBNull(dr.GetOrdinal(INVTakingInventoryFields.InventoryID)))
                {
                    obj.InventoryID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryFields.InventoryID));
                }
                //if (!dr.IsDBNull(dr.GetOrdinal("UserName")))
                //{
                //    obj.CreatedBy = dr.GetString(dr.GetOrdinal("UserName"));
                //}
                if (!dr.IsDBNull(dr.GetOrdinal("InventoryName")))
                {
                    obj.InventoryName = dr.GetString(dr.GetOrdinal("InventoryName"));
                }
                list.Add(obj);
            }


            dr.Close();
            oDatabaseHelper.Dispose();
            return(list);
            //usp_INVTakingInventory_GetNotCommited
        }
Beispiel #6
0
        public INVTakingInventoryCollection GetNotCommittedTaking()
        {
            DatabaseHelper oDatabaseHelper = new DatabaseHelper();
            bool ExecutionState = false;

            // 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("usp_INVTakingInventory_GetNotCommited", ref ExecutionState);

            INVTakingInventoryCollection list = new INVTakingInventoryCollection();

            while (dr.Read())
            {
                INVTakingInventory obj = new INVTakingInventory();
                 obj.TakingHeaderID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryFields.TakingHeaderID));
                obj.TakingDate = dr.GetDateTime(dr.GetOrdinal(INVTakingInventoryFields.TakingDate));
                obj.TakingName = dr.GetString(dr.GetOrdinal(INVTakingInventoryFields.TakingName));
                
                if (!dr.IsDBNull(dr.GetOrdinal(INVTakingInventoryFields.Notes)))
                {
                    obj.Notes = dr.GetString(dr.GetOrdinal(INVTakingInventoryFields.Notes));
                }

                if (!dr.IsDBNull(dr.GetOrdinal(INVTakingInventoryFields.InventoryID)))
                {
                    obj.InventoryID = dr.GetInt32(dr.GetOrdinal(INVTakingInventoryFields.InventoryID));
                }
                //if (!dr.IsDBNull(dr.GetOrdinal("UserName")))
                //{
                //    obj.CreatedBy = dr.GetString(dr.GetOrdinal("UserName"));
                //}
                if (!dr.IsDBNull(dr.GetOrdinal("InventoryName")))
                {
                    obj.InventoryName = dr.GetString(dr.GetOrdinal("InventoryName"));
                }
                list.Add(obj);
            }
            
            
            dr.Close();
            oDatabaseHelper.Dispose();
            return list;
            //usp_INVTakingInventory_GetNotCommited
        }
Beispiel #7
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVTakingInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVTakingInventory</returns>
        public INVTakingInventory SelectOne(INVTakingInventoryPrimaryKey pk)
        {
            _iNVTakingInventoryWCF = new INVTakingInventory();
            _iNVTakingInventory    = POS.DataLayer.INVTakingInventoryBase.SelectOne(new POS.DataLayer.INVTakingInventoryPrimaryKey(pk.TakingHeaderID));

            _iNVTakingInventoryWCF.TakingHeaderID = _iNVTakingInventory.TakingHeaderID;
            _iNVTakingInventoryWCF.TakingDate     = _iNVTakingInventory.TakingDate;
            _iNVTakingInventoryWCF.TakingName     = _iNVTakingInventory.TakingName;
            _iNVTakingInventoryWCF.CreatedBy      = _iNVTakingInventory.CreatedBy;
            _iNVTakingInventoryWCF.CreatedDate    = _iNVTakingInventory.CreatedDate;
            _iNVTakingInventoryWCF.UpdatedBy      = _iNVTakingInventory.UpdatedBy;
            _iNVTakingInventoryWCF.UpdateDate     = _iNVTakingInventory.UpdateDate;
            _iNVTakingInventoryWCF.IsDeleted      = _iNVTakingInventory.IsDeleted;
            _iNVTakingInventoryWCF.DeletedBy      = _iNVTakingInventory.DeletedBy;
            _iNVTakingInventoryWCF.DeletedDate    = _iNVTakingInventory.DeletedDate;
            _iNVTakingInventoryWCF.Notes          = _iNVTakingInventory.Notes;

            return(_iNVTakingInventoryWCF);
        }
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="INVTakingInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVTakingInventory</returns>
		public INVTakingInventory SelectOne(INVTakingInventoryPrimaryKey pk)
		{
			_iNVTakingInventoryWCF = new INVTakingInventory();
			_iNVTakingInventory = POS.DataLayer.INVTakingInventoryBase.SelectOne(new POS.DataLayer.INVTakingInventoryPrimaryKey(pk.TakingHeaderID));
			
				_iNVTakingInventoryWCF.TakingHeaderID = _iNVTakingInventory.TakingHeaderID;
				_iNVTakingInventoryWCF.TakingDate = _iNVTakingInventory.TakingDate;
				_iNVTakingInventoryWCF.TakingName = _iNVTakingInventory.TakingName;
				_iNVTakingInventoryWCF.CreatedBy = _iNVTakingInventory.CreatedBy;
				_iNVTakingInventoryWCF.CreatedDate = _iNVTakingInventory.CreatedDate;
				_iNVTakingInventoryWCF.UpdatedBy = _iNVTakingInventory.UpdatedBy;
				_iNVTakingInventoryWCF.UpdateDate = _iNVTakingInventory.UpdateDate;
				_iNVTakingInventoryWCF.IsDeleted = _iNVTakingInventory.IsDeleted;
				_iNVTakingInventoryWCF.DeletedBy = _iNVTakingInventory.DeletedBy;
				_iNVTakingInventoryWCF.DeletedDate = _iNVTakingInventory.DeletedDate;
				_iNVTakingInventoryWCF.Notes = _iNVTakingInventory.Notes;
				_iNVTakingInventoryWCF.InventoryID = _iNVTakingInventory.InventoryID;
				
			return _iNVTakingInventoryWCF;
		}
Beispiel #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 INVTakingInventoryCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			12/27/2014 6:55:58 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVTakingInventoryCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            INVTakingInventoryCollection list = new INVTakingInventoryCollection();

            if (rdr.Read())
            {
                INVTakingInventory obj = new INVTakingInventory();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new INVTakingInventory();
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return(list);
            }
            else
            {
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
Beispiel #10
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="INVTakingInventoryPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class INVTakingInventory</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:11 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static INVTakingInventory SelectOne(INVTakingInventoryPrimaryKey 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_INVTakingInventory_SelectbyPrimaryKey", ref ExecutionState);
			if (dr.Read())
			{
				INVTakingInventory obj=new INVTakingInventory();	
				PopulateObjectFromReader(obj,dr);
				dr.Close();              
				oDatabaseHelper.Dispose();
				return obj;
			}
			else
			{
				dr.Close();
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
Beispiel #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 INVTakingInventoryCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:11 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVTakingInventoryCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			INVTakingInventoryCollection list = new INVTakingInventoryCollection();
			
            if (rdr.Read())
			{
				INVTakingInventory obj = new INVTakingInventory();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new INVTakingInventory();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
Beispiel #12
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 INVTakingInventoryCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:11 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static INVTakingInventoryCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			INVTakingInventoryCollection list = new INVTakingInventoryCollection();
			
			while (rdr.Read())
			{
				INVTakingInventory obj = new INVTakingInventory();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVTakingInventory" type="INVTakingInventory">This INVTakingInventory  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(INVTakingInventory iNVTakingInventory)
		{
			_iNVTakingInventory=POS.DataLayer.INVTakingInventory.SelectOne(new POS.DataLayer.INVTakingInventoryPrimaryKey(iNVTakingInventory.TakingHeaderID));
			
			_iNVTakingInventory.TakingDate=iNVTakingInventory.TakingDate;
			_iNVTakingInventory.TakingName=iNVTakingInventory.TakingName;
			_iNVTakingInventory.CreatedBy=iNVTakingInventory.CreatedBy;
			_iNVTakingInventory.CreatedDate=iNVTakingInventory.CreatedDate;
			_iNVTakingInventory.UpdatedBy=iNVTakingInventory.UpdatedBy;
			_iNVTakingInventory.UpdateDate=iNVTakingInventory.UpdateDate;
			_iNVTakingInventory.IsDeleted=iNVTakingInventory.IsDeleted;
			_iNVTakingInventory.DeletedBy=iNVTakingInventory.DeletedBy;
			_iNVTakingInventory.DeletedDate=iNVTakingInventory.DeletedDate;
			_iNVTakingInventory.Notes=iNVTakingInventory.Notes;
			_iNVTakingInventory.InventoryID=iNVTakingInventory.InventoryID;
			
			return _iNVTakingInventory.Update();
		}
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="iNVTakingInventory" type="INVTakingInventory">This INVTakingInventory  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(INVTakingInventory iNVTakingInventory)
		{
			_iNVTakingInventory = new POS.DataLayer.INVTakingInventory();
			_iNVTakingInventory.TakingHeaderID=iNVTakingInventory.TakingHeaderID;
			_iNVTakingInventory.TakingDate=iNVTakingInventory.TakingDate;
			_iNVTakingInventory.TakingName=iNVTakingInventory.TakingName;
			_iNVTakingInventory.CreatedBy=iNVTakingInventory.CreatedBy;
			_iNVTakingInventory.CreatedDate=iNVTakingInventory.CreatedDate;
			_iNVTakingInventory.UpdatedBy=iNVTakingInventory.UpdatedBy;
			_iNVTakingInventory.UpdateDate=iNVTakingInventory.UpdateDate;
			_iNVTakingInventory.IsDeleted=iNVTakingInventory.IsDeleted;
			_iNVTakingInventory.DeletedBy=iNVTakingInventory.DeletedBy;
			_iNVTakingInventory.DeletedDate=iNVTakingInventory.DeletedDate;
			_iNVTakingInventory.Notes=iNVTakingInventory.Notes;
			_iNVTakingInventory.InventoryID=iNVTakingInventory.InventoryID;
			
			return _iNVTakingInventory.Insert();
		}