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

            if (dr.Read())
            {
                BDSupplier obj = new BDSupplier();
                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 BDSupplierCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:05 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static BDSupplierCollection PopulateObjectsFromReader(IDataReader rdr)
        {
            BDSupplierCollection list = new BDSupplierCollection();

            while (rdr.Read())
            {
                BDSupplier obj = new BDSupplier();
                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="bDSupplier" type="BDSupplier">This BDSupplier  will be updated in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Update(BDSupplier bDSupplier)
        {
            _bDSupplier = POS.DataLayer.BDSupplier.SelectOne(new POS.DataLayer.BDSupplierPrimaryKey(bDSupplier.SupplierID));

            _bDSupplier.SupplierCode = bDSupplier.SupplierCode;
            _bDSupplier.SupplierName = bDSupplier.SupplierName;
            _bDSupplier.Address      = bDSupplier.Address;
            _bDSupplier.Phone1       = bDSupplier.Phone1;
            _bDSupplier.Phone2       = bDSupplier.phone2;
            _bDSupplier.Mobile1      = bDSupplier.Mobile1;
            _bDSupplier.Mobile2      = bDSupplier.Mobile2;
            _bDSupplier.Email        = bDSupplier.Email;
            _bDSupplier.IsActive     = bDSupplier.IsActive;

            return(_bDSupplier.Update());
        }
        /// <summary>
        /// This method will insert one new row into the database using the property Information
        /// </summary>
        ///
        /// <param name="bDSupplier" type="BDSupplier">This BDSupplier  will be inserted in the database.</param>
        ///
        /// <returns>True if succeeded</returns>
        public bool Insert(BDSupplier bDSupplier)
        {
            _bDSupplier              = new POS.DataLayer.BDSupplier();
            _bDSupplier.SupplierID   = bDSupplier.SupplierID;
            _bDSupplier.SupplierCode = bDSupplier.SupplierCode;
            _bDSupplier.SupplierName = bDSupplier.SupplierName;
            _bDSupplier.Address      = bDSupplier.Address;
            _bDSupplier.Phone1       = bDSupplier.Phone1;
            _bDSupplier.Phone2       = bDSupplier.phone2;
            _bDSupplier.Mobile1      = bDSupplier.Mobile1;
            _bDSupplier.Mobile2      = bDSupplier.Mobile2;
            _bDSupplier.Email        = bDSupplier.Email;
            _bDSupplier.IsActive     = bDSupplier.IsActive;

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

            _bDSupplierWCF.SupplierID   = _bDSupplier.SupplierID;
            _bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
            _bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
            _bDSupplierWCF.Address      = _bDSupplier.Address;
            _bDSupplierWCF.Phone1       = _bDSupplier.Phone1;
            _bDSupplierWCF.phone2       = _bDSupplier.Phone2;
            _bDSupplierWCF.Mobile1      = _bDSupplier.Mobile1;
            _bDSupplierWCF.Mobile2      = _bDSupplier.Mobile2;
            _bDSupplierWCF.Email        = _bDSupplier.Email;
            _bDSupplierWCF.IsActive     = _bDSupplier.IsActive;

            return(_bDSupplierWCF);
        }
Beispiel #6
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="BDSupplierPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class BDSupplier</returns>
		public BDSupplier SelectOne(BDSupplierPrimaryKey pk)
		{
			_bDSupplierWCF = new BDSupplier();
			_bDSupplier = POS.DataLayer.BDSupplierBase.SelectOne(new POS.DataLayer.BDSupplierPrimaryKey(pk.SupplierID));
			
				_bDSupplierWCF.SupplierID = _bDSupplier.SupplierID;
				_bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
				_bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
				_bDSupplierWCF.Address = _bDSupplier.Address;
				_bDSupplierWCF.Phone1 = _bDSupplier.Phone1;
				_bDSupplierWCF.phone2 = _bDSupplier.Phone2;
				_bDSupplierWCF.Mobile1 = _bDSupplier.Mobile1;
				_bDSupplierWCF.Mobile2 = _bDSupplier.Mobile2;
				_bDSupplierWCF.Email = _bDSupplier.Email;
				_bDSupplierWCF.IsActive = _bDSupplier.IsActive;
				_bDSupplierWCF.Debit = _bDSupplier.Debit;
				_bDSupplierWCF.Credit = _bDSupplier.Credit;
				
			return _bDSupplierWCF;
		}
Beispiel #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 BDSupplierCollection</returns>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:05 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static BDSupplierCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper)
        {
            BDSupplierCollection list = new BDSupplierCollection();

            if (rdr.Read())
            {
                BDSupplier obj = new BDSupplier();
                PopulateObjectFromReader(obj, rdr);
                list.Add(obj);
                while (rdr.Read())
                {
                    obj = new BDSupplier();
                    PopulateObjectFromReader(obj, rdr);
                    list.Add(obj);
                }
                oDatabaseHelper.Dispose();
                return(list);
            }
            else
            {
                oDatabaseHelper.Dispose();
                return(null);
            }
        }
Beispiel #8
0
		/// <summary>
		/// This method will return a list of objects representing all records in the table.
		/// </summary>
		///
		/// <returns>list of objects of class BDSupplier in the form of object of BDSupplierCollection </returns>
		public BDSupplierCollection SelectAll()
		{
			BDSupplierCollection bDSupplierCollection = new BDSupplierCollection();
			foreach (POS.DataLayer.BDSupplier _bDSupplier in POS.DataLayer.BDSupplierBase.SelectAll())
			{
				_bDSupplierWCF = new BDSupplier();
				
				_bDSupplierWCF.SupplierID = _bDSupplier.SupplierID;
				_bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
				_bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
				_bDSupplierWCF.Address = _bDSupplier.Address;
				_bDSupplierWCF.Phone1 = _bDSupplier.Phone1;
				_bDSupplierWCF.phone2 = _bDSupplier.Phone2;
				_bDSupplierWCF.Mobile1 = _bDSupplier.Mobile1;
				_bDSupplierWCF.Mobile2 = _bDSupplier.Mobile2;
				_bDSupplierWCF.Email = _bDSupplier.Email;
				_bDSupplierWCF.IsActive = _bDSupplier.IsActive;
				_bDSupplierWCF.Debit = _bDSupplier.Debit;
				_bDSupplierWCF.Credit = _bDSupplier.Credit;
				
				bDSupplierCollection.Add(_bDSupplierWCF);
			}
			return bDSupplierCollection;
		}
Beispiel #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 
		/// using the value of the field specified
		/// </summary>
		///
		/// <param name="field" type="string">Field of the class BDSupplier</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 BDSupplier in the form of an object of class BDSupplierCollection</returns>
		public BDSupplierCollection SelectByFieldPaged(string field, object fieldValue, object fieldValue2, TypeOperation typeOperation, int pageSize, int skipPages, string orderByStatement)
		{
			BDSupplierCollection bDSupplierCollection = new BDSupplierCollection();
			foreach (POS.DataLayer.BDSupplier _bDSupplier in POS.DataLayer.BDSupplierBase.SelectByFieldPaged(field, fieldValue, fieldValue2, typeOperation, pageSize, skipPages, orderByStatement))
			{
				_bDSupplierWCF = new BDSupplier();
				
				_bDSupplierWCF.SupplierID = _bDSupplier.SupplierID;
				_bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
				_bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
				_bDSupplierWCF.Address = _bDSupplier.Address;
				_bDSupplierWCF.Phone1 = _bDSupplier.Phone1;
				_bDSupplierWCF.phone2 = _bDSupplier.Phone2;
				_bDSupplierWCF.Mobile1 = _bDSupplier.Mobile1;
				_bDSupplierWCF.Mobile2 = _bDSupplier.Mobile2;
				_bDSupplierWCF.Email = _bDSupplier.Email;
				_bDSupplierWCF.IsActive = _bDSupplier.IsActive;
				_bDSupplierWCF.Debit = _bDSupplier.Debit;
				_bDSupplierWCF.Credit = _bDSupplier.Credit;
				
				bDSupplierCollection.Add(_bDSupplierWCF);
			}
			return bDSupplierCollection;
		}
Beispiel #10
0
			///<summary>
		/// This method will update one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="bDSupplier" type="BDSupplier">This BDSupplier  will be updated in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Update(BDSupplier bDSupplier)
		{
			_bDSupplier=POS.DataLayer.BDSupplier.SelectOne(new POS.DataLayer.BDSupplierPrimaryKey(bDSupplier.SupplierID));
			
			_bDSupplier.SupplierCode=bDSupplier.SupplierCode;
			_bDSupplier.SupplierName=bDSupplier.SupplierName;
			_bDSupplier.Address=bDSupplier.Address;
			_bDSupplier.Phone1=bDSupplier.Phone1;
			_bDSupplier.Phone2=bDSupplier.phone2;
			_bDSupplier.Mobile1=bDSupplier.Mobile1;
			_bDSupplier.Mobile2=bDSupplier.Mobile2;
			_bDSupplier.Email=bDSupplier.Email;
			_bDSupplier.IsActive=bDSupplier.IsActive;
			_bDSupplier.Debit=bDSupplier.Debit;
			_bDSupplier.Credit=bDSupplier.Credit;
			
			return _bDSupplier.Update();
		}
Beispiel #11
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 BDSupplier in the form of an object of class BDSupplierCollection </returns>
		public BDSupplierCollection SelectAllPaged(int? pageSize, int? skipPages, string orderByStatement)
		{
			BDSupplierCollection bDSupplierCollection = new BDSupplierCollection();
			foreach (POS.DataLayer.BDSupplier _bDSupplier in POS.DataLayer.BDSupplierBase.SelectAllPaged(pageSize, skipPages, orderByStatement))
			{
				_bDSupplierWCF = new BDSupplier();
				
				_bDSupplierWCF.SupplierID = _bDSupplier.SupplierID;
				_bDSupplierWCF.SupplierCode = _bDSupplier.SupplierCode;
				_bDSupplierWCF.SupplierName = _bDSupplier.SupplierName;
				_bDSupplierWCF.Address = _bDSupplier.Address;
				_bDSupplierWCF.Phone1 = _bDSupplier.Phone1;
				_bDSupplierWCF.phone2 = _bDSupplier.Phone2;
				_bDSupplierWCF.Mobile1 = _bDSupplier.Mobile1;
				_bDSupplierWCF.Mobile2 = _bDSupplier.Mobile2;
				_bDSupplierWCF.Email = _bDSupplier.Email;
				_bDSupplierWCF.IsActive = _bDSupplier.IsActive;
				_bDSupplierWCF.Debit = _bDSupplier.Debit;
				_bDSupplierWCF.Credit = _bDSupplier.Credit;
				
				bDSupplierCollection.Add(_bDSupplierWCF);
			}
			return bDSupplierCollection;
		}
Beispiel #12
0
		/// <summary>
		/// This method will insert one new row into the database using the property Information
		/// </summary>
		///
		/// <param name="bDSupplier" type="BDSupplier">This BDSupplier  will be inserted in the database.</param>
		///
		/// <returns>True if succeeded</returns>
		public bool Insert(BDSupplier bDSupplier)
		{
			_bDSupplier = new POS.DataLayer.BDSupplier();
			_bDSupplier.SupplierID=bDSupplier.SupplierID;
			_bDSupplier.SupplierCode=bDSupplier.SupplierCode;
			_bDSupplier.SupplierName=bDSupplier.SupplierName;
			_bDSupplier.Address=bDSupplier.Address;
			_bDSupplier.Phone1=bDSupplier.Phone1;
			_bDSupplier.Phone2=bDSupplier.phone2;
			_bDSupplier.Mobile1=bDSupplier.Mobile1;
			_bDSupplier.Mobile2=bDSupplier.Mobile2;
			_bDSupplier.Email=bDSupplier.Email;
			_bDSupplier.IsActive=bDSupplier.IsActive;
			_bDSupplier.Debit=bDSupplier.Debit;
			_bDSupplier.Credit=bDSupplier.Credit;
			
			return _bDSupplier.Insert();
		}
Beispiel #13
0
		/// <summary>
		/// This method will return an object representing the record matching the primary key information specified.
		/// </summary>
		///
		/// <param name="pk" type="BDSupplierPrimaryKey">Primary Key information based on which data is to be fetched.</param>
		///
		/// <returns>object of class BDSupplier</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:05 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		public static BDSupplier SelectOne(BDSupplierPrimaryKey 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_BDSupplier_SelectbyPrimaryKey", ref ExecutionState);
			if (dr.Read())
			{
				BDSupplier obj=new BDSupplier();	
				PopulateObjectFromReader(obj,dr);
				dr.Close();              
				oDatabaseHelper.Dispose();
				return obj;
			}
			else
			{
				dr.Close();
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
Beispiel #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 BDSupplierCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:05 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static BDSupplierCollection PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper) 
		{

			BDSupplierCollection list = new BDSupplierCollection();
			
            if (rdr.Read())
			{
				BDSupplier obj = new BDSupplier();
				PopulateObjectFromReader(obj, rdr);
				list.Add(obj);
				while (rdr.Read())
				{
					obj = new BDSupplier();
					PopulateObjectFromReader(obj, rdr);
					list.Add(obj);
				}
				oDatabaseHelper.Dispose();
				return list;
			}
			else
			{
				oDatabaseHelper.Dispose();
				return null;
			}
			
		}
Beispiel #15
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 BDSupplierCollection</returns>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:05 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static BDSupplierCollection PopulateObjectsFromReader(IDataReader rdr) 
		{
			BDSupplierCollection list = new BDSupplierCollection();
			
			while (rdr.Read())
			{
				BDSupplier obj = new BDSupplier();
				PopulateObjectFromReader(obj,rdr);
				list.Add(obj);
			}
			return list;
			
		}