예제 #1
0
        ///<summary>
        /// This method will update one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="paymentType" type="PaymentType">This PaymentType  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(PaymentType paymentType)
        {
            _paymentType = POS.DataLayer.PaymentType.SelectOne(new POS.DataLayer.PaymentTypePrimaryKey(paymentType.PaymentTypeID));

            _paymentType.PaymentTypeName = paymentType.PaymentTypeName;

            return(_paymentType.Update());
        }
예제 #2
0
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="paymentType" type="PaymentType">This PaymentType  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(PaymentType paymentType)
        {
            _paymentType = new POS.DataLayer.PaymentType();
            _paymentType.PaymentTypeID   = paymentType.PaymentTypeID;
            _paymentType.PaymentTypeName = paymentType.PaymentTypeName;

            return(_paymentType.Insert());
        }
예제 #3
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="PaymentTypePrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class PaymentType</returns>
		public PaymentType SelectOne(PaymentTypePrimaryKey pk)
		{
			_paymentTypeWCF = new PaymentType();
			_paymentType = POS.DataLayer.PaymentTypeBase.SelectOne(new POS.DataLayer.PaymentTypePrimaryKey(pk.PaymentTypeID));
			
				_paymentTypeWCF.PaymentTypeID = _paymentType.PaymentTypeID;
				_paymentTypeWCF.PaymentTypeName = _paymentType.PaymentTypeName;
				
			return _paymentTypeWCF;
		}
예제 #4
0
        /// <summary>
        /// This method will return an object representing the record matching the primary key information specified.
        /// </summary>
        ///
        /// <param name="pk" type="PaymentTypePrimaryKey">Primary Key information based on which data is to be fetched.</param>
        ///
        /// <returns>object of class PaymentType</returns>
        public PaymentType SelectOne(PaymentTypePrimaryKey pk)
        {
            _paymentTypeWCF = new PaymentType();
            _paymentType    = POS.DataLayer.PaymentTypeBase.SelectOne(new POS.DataLayer.PaymentTypePrimaryKey(pk.PaymentTypeID));

            _paymentTypeWCF.PaymentTypeID   = _paymentType.PaymentTypeID;
            _paymentTypeWCF.PaymentTypeName = _paymentType.PaymentTypeName;

            return(_paymentTypeWCF);
        }
예제 #5
0
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class PaymentType in the form of object of PaymentTypeCollection </returns>
		public PaymentTypeCollection SelectAll()
		{
			PaymentTypeCollection paymentTypeCollection = new PaymentTypeCollection();
			foreach (POS.DataLayer.PaymentType _paymentType in POS.DataLayer.PaymentTypeBase.SelectAll())
			{
				_paymentTypeWCF = new PaymentType();
				
				_paymentTypeWCF.PaymentTypeID = _paymentType.PaymentTypeID;
				_paymentTypeWCF.PaymentTypeName = _paymentType.PaymentTypeName;
				
				paymentTypeCollection.Add(_paymentTypeWCF);
			}
			return paymentTypeCollection;
		}
예제 #6
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 PaymentType</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 PaymentType in the form of an object of class PaymentTypeCollection</returns>
		public PaymentTypeCollection SelectByField(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation)
		{
			PaymentTypeCollection paymentTypeCollection = new PaymentTypeCollection();
			foreach (POS.DataLayer.PaymentType _paymentType in POS.DataLayer.PaymentTypeBase.SelectByField(field, fieldValue, fieldValue2, typeOperation))
			{
				_paymentTypeWCF = new PaymentType();
				
				_paymentTypeWCF.PaymentTypeID = _paymentType.PaymentTypeID;
				_paymentTypeWCF.PaymentTypeName = _paymentType.PaymentTypeName;
				
				paymentTypeCollection.Add(_paymentTypeWCF);
			}
			return paymentTypeCollection;
		}
예제 #7
0
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="paymentType" type="PaymentType">This PaymentType  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(PaymentType paymentType)
		{
			_paymentType=POS.DataLayer.PaymentType.SelectOne(new POS.DataLayer.PaymentTypePrimaryKey(paymentType.PaymentTypeID));
			
			_paymentType.PaymentTypeName=paymentType.PaymentTypeName;
			
			return _paymentType.Update();
		}
예제 #8
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 PaymentType</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 PaymentType in the form of an object of class PaymentTypeCollection</returns>
		public PaymentTypeCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			PaymentTypeCollection paymentTypeCollection = new PaymentTypeCollection();
			foreach (POS.DataLayer.PaymentType _paymentType in POS.DataLayer.PaymentTypeBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_paymentTypeWCF = new PaymentType();
				
				_paymentTypeWCF.PaymentTypeID = _paymentType.PaymentTypeID;
				_paymentTypeWCF.PaymentTypeName = _paymentType.PaymentTypeName;
				
				paymentTypeCollection.Add(_paymentTypeWCF);
			}
			return paymentTypeCollection;
		}
예제 #9
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 PaymentType in the form of an object of class PaymentTypeCollection </returns>
		public PaymentTypeCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			PaymentTypeCollection paymentTypeCollection = new PaymentTypeCollection();
			foreach (POS.DataLayer.PaymentType _paymentType in POS.DataLayer.PaymentTypeBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_paymentTypeWCF = new PaymentType();
				
				_paymentTypeWCF.PaymentTypeID = _paymentType.PaymentTypeID;
				_paymentTypeWCF.PaymentTypeName = _paymentType.PaymentTypeName;
				
				paymentTypeCollection.Add(_paymentTypeWCF);
			}
			return paymentTypeCollection;
		}
예제 #10
0
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="paymentType" type="PaymentType">This PaymentType  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(PaymentType paymentType)
		{
			_paymentType = new POS.DataLayer.PaymentType();
			_paymentType.PaymentTypeID=paymentType.PaymentTypeID;
			_paymentType.PaymentTypeName=paymentType.PaymentTypeName;
			
			return _paymentType.Insert();
		}
예제 #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 PaymentTypeCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:22 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static PaymentTypeCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			PaymentTypeCollection list = new PaymentTypeCollection();
			
            if (rdr.Read())
			{
				PaymentType obj = new PaymentType();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new PaymentType();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
예제 #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 PaymentTypeCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:22 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static PaymentTypeCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			PaymentTypeCollection list = new PaymentTypeCollection();
			
			while (rdr.Read())
			{
				PaymentType obj = new PaymentType();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}
예제 #13
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="PaymentTypePrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class PaymentType</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:22 PM				Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static PaymentType SelectOneWithSALSalesHeaderUsingPaymentTypeID(PaymentTypePrimaryKey pk)
		{
			DatabaseHelper oDatabaseHelper = new DatabaseHelper();
			bool ExecutionState = false;
			PaymentType 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_PaymentType_SelectOneWithSALSalesHeaderUsingPaymentTypeID", ref ExecutionState);
			if (dr.Read())
			{
				obj= new PaymentType();
				PopulateObjectFromReader(obj,dr);
				
				dr.NextResult();
				
				//Get the child records.
				obj.SALSalesHeaderCollectionUsingPaymentTypeID=SALSalesHeader.PopulateObjectsFromReader(dr);
			}
			dr.Close();  
			oDatabaseHelper.Dispose();
			return obj;
			
		}