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

            if (dr.Read())
            {
                INVTransferLine obj = new INVTransferLine();
                PopulateObjectFromReader(obj, dr);
                dr.Close();
                oDatabaseHelper.Dispose();
                return(obj);
            }
            else
            {
                dr.Close();
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
Ejemplo n.º 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 INVTransferLineCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:01 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVTransferLineCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            INVTransferLineCollection list = new INVTransferLineCollection();

            while (rdr.Read())
            {
                INVTransferLine obj = new INVTransferLine();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
            }
            return(list);
        }
Ejemplo n.º 3
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVTransferLine" type="INVTransferLine">This INVTransferLine  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(INVTransferLine iNVTransferLine)
        {
            _iNVTransferLine = POS.DataLayer.INVTransferLine.SelectOne(new POS.DataLayer.INVTransferLinePrimaryKey(iNVTransferLine.TransferLineID));

            _iNVTransferLine.TransferHeaderID = iNVTransferLine.TransferHeaderID;
            _iNVTransferLine.ProductID        = iNVTransferLine.ProductID;
            _iNVTransferLine.Qty         = iNVTransferLine.Qty;
            _iNVTransferLine.CreatedBy   = iNVTransferLine.CreatedBy;
            _iNVTransferLine.CreateDate  = iNVTransferLine.CreateDate;
            _iNVTransferLine.UpdatedBy   = iNVTransferLine.UpdatedBy;
            _iNVTransferLine.UpdateDate  = iNVTransferLine.UpdateDate;
            _iNVTransferLine.IsDeleted   = iNVTransferLine.IsDeleted;
            _iNVTransferLine.DeletedBy   = iNVTransferLine.DeletedBy;
            _iNVTransferLine.DeletedDate = iNVTransferLine.DeletedDate;

            return(_iNVTransferLine.Update());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVTransferLine" type="INVTransferLine">This INVTransferLine  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(INVTransferLine iNVTransferLine)
        {
            _iNVTransferLine = new POS.DataLayer.INVTransferLine();
            _iNVTransferLine.TransferLineID   = iNVTransferLine.TransferLineID;
            _iNVTransferLine.TransferHeaderID = iNVTransferLine.TransferHeaderID;
            _iNVTransferLine.ProductID        = iNVTransferLine.ProductID;
            _iNVTransferLine.Qty         = iNVTransferLine.Qty;
            _iNVTransferLine.CreatedBy   = iNVTransferLine.CreatedBy;
            _iNVTransferLine.CreateDate  = iNVTransferLine.CreateDate;
            _iNVTransferLine.UpdatedBy   = iNVTransferLine.UpdatedBy;
            _iNVTransferLine.UpdateDate  = iNVTransferLine.UpdateDate;
            _iNVTransferLine.IsDeleted   = iNVTransferLine.IsDeleted;
            _iNVTransferLine.DeletedBy   = iNVTransferLine.DeletedBy;
            _iNVTransferLine.DeletedDate = iNVTransferLine.DeletedDate;

            return(_iNVTransferLine.Insert());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVTransferLinePrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVTransferLine</returns>
        public INVTransferLine SelectOne(INVTransferLinePrimaryKey pk)
        {
            _iNVTransferLineWCF = new INVTransferLine();
            _iNVTransferLine    = POS.DataLayer.INVTransferLineBase.SelectOne(new POS.DataLayer.INVTransferLinePrimaryKey(pk.TransferLineID));

            _iNVTransferLineWCF.TransferLineID   = _iNVTransferLine.TransferLineID;
            _iNVTransferLineWCF.TransferHeaderID = _iNVTransferLine.TransferHeaderID;
            _iNVTransferLineWCF.ProductID        = _iNVTransferLine.ProductID;
            _iNVTransferLineWCF.Qty         = _iNVTransferLine.Qty;
            _iNVTransferLineWCF.CreatedBy   = _iNVTransferLine.CreatedBy;
            _iNVTransferLineWCF.CreateDate  = _iNVTransferLine.CreateDate;
            _iNVTransferLineWCF.UpdatedBy   = _iNVTransferLine.UpdatedBy;
            _iNVTransferLineWCF.UpdateDate  = _iNVTransferLine.UpdateDate;
            _iNVTransferLineWCF.IsDeleted   = _iNVTransferLine.IsDeleted;
            _iNVTransferLineWCF.DeletedBy   = _iNVTransferLine.DeletedBy;
            _iNVTransferLineWCF.DeletedDate = _iNVTransferLine.DeletedDate;

            return(_iNVTransferLineWCF);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="INVTransferLinePrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class INVTransferLine</returns>
        public INVTransferLine SelectOne(INVTransferLinePrimaryKey pk)
        {
            _iNVTransferLineWCF = new INVTransferLine();
            _iNVTransferLine = POS.DataLayer.INVTransferLineBase.SelectOne(new POS.DataLayer.INVTransferLinePrimaryKey(pk.TransferLineID));

            _iNVTransferLineWCF.TransferLineID = _iNVTransferLine.TransferLineID;
            _iNVTransferLineWCF.TransferHeaderID = _iNVTransferLine.TransferHeaderID;
            _iNVTransferLineWCF.ProductID = _iNVTransferLine.ProductID;
            _iNVTransferLineWCF.Qty = _iNVTransferLine.Qty;
            _iNVTransferLineWCF.CreatedBy = _iNVTransferLine.CreatedBy;
            _iNVTransferLineWCF.CreateDate = _iNVTransferLine.CreateDate;
            _iNVTransferLineWCF.UpdatedBy = _iNVTransferLine.UpdatedBy;
            _iNVTransferLineWCF.UpdateDate = _iNVTransferLine.UpdateDate;
            _iNVTransferLineWCF.IsDeleted = _iNVTransferLine.IsDeleted;
            _iNVTransferLineWCF.DeletedBy = _iNVTransferLine.DeletedBy;
            _iNVTransferLineWCF.DeletedDate = _iNVTransferLine.DeletedDate;

            return _iNVTransferLineWCF;
        }
Ejemplo n.º 7
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 INVTransferLineCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:01 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static INVTransferLineCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            INVTransferLineCollection list = new INVTransferLineCollection();

            if (rdr.Read())
            {
                INVTransferLine obj = new INVTransferLine();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new INVTransferLine();
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return(list);
            }
            else
            {
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
Ejemplo n.º 8
0
        private bool CommitDetails(DatabaseHelper oDatabaseHelper, INVTransferLine transferLine)
        {
            bool ExecutionState = false;
            // Pass the value of '_TransferHeaderID' as parameter 'TransferHeaderID' of the stored procedure.
            oDatabaseHelper.AddParameter("@TransferLineID", transferLine.TransferLineID);
            oDatabaseHelper.AddParameter("@TransferHeaderID", transferLine.TransferHeaderID);
            // Pass the value of '_productID' as parameter 'ProductID' of the stored procedure.
            if (transferLine.ProductID != null)
                oDatabaseHelper.AddParameter("@ProductID", transferLine.ProductID);
            else
                oDatabaseHelper.AddParameter("@ProductID", DBNull.Value);
            // Pass the value of '_Qty' as parameter 'Qty' of the stored procedure.
            if (transferLine.Qty != null)
                oDatabaseHelper.AddParameter("@Qty", transferLine.Qty);
            else
                oDatabaseHelper.AddParameter("@Qty", DBNull.Value);
            // Pass the value of '_createdBy' as parameter 'CreatedBy' of the stored procedure.
            if (transferLine.CreatedBy != null)
                oDatabaseHelper.AddParameter("@CreatedBy", transferLine.CreatedBy);
            else
                oDatabaseHelper.AddParameter("@CreatedBy", DBNull.Value);
            // Pass the value of '_createDate' as parameter 'CreateDate' of the stored procedure.
            if (transferLine.CreateDate != null)
                oDatabaseHelper.AddParameter("@CreateDate", transferLine.CreateDate);
            else
                oDatabaseHelper.AddParameter("@CreateDate", DBNull.Value);
            // Pass the value of '_updatedBy' as parameter 'UpdatedBy' of the stored procedure.
            if (transferLine.UpdatedBy != null)
                oDatabaseHelper.AddParameter("@UpdatedBy", transferLine.UpdatedBy);
            else
                oDatabaseHelper.AddParameter("@UpdatedBy", DBNull.Value);
            // Pass the value of '_updateDate' as parameter 'UpdateDate' of the stored procedure.
            if (transferLine.UpdateDate != null)
                oDatabaseHelper.AddParameter("@UpdateDate", transferLine.UpdateDate);
            else
                oDatabaseHelper.AddParameter("@UpdateDate", DBNull.Value);
            // Pass the value of '_isDeleted' as parameter 'IsDeleted' of the stored procedure.
            if (transferLine.IsDeleted != null)
                oDatabaseHelper.AddParameter("@IsDeleted", transferLine.IsDeleted);
            else
                oDatabaseHelper.AddParameter("@IsDeleted", DBNull.Value);
            // Pass the value of '_deletedBy' as parameter 'DeletedBy' of the stored procedure.
            if (transferLine.DeletedBy != null)
                oDatabaseHelper.AddParameter("@DeletedBy", transferLine.DeletedBy);
            else
                oDatabaseHelper.AddParameter("@DeletedBy", DBNull.Value);
            // Pass the value of '_deleteDate' as parameter 'DeleteDate' of the stored procedure.
            if (transferLine.DeletedDate != null)
                oDatabaseHelper.AddParameter("@DeletedDate", transferLine.DeletedDate);
            else
                oDatabaseHelper.AddParameter("@DeletedDate", DBNull.Value);
            // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            oDatabaseHelper.ExecuteScalar("usp_INVTransferLine_Commit", CommandType.StoredProcedure, ConnectionState.KeepOpen, ref ExecutionState);

            return ExecutionState;
        }
Ejemplo n.º 9
0
        private bool CommitDetails(DatabaseHelper oDatabaseHelper, INVTransferLine transferLine)
        {
            bool ExecutionState = false;

            // Pass the value of '_TransferHeaderID' as parameter 'TransferHeaderID' of the stored procedure.
            oDatabaseHelper.AddParameter("@TransferLineID", transferLine.TransferLineID);
            oDatabaseHelper.AddParameter("@TransferHeaderID", transferLine.TransferHeaderID);
            // Pass the value of '_productID' as parameter 'ProductID' of the stored procedure.
            if (transferLine.ProductID != null)
            {
                oDatabaseHelper.AddParameter("@ProductID", transferLine.ProductID);
            }
            else
            {
                oDatabaseHelper.AddParameter("@ProductID", DBNull.Value);
            }
            // Pass the value of '_Qty' as parameter 'Qty' of the stored procedure.
            if (transferLine.Qty != null)
            {
                oDatabaseHelper.AddParameter("@Qty", transferLine.Qty);
            }
            else
            {
                oDatabaseHelper.AddParameter("@Qty", DBNull.Value);
            }
            // Pass the value of '_createdBy' as parameter 'CreatedBy' of the stored procedure.
            if (transferLine.CreatedBy != null)
            {
                oDatabaseHelper.AddParameter("@CreatedBy", transferLine.CreatedBy);
            }
            else
            {
                oDatabaseHelper.AddParameter("@CreatedBy", DBNull.Value);
            }
            // Pass the value of '_createDate' as parameter 'CreateDate' of the stored procedure.
            if (transferLine.CreateDate != null)
            {
                oDatabaseHelper.AddParameter("@CreateDate", transferLine.CreateDate);
            }
            else
            {
                oDatabaseHelper.AddParameter("@CreateDate", DBNull.Value);
            }
            // Pass the value of '_updatedBy' as parameter 'UpdatedBy' of the stored procedure.
            if (transferLine.UpdatedBy != null)
            {
                oDatabaseHelper.AddParameter("@UpdatedBy", transferLine.UpdatedBy);
            }
            else
            {
                oDatabaseHelper.AddParameter("@UpdatedBy", DBNull.Value);
            }
            // Pass the value of '_updateDate' as parameter 'UpdateDate' of the stored procedure.
            if (transferLine.UpdateDate != null)
            {
                oDatabaseHelper.AddParameter("@UpdateDate", transferLine.UpdateDate);
            }
            else
            {
                oDatabaseHelper.AddParameter("@UpdateDate", DBNull.Value);
            }
            // Pass the value of '_isDeleted' as parameter 'IsDeleted' of the stored procedure.
            if (transferLine.IsDeleted != null)
            {
                oDatabaseHelper.AddParameter("@IsDeleted", transferLine.IsDeleted);
            }
            else
            {
                oDatabaseHelper.AddParameter("@IsDeleted", DBNull.Value);
            }
            // Pass the value of '_deletedBy' as parameter 'DeletedBy' of the stored procedure.
            if (transferLine.DeletedBy != null)
            {
                oDatabaseHelper.AddParameter("@DeletedBy", transferLine.DeletedBy);
            }
            else
            {
                oDatabaseHelper.AddParameter("@DeletedBy", DBNull.Value);
            }
            // Pass the value of '_deleteDate' as parameter 'DeleteDate' of the stored procedure.
            if (transferLine.DeletedDate != null)
            {
                oDatabaseHelper.AddParameter("@DeletedDate", transferLine.DeletedDate);
            }
            else
            {
                oDatabaseHelper.AddParameter("@DeletedDate", DBNull.Value);
            }
            // The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
            oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);

            oDatabaseHelper.ExecuteScalar("usp_INVTransferLine_Commit", CommandType.StoredProcedure, ConnectionState.KeepOpen, ref ExecutionState);

            return(ExecutionState);
        }
Ejemplo n.º 10
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVTransferLine" type="INVTransferLine">This INVTransferLine  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(INVTransferLine iNVTransferLine)
        {
            _iNVTransferLine = POS.DataLayer.INVTransferLine.SelectOne(new POS.DataLayer.INVTransferLinePrimaryKey(iNVTransferLine.TransferLineID));

            _iNVTransferLine.TransferHeaderID = iNVTransferLine.TransferHeaderID;
            _iNVTransferLine.ProductID = iNVTransferLine.ProductID;
            _iNVTransferLine.Qty = iNVTransferLine.Qty;
            _iNVTransferLine.CreatedBy = iNVTransferLine.CreatedBy;
            _iNVTransferLine.CreateDate = iNVTransferLine.CreateDate;
            _iNVTransferLine.UpdatedBy = iNVTransferLine.UpdatedBy;
            _iNVTransferLine.UpdateDate = iNVTransferLine.UpdateDate;
            _iNVTransferLine.IsDeleted = iNVTransferLine.IsDeleted;
            _iNVTransferLine.DeletedBy = iNVTransferLine.DeletedBy;
            _iNVTransferLine.DeletedDate = iNVTransferLine.DeletedDate;

            return _iNVTransferLine.Update();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="iNVTransferLine" type="INVTransferLine">This INVTransferLine  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(INVTransferLine iNVTransferLine)
        {
            _iNVTransferLine = new POS.DataLayer.INVTransferLine();
            _iNVTransferLine.TransferLineID = iNVTransferLine.TransferLineID;
            _iNVTransferLine.TransferHeaderID = iNVTransferLine.TransferHeaderID;
            _iNVTransferLine.ProductID = iNVTransferLine.ProductID;
            _iNVTransferLine.Qty = iNVTransferLine.Qty;
            _iNVTransferLine.CreatedBy = iNVTransferLine.CreatedBy;
            _iNVTransferLine.CreateDate = iNVTransferLine.CreateDate;
            _iNVTransferLine.UpdatedBy = iNVTransferLine.UpdatedBy;
            _iNVTransferLine.UpdateDate = iNVTransferLine.UpdateDate;
            _iNVTransferLine.IsDeleted = iNVTransferLine.IsDeleted;
            _iNVTransferLine.DeletedBy = iNVTransferLine.DeletedBy;
            _iNVTransferLine.DeletedDate = iNVTransferLine.DeletedDate;

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

			INVTransferLineCollection list = new INVTransferLineCollection();
			
            if (rdr.Read())
			{
				INVTransferLine obj = new INVTransferLine();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new INVTransferLine();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}