text:
/*
	File generated by NetTiers templates [www.nettiers.com]
	Important: Do not modify this file. Edit the file Vendor.cs instead.
*/

#region Using Directives
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using System.Security.Permissions;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.Security;
using System.Data;

using Nettiers.AdventureWorks.Entities;
using Nettiers.AdventureWorks.Entities.Validation;
//using Entities = Nettiers.AdventureWorks.Entities;
using Nettiers.AdventureWorks.Data;
using Nettiers.AdventureWorks.Data.Bases;

using Microsoft.Practices.EnterpriseLibrary.Logging;

#endregion

namespace Nettiers.AdventureWorks.Services
{

	///
	/// An object representation of the 'Vendor' table.
	///
	/// <remarks>
	/// IMPORTANT!!! You should not modify this partial  class, modify the Vendor.cs file instead.
	/// All custom implementations should be done in the <see cref="Vendor"/> class.
	/// </remarks>
	[DataObject]
	[CLSCompliant(true)]
	public partial class VendorServiceBase : ServiceBase<Vendor, VendorKey>
	{

		#region Constructors
		///
		/// Creates a new <see cref="Vendor"/> instance .
		///
		public VendorServiceBase() : base()
		{
		}

		///
		/// A simple factory method to create a new <see cref="Vendor"/> instance.
		///
		///<param name="_accountNumber">Vendor account (identification) number.</param>
		///<param name="_name">Company name.</param>
		///<param name="_creditRating">1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average</param>
		///<param name="_preferredVendorStatus">0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product.</param>
		///<param name="_activeFlag">0 = Vendor no longer used. 1 = Vendor is actively used.</param>
		///<param name="_purchasingWebServiceUrl">Vendor URL.</param>
		///<param name="_modifiedDate">Date and time the record was last updated.</param>
		public static Vendor CreateVendor(System.String _accountNumber, System.String _name, System.Byte _creditRating, System.Boolean _preferredVendorStatus, System.Boolean _activeFlag, System.String _purchasingWebServiceUrl, System.DateTime _modifiedDate)
		{
			Vendor newEntityVendor = new Vendor();
			newEntityVendor.AccountNumber  = _accountNumber;
			newEntityVendor.Name  = _name;
			newEntityVendor.CreditRating  = _creditRating;
			newEntityVendor.PreferredVendorStatus  = _preferredVendorStatus;
			newEntityVendor.ActiveFlag  = _activeFlag;
			newEntityVendor.PurchasingWebServiceUrl  = _purchasingWebServiceUrl;
			newEntityVendor.ModifiedDate  = _modifiedDate;
			return newEntityVendor;
		}
		#endregion Constructors

		#region Fields
		private static SecurityContext<Vendor> securityContext = new SecurityContext<Vendor>();
		private static readonly string layerExceptionPolicy = "ServiceLayerExceptionPolicy";
		private static readonly bool noTranByDefault = false;
		#endregion

		#region SecurityContext
		///
		/// Contains all necessary information to validate and authorize the
		/// call of the method with the Principal and Roles of the current user.
		///
		public static SecurityContext<Vendor> SecurityContext
		{
			get
			{
				return securityContext;
			}
		}
		#endregion

		#region Data Access Methods

		#region GetByForeignKey Methods
		#endregion GetByForeignKey Methods

		#region GetByIndexes
		///
		/// 	Gets a row from the DataSource based on its primary key.
		///
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public override Vendor Get(VendorKey key)
		{
			return GetByVendorId(key.VendorId);
		}

		///
		///  method that Gets rows in a <see cref="TList{Vendor}" /> from the datasource based on the primary key AK_Vendor_AccountNumber index.
		///
		/// <param name="_accountNumber">Vendor account (identification) number.</param>
		/// <returns>Returns an instance of the <see cref="Vendor"/> class.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual Vendor GetByAccountNumber(System.String _accountNumber)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByAccountNumber");
			#endregion Security check

			#region Initialisation
			Vendor entity = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				entity = dataProvider.VendorProvider.GetByAccountNumber(transactionManager, _accountNumber)   as Vendor;
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return entity;
		}

		///
		///  Method that Gets rows in a <see cref="TList{Vendor}" /> from the datasource based on the primary key AK_Vendor_AccountNumber index.
		///
		/// <param name="_accountNumber">Vendor account (identification) number.</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Page length of records you would like to retrieve</param>
		/// <param name="totalCount">out parameter, number of total rows in given query.</param>
		/// <returns>Returns an instance of the <see cref="Vendor"/> class.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual Vendor GetByAccountNumber(System.String _accountNumber, int start, int pageLength, out int totalCount)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByAccountNumber");
			#endregion Security check

			#region Initialisation
			totalCount = -1;
			Vendor entity = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				entity = dataProvider.VendorProvider.GetByAccountNumber(transactionManager, _accountNumber, start, pageLength, out totalCount)   as Vendor;
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return entity;
		}

		///
		///  method that Gets rows in a <see cref="TList{Vendor}" /> from the datasource based on the primary key PK_Vendor_VendorID index.
		///
		/// <param name="_vendorId">Primary key for Vendor records.</param>
		/// <returns>Returns an instance of the <see cref="Vendor"/> class.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual Vendor GetByVendorId(System.Int32 _vendorId)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByVendorId");
			#endregion Security check

			#region Initialisation
			Vendor entity = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				entity = dataProvider.VendorProvider.GetByVendorId(transactionManager, _vendorId)   as Vendor;
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return entity;
		}

		///
		///  Method that Gets rows in a <see cref="TList{Vendor}" /> from the datasource based on the primary key PK_Vendor_VendorID index.
		///
		/// <param name="_vendorId">Primary key for Vendor records.</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Page length of records you would like to retrieve</param>
		/// <param name="totalCount">out parameter, number of total rows in given query.</param>
		/// <returns>Returns an instance of the <see cref="Vendor"/> class.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual Vendor GetByVendorId(System.Int32 _vendorId, int start, int pageLength, out int totalCount)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByVendorId");
			#endregion Security check

			#region Initialisation
			totalCount = -1;
			Vendor entity = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				entity = dataProvider.VendorProvider.GetByVendorId(transactionManager, _vendorId, start, pageLength, out totalCount)   as Vendor;
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return entity;
		}

		#endregion GetByIndexes

		#region GetAll
		///
		/// Get a complete collection of <see cref="Vendor" /> entities.
		///
		/// <returns></returns>
		public override TList<Vendor> GetAll()
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetAll");
			#endregion Security check

			#region Initialisation
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.GetAll(transactionManager);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}
			return list;
		}

		///
		/// Get a set portion of a complete list of <see cref="Vendor" /> entities
		///
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="totalCount">out parameter, number of total rows in given query.</param>
		/// <returns>a <see cref="TList{Vendor}"/> </returns>
		public virtual TList<Vendor> GetAll(int start, int pageLength, out int totalCount)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetAll");
			#endregion Security check

			#region Initialisation
			totalCount = -1;
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.GetAll(transactionManager, start, pageLength, out totalCount);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}
			return list;
		}
		#endregion GetAll

		#region GetPaged
		///
		/// Gets a page of <see cref="TList{Vendor}" /> rows from the DataSource.
		///
		/// <param name="totalCount">Out Parameter, Number of rows in the DataSource.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of <c>Vendor</c> objects.</returns>
		public virtual TList<Vendor> GetPaged(out int totalCount)
		{
			return GetPaged(null, null, 0, int.MaxValue, out totalCount);
		}

		///
		/// Gets a page of <see cref="TList{Vendor}" /> rows from the DataSource.
		///
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="totalCount">Number of rows in the DataSource.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of <c>Vendor</c> objects.</returns>
		public virtual TList<Vendor> GetPaged(int start, int pageLength, out int totalCount)
		{
			return GetPaged(null, null, start, pageLength, out totalCount);
		}

		///
		/// Gets a page of entity rows with a <see cref="TList{Vendor}" /> from the DataSource with a where clause and order by clause.
		///
		/// <param name="whereClause">Specifies the condition for the rows returned by a query (Name='John Doe', Name='John Doe' AND Id='1', Name='John Doe' OR Id='1').</param>
		/// <param name="orderBy">Specifies the sort criteria for the rows in the DataSource (Name ASC; BirthDay DESC, Name ASC).</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="totalCount">Out Parameter, Number of rows in the DataSource.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of <c>Vendor</c> objects.</returns>
		public override TList<Vendor> GetPaged(string whereClause,string orderBy, int start, int pageLength, out int totalCount)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetPaged");
			#endregion Security check

			#region Initialisation
			totalCount = -1;
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.GetPaged(transactionManager, whereClause, orderBy, start, pageLength, out totalCount);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}
			return list;
		}

		///
		/// Gets the number of rows in the DataSource that match the specified whereClause.
		/// This method is only provided as a workaround for the ObjectDataSource's need to
		/// execute another method to discover the total count instead of using another param, like our out param.
		/// This method should be avoided if using the ObjectDataSource or another method.
		///
		/// <param name="whereClause">Specifies the condition for the rows returned by a query (Name='John Doe', Name='John Doe' AND Id='1', Name='John Doe' OR Id='1').</param>
		/// <param name="totalCount">Number of rows in the DataSource.</param>
		/// <returns>Returns the number of rows.</returns>
		public int GetTotalItems(string whereClause, out int totalCount)
		{
			GetPaged(whereClause, null, 0, int.MaxValue, out totalCount);
			return totalCount;
		}
		#endregion GetPaged

		#region Find

		#region Parsed Find Methods

		///
		/// Attempts to do a parameterized version of a simple whereclause.
		/// Returns rows meeting the whereClause condition from the DataSource.
		///
		/// <param name="whereClause">Specifies the condition for the rows returned by a query (Name='John Doe', Name='John Doe' AND Id='1', Name='John Doe' OR Id='1').</param>
		/// <remarks>Does NOT Support Advanced Operations such as SubSelects.  See GetPaged for that functionality.</remarks>
		/// <returns>Returns a typed collection of Entity objects.</returns>
		public virtual TList<Vendor> Find(string whereClause)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Find");
			#endregion Security check

			#region Initialisation
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.Find(transactionManager, whereClause);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}
			return list;
		}

		///
		/// Returns rows meeting the whereClause condition from the DataSource.
		///
		/// <param name="whereClause">Specifies the condition for the rows returned by a query (Name='John Doe', Name='John Doe' AND Id='1', Name='John Doe' OR Id='1').</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="totalCount">out parameter to get total records for query</param>
		/// <remarks>Does NOT Support Advanced Operations such as SubSelects.  See GetPaged for that functionality.</remarks>
		/// <returns>Returns a typed collection TList{Vendor} of <c>Vendor</c> objects.</returns>
		public override TList<Vendor> Find(string whereClause, int start, int pageLength, out int totalCount)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Find");
			#endregion Security check

			#region Initialisation
			totalCount = -1;
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.Find(transactionManager, whereClause, start, pageLength, out totalCount);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}
			return list;
		}

		#endregion Parsed Find Methods

		#region Parameterized Find Methods

		///
		/// Returns rows from the DataSource that meet the parameter conditions.
		///
		/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
		/// <returns>Returns a typed collection of <c>Vendor</c> objects.</returns>
		public virtual TList<Vendor> Find(IFilterParameterCollection parameters)
		{
			return Find(parameters, (string) null);
		}

		///
        /// Returns rows from the DataSource that meet the parameter conditions.
        ///
        /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
        /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> objects.</param>
        /// <returns>Returns a typed collection of <c>Vendor</c> objects.</returns>
        public virtual TList<Vendor> Find(IFilterParameterCollection parameters, ISortColumnCollection sortColumns)
        {
            return Find(parameters, sortColumns.ToString());
        }

		///
		/// 	Returns rows from the DataSource that meet the parameter conditions.
		///
		/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
		/// <param name="orderBy">Specifies the sort criteria for the rows in the DataSource (Name ASC; BirthDay DESC, Name ASC);</param>
		/// <returns>Returns a typed collection of <c>Vendor</c> objects.</returns>
		public virtual TList<Vendor> Find(IFilterParameterCollection parameters, string orderBy)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Find");
			#endregion Security check

			#region Initialisation
			TransactionManager transactionManager = null;
			TList<Vendor> list = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.Find(transactionManager, parameters, orderBy);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return list;
		}

		///
        /// Returns rows from the DataSource that meet the parameter conditions.
        ///
        /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
        /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> objects.</param>
        /// <param name="start">Row number at which to start reading.</param>
        /// <param name="pageLength">Number of rows to return.</param>
        /// <param name="count">out. The number of rows that match this query.</param>
        /// <returns>Returns a typed collection of <c>Vendor</c> objects.</returns>
        public virtual TList<Vendor> Find(IFilterParameterCollection parameters, ISortColumnCollection sortColumns, int start, int pageLength, out int count)
        {
            return Find(parameters, sortColumns.ToString(), start, pageLength, out count);
        }

		///
		/// 	Returns rows from the DataSource that meet the parameter conditions.
		///
		/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
		/// <param name="orderBy">Specifies the sort criteria for the rows in the DataSource (Name ASC; BirthDay DESC, Name ASC);</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out. The number of rows that match this query.</param>
		/// <returns>Returns a typed collection of <c>Vendor</c> objects.</returns>
		public virtual TList<Vendor> Find(IFilterParameterCollection parameters, string orderBy, int start, int pageLength, out int count)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Find");
			#endregion Security check

			#region Initialisation
			count = -1;
			TransactionManager transactionManager = null;
			TList<Vendor> list = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.Find(transactionManager, parameters, orderBy, start, pageLength, out count);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return list;
		}

		#endregion Parameterized Find Methods

		#endregion

		#region Insert

		#region Insert Entity
		///
		/// public virtual method that Inserts a Vendor object into the datasource using a transaction.
		///
		/// <param name="entity">Vendor object to Insert.</param>
		/// <remarks>After Inserting into the datasource, the Vendor object will be updated
		/// to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>
		/// <returns>Returns bool that the operation is successful.</returns>
		/// <example>
        /// The following code shows the usage of the Insert Method with an already open transaction.
        ///
		/// Vendor entity = new Vendor();
		/// entity.StringProperty = "foo";
		/// entity.IntProperty = 12;
		/// entity.ChildObjectSource.StringProperty = "bar";
		/// TransactionManager tm = null;
		/// try
        ///	{
		/// 	tm = ConnectionContext.CreateTransaction();
		///		//Insert Child entity, Then Parent Entity
		/// 	ChildObjectTypeService.Insert(entity.ChildObjectSource);
		///		VendorService.Insert(entity);
		///	}
        ///	catch (Exception e)
        ///	{
		///		if (tm != null && tm.IsOpen) tm.Rollback();
        ///		if (DomainUtil.HandleException(e, name)) throw;
        ///	}
        ///
        /// </example>
		[DataObjectMethod(DataObjectMethodType.Insert)]
		public override bool Insert(Vendor entity)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Insert");

			if (!entity.IsValid)
				throw new EntityNotValidException(entity, "Insert", entity.Error);
			#endregion Security and validation check

			#region Initialisation
			bool result = false;
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				result = dataProvider.VendorProvider.Insert(transactionManager, entity);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return result;
		}
		#endregion Insert Entity

		#region Insert Collection
		///
		/// public virtual method that Inserts rows in <see cref="TList{Vendor}" /> to the datasource.
		///
		/// <param name="entityCollection"><c>Vendor</c> objects in a <see cref="TList{Vendor}" /> object to Insert.</param>
		/// <remarks>
		///		This function will only Insert entity objects marked as dirty
		///		and have an identity field equal to zero.
		///		Upon Inserting the objects, each dirty object will have the public
		///		method <c>Object.AcceptChanges()</c> called to make it clean.
		/// 	After Inserting into the datasource, the <c>Vendor</c> objects will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		///</remarks>
		/// <returns>Returns the number of successful Insert.</returns>
		/// <example>
        /// The following code shows the usage of the Insert Method with a collection of Vendor.
        /// <![CDATA[
		/// TList<Vendor> list = new TList<Vendor>();
		/// Vendor entity = new Vendor();
		/// entity.StringProperty = "foo";
		/// Vendor entity2 = new Vendor();
		/// entity.StringProperty = "bar";
		/// list.Add(entity);
		/// list.Add(entity2);
		///	VendorService.Insert(list);
		///	}
        ///	catch (Exception e)
        ///	{
        ///		if (DomainUtil.HandleException(e, name)) throw;
        ///	}
        /// ]]>
        /// </example>
		[DataObjectMethod(DataObjectMethodType.Insert)]
		public virtual TList<Vendor> Insert(TList<Vendor> entityCollection)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Insert");

			if (!entityCollection.IsValid)
			{
				throw new EntityNotValidException(entityCollection, "Insert", DomainUtil.GetErrorsFromList<Vendor>(entityCollection));
			}
			#endregion Security and validation check

			#region Initialisation
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				dataProvider.VendorProvider.Insert(transactionManager, entityCollection);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return entityCollection;
		}
		#endregion Insert Collection

		#endregion Insert

		#region Update

		#region Update Entity
		///
		/// public virtual method that Updates a Vendor object into the datasource using a transaction.
		///
		/// <param name="entity">Vendor object to Update.</param>
		/// <remarks>After Updateing into the datasource, the Vendor object will be updated
		/// to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>
		/// <returns>Returns bool that the operation is successful.</returns>
		/// <example>
        /// The following code shows the usage of the Update Method with an already open transaction.
        ///
		///	Vendor entity = VendorService.GetByPrimaryKeyColumn(1234);
		/// entity.StringProperty = "foo";
		/// entity.IntProperty = 12;
		/// entity.ChildObjectSource.StringProperty = "bar";
		/// TransactionManager tm = null;
		/// try
        ///	{
		/// 	tm = ConnectionContext.CreateTransaction();
		///		//Update Child entity, Then Parent Entity
		/// 	ChildObjectTypeService.Update(entity.ChildObjectSource);
		///		VendorService.Update(entity);
		///	}
        ///	catch (Exception e)
        ///	{
		///		if (tm != null && tm.IsOpen) tm.Rollback();
        ///		if (DomainUtil.HandleException(e, name)) throw;
        ///	}
        ///
        /// </example>
		[DataObjectMethod(DataObjectMethodType.Update)]
		public override bool Update(Vendor entity)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Update");

			if (!entity.IsValid)
				throw new EntityNotValidException(entity, "Update", entity.Error);
			#endregion Security and validation check

			#region Initialisation
			bool result = false;
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				result = dataProvider.VendorProvider.Update(transactionManager, entity);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return result;
		}
		#endregion Update Entity

		#region Update Collection
		///
		/// public virtual method that Updates rows in <see cref="TList{Vendor}" /> to the datasource.
		///
		/// <param name="entityCollection"><c>Vendor</c> objects in a <see cref="TList{Vendor}" /> object to Update.</param>
		/// <remarks>
		///		This function will only Update entity objects marked as dirty
		///		and have an identity field equal to zero.
		///		Upon Updateing the objects, each dirty object will have the public
		///		method <c>Object.AcceptChanges()</c> called to make it clean.
		/// 	After Updateing into the datasource, the <c>Vendor</c> objects will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		///</remarks>
		/// <returns>Returns the number of successful Update.</returns>
		/// <example>
        /// The following code shows the usage of the Update Method with a collection of Vendor.
        /// <![CDATA[
		/// TList<Vendor> list = new TList<Vendor>();
		/// Vendor entity = new Vendor();
		/// entity.StringProperty = "foo";
		/// Vendor entity2 = new Vendor();
		/// entity.StringProperty = "bar";
		/// list.Add(entity);
		/// list.Add(entity2);
		///	VendorService.Update(list);
		///	}
        ///	catch (Exception e)
        ///	{
        ///		if (DomainUtil.HandleException(e, name)) throw;
        ///	}
        /// ]]>
        /// </example>
		[DataObjectMethod(DataObjectMethodType.Update)]
		public virtual TList<Vendor> Update(TList<Vendor> entityCollection)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Update");

			if (!entityCollection.IsValid)
			{
				throw new EntityNotValidException(entityCollection, "Update", DomainUtil.GetErrorsFromList<Vendor>(entityCollection));
			}
			#endregion Security and validation check

			#region Initialisation
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				dataProvider.VendorProvider.Update(transactionManager, entityCollection);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return entityCollection;
		}
		#endregion Update Collection

		#endregion Update

		#region Save

		#region Save Entity
		///
		/// public virtual method that Saves a Vendor object into the datasource using a transaction.
		///
		/// <param name="entity">Vendor object to Save.</param>
		/// <remarks>After Saveing into the datasource, the Vendor object will be updated
		/// to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>
		/// <returns>Returns bool that the operation is successful.</returns>
		/// <example>
        /// The following code shows the usage of the Save Method with an already open transaction.
        ///
		///	Vendor entity = VendorService.GetByPrimaryKeyColumn(1234);
		/// entity.StringProperty = "foo";
		/// entity.IntProperty = 12;
		/// entity.ChildObjectSource.StringProperty = "bar";
		/// TransactionManager tm = null;
		/// try
        ///	{
		/// 	tm = ConnectionContext.CreateTransaction();
		///		//Save Child entity, Then Parent Entity
		/// 	ChildObjectTypeService.Save(entity.ChildObjectSource);
		///		VendorService.Save(entity);
		///	}
        ///	catch (Exception e)
        ///	{
		///		if (tm != null && tm.IsOpen) tm.Rollback();
        ///		if (DomainUtil.HandleException(e, name)) throw;
        ///	}
        ///
        /// </example>
		[DataObjectMethod(DataObjectMethodType.Update)]
		public override Vendor Save(Vendor entity)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Save");

			if (!entity.IsValid)
				throw new EntityNotValidException(entity, "Save", entity.Error);
			#endregion Security and validation check

			#region Initialisation
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				dataProvider.VendorProvider.Save(transactionManager, entity);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return entity;
		}
		#endregion Save Entity

		#region Save Collection
		///
		/// public virtual method that Saves rows in <see cref="TList{Vendor}" /> to the datasource.
		///
		/// <param name="entityCollection"><c>Vendor</c> objects in a <see cref="TList{Vendor}" /> object to Save.</param>
		/// <remarks>
		///		This function will only Save entity objects marked as dirty
		///		and have an identity field equal to zero.
		///		Upon Saveing the objects, each dirty object will have the public
		///		method <c>Object.AcceptChanges()</c> called to make it clean.
		/// 	After Saveing into the datasource, the <c>Vendor</c> objects will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		///</remarks>
		/// <returns>Returns the number of successful Save.</returns>
		/// <example>
        /// The following code shows the usage of the Save Method with a collection of Vendor.
        /// <![CDATA[
		/// TList<Vendor> list = new TList<Vendor>();
		/// Vendor entity = new Vendor();
		/// entity.StringProperty = "foo";
		/// Vendor entity2 = new Vendor();
		/// entity.StringProperty = "bar";
		/// list.Add(entity);
		/// list.Add(entity2);
		///	VendorService.Save(list);
		///	}
        ///	catch (Exception e)
        ///	{
        ///		if (DomainUtil.HandleException(e, name)) throw;
        ///	}
        /// ]]>
        /// </example>
		[DataObjectMethod(DataObjectMethodType.Update)]
		public virtual TList<Vendor> Save(TList<Vendor> entityCollection)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Save");

			if (!entityCollection.IsValid)
			{
				throw new EntityNotValidException(entityCollection, "Save", DomainUtil.GetErrorsFromList<Vendor>(entityCollection));
			}
			#endregion Security and validation check

			#region Initialisation
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				dataProvider.VendorProvider.Save(transactionManager, entityCollection);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return entityCollection;
		}
		#endregion Save Collection

		#endregion Save

		#region Delete

		#region Delete Entity
		///
		/// public virtual method that Deletes a Vendor object into the datasource using a transaction.
		///
		/// <param name="entity">Vendor object to Delete.</param>
		/// <remarks>After Deleteing into the datasource, the Vendor object will be updated
		/// to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>
		/// <returns>Returns bool that the operation is successful.</returns>
		/// <example>
        /// The following code shows the usage of the Delete Method with an already open transaction.
        ///
		///	Vendor entity = VendorService.GetByPrimaryKeyColumn(1234);
		/// entity.StringProperty = "foo";
		/// entity.IntProperty = 12;
		/// entity.ChildObjectSource.StringProperty = "bar";
		/// TransactionManager tm = null;
		/// try
        ///	{
		/// 	tm = ConnectionContext.CreateTransaction();
		///		//Delete Child entity, Then Parent Entity
		/// 	ChildObjectTypeService.Delete(entity.ChildObjectSource);
		///		VendorService.Delete(entity);
		///	}
        ///	catch (Exception e)
        ///	{
		///		if (tm != null && tm.IsOpen) tm.Rollback();
        ///		if (DomainUtil.HandleException(e, name)) throw;
        ///	}
        ///
        /// </example>
		[DataObjectMethod(DataObjectMethodType.Delete)]
		public override bool Delete(Vendor entity)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Delete");

			if (!entity.IsValid)
				throw new EntityNotValidException(entity, "Delete", entity.Error);
			#endregion Security and validation check

			#region Initialisation
			bool result = false;
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				result = dataProvider.VendorProvider.Delete(transactionManager, entity);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
			}

			return result;
		}
		#endregion Delete Entity

		#region Delete Collection
		///
		/// public virtual method that Deletes rows in <see cref="TList{Vendor}" /> to the datasource.
		///
		/// <param name="entityCollection"><c>Vendor</c> objects in a <see cref="TList{Vendor}" /> object to Delete.</param>
		/// <remarks>
		///		This function will only Delete entity objects marked as dirty
		///		and have an identity field equal to zero.
		///		Upon Deleteing the objects, each dirty object will have the public
		///		method <c>Object.AcceptChanges()</c> called to make it clean.
		/// 	After Deleteing into the datasource, the <c>Vendor</c> objects will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		///</remarks>
		/// <returns>Returns the number of successful Delete.</returns>
		/// <example>
        /// The following code shows the usage of the Delete Method with a collection of Vendor.
        /// <![CDATA[
		/// TList<Vendor> list = new TList<Vendor>();
		/// Vendor entity = new Vendor();
		/// entity.StringProperty = "foo";
		/// Vendor entity2 = new Vendor();
		/// entity.StringProperty = "bar";
		/// list.Add(entity);
		/// list.Add(entity2);
		///	VendorService.Delete(list);
		///	}
        ///	catch (Exception e)
        ///	{
        ///		if (DomainUtil.HandleException(e, name)) throw;
        ///	}
        /// ]]>
        /// </example>
		[DataObjectMethod(DataObjectMethodType.Delete)]
		public virtual TList<Vendor> Delete(TList<Vendor> entityCollection)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Delete");

			if (!entityCollection.IsValid)
			{
				throw new EntityNotValidException(entityCollection, "Delete", DomainUtil.GetErrorsFromList<Vendor>(entityCollection));
			}
			#endregion Security and validation check

			#region Initialisation
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				dataProvider.VendorProvider.Delete(transactionManager, entityCollection);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return entityCollection;
		}
		#endregion Delete Collection

		#endregion Delete

		#region   Delete
		///
		/// 	Deletes a row from the DataSource.
		///
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(VendorKey key)
		{
			return Delete(key.VendorId );
		}

		///
		/// 	Deletes a row from the DataSource based on the PK'S System.Int32 _vendorId
		///
		/// <param name="_vendorId">Vendor pk id.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		[DataObjectMethod(DataObjectMethodType.Delete)]
		public virtual bool Delete(System.Int32 _vendorId)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("Delete");
			#endregion Security check

			#region Initialisation
			bool result = false;
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;

				//since this is a read operation, don't create a tran by default, only use tran if provided to us for custom isolation level
				transactionManager = ConnectionScope.ValidateOrCreateTransaction();
				dataProvider = ConnectionScope.Current.DataProvider;

				result = dataProvider.VendorProvider.Delete(transactionManager, _vendorId);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return result;

		}
		#endregion

		#region  GetBy m:m Aggregate Relationships
		#region GetByProductIdFromProductVendor
		///
		///		Gets Vendor objects from the datasource by ProductID in the
		///		ProductVendor table. Table Vendor is related to table Product
		///		through the (M:N) relationship defined in the ProductVendor table.
		///
		/// <param name="_productId">Primary key. Foreign key to Product.ProductID.</param>
		/// <returns>Returns a typed collection of Vendor objects.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual TList<Vendor> GetByProductIdFromProductVendor(System.Int32 _productId)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByProductIdFromProductVendor");
			#endregion Security check

			#region Initialisation
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.GetByProductIdFromProductVendor(transactionManager, _productId);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return list;
		}

		///
		///		Gets Vendor objects from the datasource by ProductID in the
		///		ProductVendor table. Table Vendor is related to table Product
		///		through the (M:N) relationship defined in the ProductVendor table.
		///
		/// <param name="_productId">Primary key. Foreign key to Product.ProductID.</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="totalCount">Out param: Total Number of results returned.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Vendor objects.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual TList<Vendor> GetByProductIdFromProductVendor(System.Int32 _productId, int start, int pageLength, out int totalCount)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByProductIdFromProductVendor");
			#endregion Security check

			#region Initialisation
			totalCount = -1;
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.GetByProductIdFromProductVendor(transactionManager, _productId, start,  pageLength, out totalCount);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return list;
		}
		#endregion GetByProductIdFromProductVendor

		#region GetByAddressIdFromVendorAddress
		///
		///		Gets Vendor objects from the datasource by AddressID in the
		///		VendorAddress table. Table Vendor is related to table Address
		///		through the (M:N) relationship defined in the VendorAddress table.
		///
		/// <param name="_addressId">Primary key. Foreign key to Address.AddressID.</param>
		/// <returns>Returns a typed collection of Vendor objects.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual TList<Vendor> GetByAddressIdFromVendorAddress(System.Int32 _addressId)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByAddressIdFromVendorAddress");
			#endregion Security check

			#region Initialisation
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.GetByAddressIdFromVendorAddress(transactionManager, _addressId);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return list;
		}

		///
		///		Gets Vendor objects from the datasource by AddressID in the
		///		VendorAddress table. Table Vendor is related to table Address
		///		through the (M:N) relationship defined in the VendorAddress table.
		///
		/// <param name="_addressId">Primary key. Foreign key to Address.AddressID.</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="totalCount">Out param: Total Number of results returned.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Vendor objects.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual TList<Vendor> GetByAddressIdFromVendorAddress(System.Int32 _addressId, int start, int pageLength, out int totalCount)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByAddressIdFromVendorAddress");
			#endregion Security check

			#region Initialisation
			totalCount = -1;
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.GetByAddressIdFromVendorAddress(transactionManager, _addressId, start,  pageLength, out totalCount);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return list;
		}
		#endregion GetByAddressIdFromVendorAddress

		#region GetByContactIdFromVendorContact
		///
		///		Gets Vendor objects from the datasource by ContactID in the
		///		VendorContact table. Table Vendor is related to table Contact
		///		through the (M:N) relationship defined in the VendorContact table.
		///
		/// <param name="_contactId">Contact (Vendor employee) identification number. Foreign key to Contact.ContactID.</param>
		/// <returns>Returns a typed collection of Vendor objects.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual TList<Vendor> GetByContactIdFromVendorContact(System.Int32 _contactId)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByContactIdFromVendorContact");
			#endregion Security check

			#region Initialisation
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.GetByContactIdFromVendorContact(transactionManager, _contactId);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return list;
		}

		///
		///		Gets Vendor objects from the datasource by ContactID in the
		///		VendorContact table. Table Vendor is related to table Contact
		///		through the (M:N) relationship defined in the VendorContact table.
		///
		/// <param name="_contactId">Contact (Vendor employee) identification number. Foreign key to Contact.ContactID.</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="totalCount">Out param: Total Number of results returned.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of Vendor objects.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual TList<Vendor> GetByContactIdFromVendorContact(System.Int32 _contactId, int start, int pageLength, out int totalCount)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("GetByContactIdFromVendorContact");
			#endregion Security check

			#region Initialisation
			totalCount = -1;
			TList<Vendor> list = null;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				list = dataProvider.VendorProvider.GetByContactIdFromVendorContact(transactionManager, _contactId, start,  pageLength, out totalCount);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }

			return list;
		}
		#endregion GetByContactIdFromVendorContact

		#endregion	N2N Relationships

		#region Custom Methods
		#endregion

		#region DeepLoad
		#region Deep Load By Entity Keys

		///
		/// public virtualDeep Loads the requested <see cref="Vendor"/> by the entity keys.  The criteria of the child
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		///
		/// <param name="_accountNumber">Vendor account (identification) number.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">Vendor Property Collection Type Array To Include or Exclude from Load</param>
		/// <returns>Returns an instance of the <see cref="Vendor"/> class and DeepLoaded.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual Vendor DeepLoadByAccountNumber(System.String _accountNumber, bool deep, DeepLoadType deepLoadType, params System.Type[] childTypes)
		{
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("DeepLoadByAccountNumber");
			bool isBorrowedTransaction = ConnectionScope.Current.HasTransaction;

			Vendor entity = GetByAccountNumber(_accountNumber);

			//Check to see if entity is not null, before attempting to Deep Load
			if (entity != null)
				DeepLoad(entity, deep, deepLoadType, childTypes);

			return entity;
		}

		///
		/// public virtualDeep Loads the requested <see cref="Vendor"/> by the entity keys.  The criteria of the child
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		///
		/// <param name="_vendorId">Primary key for Vendor records.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">Vendor Property Collection Type Array To Include or Exclude from Load</param>
		/// <returns>Returns an instance of the <see cref="Vendor"/> class and DeepLoaded.</returns>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual Vendor DeepLoadByVendorId(System.Int32 _vendorId, bool deep, DeepLoadType deepLoadType, params System.Type[] childTypes)
		{
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("DeepLoadByVendorId");
			bool isBorrowedTransaction = ConnectionScope.Current.HasTransaction;

			Vendor entity = GetByVendorId(_vendorId);

			//Check to see if entity is not null, before attempting to Deep Load
			if (entity != null)
				DeepLoad(entity, deep, deepLoadType, childTypes);

			return entity;
		}

		#endregion

		#region DeepLoad By Entity
		///
		/// public virtualDeep Load the IEntity object with all of the child
		/// property collections only 1 Level Deep.
		///
		/// <param name="entity">Vendor Object</param>
		/// <remarks>
		/// <seealso cref="DeepLoad(Vendor)"/> overloaded methods for a recursive N Level deep loading method.
		/// </remarks>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual void DeepLoad(Vendor entity)
		{
			DeepLoad(entity, false, DeepLoadType.ExcludeChildren, System.Type.EmptyTypes);
		}

		///
		/// public virtualDeep Load the IEntity object with all of the child
		/// property collections only 1 Level Deep.
		///
		/// <remarks>
		/// <seealso cref="DeepLoad(Vendor)"/> overloaded methods for a recursive N Level deep loading method.
		/// </remarks>
		/// <param name="entity">Vendor Object</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual void DeepLoad(Vendor entity, bool deep)
		{
			DeepLoad(entity, deep, DeepLoadType.ExcludeChildren, System.Type.EmptyTypes);
		}

		///
		/// public virtualDeep Loads the <see cref="IEntity"/> object with criteria based of the child
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		///
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="entity">The <see cref="Vendor"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively load all Property Collections that are descendants of this instance.
		/// If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">Vendor Property Collection Type Array To Include or Exclude from Load</param>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual void DeepLoad(Vendor entity, bool deep, DeepLoadType deepLoadType, params System.Type[] childTypes)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("DeepLoad");
			#endregion Security check

			#region Initialisation
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				dataProvider.VendorProvider.DeepLoad(transactionManager, entity, deep, deepLoadType, childTypes);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }
			return;
		}
		#endregion

		#region DeepLoad By Entity Collection
		///
		/// Deep Loads the <see cref="TList{Vendor}" /> object with all of the child
		/// property collections only 1 Level Deep.
		///
		/// <remarks>
		/// <seealso cref="DeepLoad(Vendor)"/> overloaded methods for a recursive N Level deep loading method.
		/// </remarks>
		/// <param name="entityCollection">the <see cref="TList{Vendor}" /> Object to deep loads.</param>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual void DeepLoad(TList<Vendor> entityCollection)
		{
			DeepLoad(entityCollection, false, DeepLoadType.ExcludeChildren, System.Type.EmptyTypes);
		}

		///
		/// Deep Loads the <see cref="TList{Vendor}" /> object.
		///
		/// <remarks>
		/// <seealso cref="DeepLoad(Vendor)"/> overloaded methods for a recursive N Level deep loading method.
		/// </remarks>
		/// <param name="entityCollection">the <see cref="TList{Vendor}" /> Object to deep loads.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		[DataObjectMethod(DataObjectMethodType.Select)]
		public virtual void DeepLoad(TList<Vendor> entityCollection, bool deep)
		{
			DeepLoad(entityCollection, deep, DeepLoadType.ExcludeChildren, System.Type.EmptyTypes);
		}

		///
		/// Deep Loads the entire <see cref="TList{Vendor}" /> object with criteria based of the child
		/// property collections only N Levels Deep based on the DeepLoadType.
		///
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire collection's object graph.
		/// </remarks>
		/// <param name="entityCollection">The <see cref="TList{Vendor}" /> instance to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType"><see cref="DeepLoadType"/> Enumeration to Include/Exclude object property collections from Load.
		///		Use DeepLoadType.IncludeChildren, ExcludeChildren to traverse the entire object graph.
		///	</param>
		/// <param name="childTypes"><see cref="Vendor"/> Property Collection Type Array To Include or Exclude from Load</param>
		[DataObjectMethod(DataObjectMethodType.Select, false)]
		public override void DeepLoad(TList<Vendor> entityCollection, bool deep, DeepLoadType deepLoadType, params System.Type[] childTypes)
		{
			#region Security check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("DeepLoad");
			#endregion Security check

			#region Initialisation
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				transactionManager = ConnectionScope.ValidateOrCreateTransaction(noTranByDefault);
				dataProvider = ConnectionScope.Current.DataProvider;

				dataProvider.VendorProvider.DeepLoad(transactionManager, entityCollection, deep, deepLoadType, childTypes);
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }
			return;
		}
		#endregion

		#endregion

		#region DeepSave

		#region DeepSave By Entity
		///
		/// public virtualDeep Saves the <see cref="Vendor"/> object with all of the child
		/// property collections N Levels Deep.
		///
		/// <param name="entity">Vendor Object</param>
		[DataObjectMethod(DataObjectMethodType.Update)]
		public override bool DeepSave(Vendor entity)
		{
			return DeepSave(entity, DeepSaveType.ExcludeChildren, System.Type.EmptyTypes);
		}

		///
		/// public virtualDeep Saves the entire object graph of the Vendor object with criteria based of the child
		/// Type property array and DeepSaveType.
		///
		/// <param name="entity">Vendor Object</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes"><c>Vendor</c> property Type Array To Include or Exclude from Save</param>
		[DataObjectMethod(DataObjectMethodType.Update)]
		public override bool DeepSave(Vendor entity, DeepSaveType deepSaveType, params System.Type[] childTypes)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("DeepSave");

			if (!entity.IsValid)
			{
				throw new EntityNotValidException(entity, "DeepSave");
			}
			#endregion Security and validation check

			#region Initialisation
			bool result = false;
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;

				//since this is a read operation, don't create a tran by default, only use tran if provided to us for custom isolation level
				transactionManager = ConnectionScope.ValidateOrCreateTransaction();
				dataProvider = ConnectionScope.Current.DataProvider;

				result = dataProvider.VendorProvider.DeepSave(transactionManager, entity, deepSaveType, childTypes);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }
			return result;
		}
		#endregion

		#region DeepSave By Entity Collection
		///
		/// Deep Save the entire <see cref="TList{Vendor}" /> object with all of the child
		/// property collections.
		///
		/// <param name="entityCollection">TList{Vendor} Object</param>
		[DataObjectMethod(DataObjectMethodType.Update)]
		public virtual bool DeepSave(TList<Vendor> entityCollection)
		{
			return DeepSave(entityCollection, DeepSaveType.ExcludeChildren, System.Type.EmptyTypes);
		}

		///
		/// Deep Save the entire object graph of the <see cref="TList{Vendor}" /> object with criteria based of the child
		/// property collections.
		///
		/// <param name="entityCollection"><see cref="TList{Vendor}" /> Object</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">Vendor Property Collection Type Array To Include or Exclude from Save</param>
		[DataObjectMethod(DataObjectMethodType.Update)]
		public override bool DeepSave(TList<Vendor> entityCollection, DeepSaveType deepSaveType, params System.Type[] childTypes)
		{
			#region Security and validation check
			// throws security exception if not authorized
			SecurityContext.IsAuthorized("DeepSave");

			if (!entityCollection.IsValid)
			{
				throw new EntityNotValidException(entityCollection, "DeepSave");
			}
			#endregion Security and validation check

			#region Initialisation
			bool result = false;
			bool isBorrowedTransaction = false;
			TransactionManager transactionManager = null;
			NetTiersProvider dataProvider = null;
			#endregion Initialisation

			try
            {
				isBorrowedTransaction = ConnectionScope.Current.HasTransaction;

				//since this is a read operation, don't create a tran by default, only use tran if provided to us for custom isolation level
				transactionManager = ConnectionScope.ValidateOrCreateTransaction();
				dataProvider = ConnectionScope.Current.DataProvider;

				result = dataProvider.VendorProvider.DeepSave(transactionManager, entityCollection,  deepSaveType, childTypes);

				if (!isBorrowedTransaction && transactionManager != null && transactionManager.IsOpen)
					transactionManager.Commit();
			}
            catch (Exception exc)
            {
				#region Handle transaction rollback and exception
                if (transactionManager != null && transactionManager.IsOpen)
					transactionManager.Rollback();

				//Handle exception based on policy
                if (DomainUtil.HandleException(exc, layerExceptionPolicy))
					throw;
				#endregion Handle transaction rollback and exception
            }
			return result;
		}
		#endregion

		#endregion

		#endregion Data Access Methods

	}//End Class
} // end namespace

redpajama_set_name: RedPajamaGithub


Fantastic Garden Ideas Under Trees Concept – A lot of people that need to get furnishings just don't know where to begin. You will find a substantial amount of alternatives to select from and areas to get it from. For those who have battled to discover in which the best deals on furnishings are, then read the following sentences.
When buying aged goods, look at the underside of each part. Occasionally, more aged furniture is apparently in great shape when it really is not. Old furnishings might be overwhelmed with such things as rust and even free of moisture decay.
Examine the sides for any wooden furnishings for the way the hardwood is linked collectively. An excellent furniture needs to be what's known as "timber signed up with" the location where the two sections are literally jointed for any reliable attachment. If alternatively you're achieved with fingernails or toenails or adhesive, locate a more sensible choice. The furniture may not last for very long when signed up with in that way.
In order to be absolutely certain that you are acquiring a piece of household furniture made using woodland managing methods in your mind, try to find the FSC recognition. There are numerous of qualifications close to, many of which are excellent. However, the FSC accreditation particularly is reputed internationally for woodland control.
Look into a thrift shop. Maybe you have in no way visited one, or it has been some time because you went along to one particular. You can actually discover some good household furniture within them. It is possible to discover wonderful more compact items, but from time to time, you might find a sofa that fits your needs.
Before buying household furniture, be sure you are testing it. When it appears as though a smart idea to obtain furniture on-line, nothing can beat in fact tests it at a store. It might look great but be awful to stay on, or maybe the fabric could be scratchy and stiff. You will be more satisfied not building a buy before you realize it is what you want.
Usually, furniture can be negotiated in value. However a sales representative clearly would like to offer an item for as far as possible, these are usually ready to undermine. So, if you find one thing you enjoy but it is also costly, give a less costly value. If they are not willing to give up, let them know you may do business in other places.
Look at the people who use your household furniture most frequently. Living on your own, your furniture will likely be casually applied, but when you have young children, purchase durable sections. If there are household pets around the house you should determine what form of textiles should be utilized on your seating and couches. A lot of pets have shedding problems, where there are textiles prone to obtaining head of hair as opposed to others.
Take into account the other considerations you presently very own when you find yourself selecting what part of new furniture to select. You need to ensure the latest object mixes effectively with the cloth, accomplish and components of your own pre-existing sections so that the whole room runs together. Thinking ahead will help to prevent delivering residence a brand new object that fails to work within the room.
If you are purchasing a settee, make certain you sit at very least for several a few minutes on each one of these. You want to ensure that you feel absolutely comfy whenever you sit down inside it. The couch must offer you business help without letting your system sag. A settee that is certainly also delicate can present you with a backache.
Look over the particular thighs the furniture has. They ought not to be glued or nailed into place. As an alternative, they will be jointed to the lower item. They should be manufactured from wood and really large. Great-finish sofas ought to have a fifth leg in between to aid a further excess weight of high quality.
Resale outlets are a great location to locate offers on household furniture. You may probably find the best choice of affordable furnishings in impressive condition. Frequently, the sections at resale stores are better manufactured compared to those present in spending budget retailers.
It should be clear to you that receiving household furniture isn't definitely all of that hard. As soon as you what you are interested in it's rather very clear ways to get what you would like. Use almost everything this article has taught you and also you'll be experiencing the home furniture purchase you made in the approaching days and nights.
Can you love decor and desire that you might transform your property-redecorating visions into beautiful fact? Well, that you can do exactly that. This article provides some fantastic advice, ideas and great tricks to acquire began. Utilize this suggestions to help you create spaces that you could be happy with.
Everyone ought to keep in mind that a disposition needs to be created when building a room. You ought to have your disposition under consideration and make your style go in addition to it. If you are trying to discover rest in the room, for example, then stick to hues that evoke warmth and subtlety.
When selecting colours to your home design, stay away from going with fads. Olive green wall surfaces might have been preferred when after an occasion, but it will make your house seem out dated. Choose neutral colors that could endure the exam of energy. Like that, you would not feel like you will need to repaint each and every year.
A good investment in high quality art work may be beneficial. You may not be really interested in art, but the proper item can draw every thing together within the room. A great piece of art may give your room a centerpiece where one can commence to enhance all around it.
For those who have a backsplash within your kitchen that you really detest, think about piece of art it. Painting a backsplash is not really a tricky task, and it may entirely change the design of your kitchen. It is additionally a significantly less-costly alternative than getting rid of and swapping the current backsplash. You may also work with a grout pencil to paint in new grout collections when you are accomplished.
Be creative with image picture frames. They could be used to include some design to a place, also. They don't really need to be put up in direct, side to side facial lines. Consider hanging them in well planned styles or facets. Try using your remaining white-colored place to create interesting effects and alter your rooms' disposition.
If you have an open surface prepare, try to choose a theme that passes through your home. Not almost everything in your home must match up, but there ought to be something that ties each and every space with each other. Clashing or contrasting designs can certainly make your own home appearance chaotic and will detract from the good thing about every person area.
Don't forget your flooring surfaces! So many individuals invest some time fixing the wall surfaces and obtaining household furniture they neglect 1 aspect of an area that will convert it: the surface. In case you have tired, used carpeting, look at transforming over to an effortless, bright wood work surface. Wood laminate can also work. These resources are sparkling, don't get as dirty, and look considerably more sleek.
An excellent home design suggestion is to try to obtain the judgment of any musician when you're thinking about making modifications. People typically consider they know best making each of their very own style options without the enter. An musician has trained their eyes and they also generally may help you make reliable design choices.
Many people have got a little areas with their residences that they need to make appear larger. Lighter in weight shades help to make smaller areas really feel and look larger. Deeper hues produce a space seem smaller than it actually is.
Feel practically if you are participating in an indoor remodelling project. You would like your decor to mirror your individuality, but try out to stay away from something too outlandish or strange. If you would like promote your house, you may want to tone along the eccentric designing. Should you do insist on beautifying within your special way, make sure that what ever you choose to do is definitely reversible.
Artwork may be the final touch for any design and style undertaking. To get the best results, hang your art at an eye levels. Be sure you pick parts with subject material that complements the design of the area and improves the wanted frame of mind to make an decor that runs very easily coming from a piece to bit.
Although you may have carpeted with your living area you can place a region carpet in the seating area to create a nice contact. You can put it so that it is released ahead of the seated location. This way, you will find a nice rug to look at, along with your rug looking at your sofa will not get donned.
Now you have a better knowledge of what is needed to make those spaces that wow, you may get moving on creating your personal awesome areas. Should you put into action the suggestions presented previously mentioned, you will certainly be planning up a storm before you know it. Begin these days.


text:
Urban Container Gardening, a hope for food sustainability
Nath Mindanao - Jun 26, 2018
Spending Friday Nights with Mindanao Music
Nath Mindanao - May 8, 2018
COPERS Holds 3rd Round of Mental Health Awareness Seminar-Workshop
Ethel Joyce Boligor - May 1, 2018
Tribute: PWC Annual Fashion Graduation Show
Richard Diongson - Mar 2, 2018
Home Campus & Culture
Minute Burger shares Happiness to the Children of Tribu Matigsalog
Campus & Culture Richard Diongson - Feb 24, 2018
Not just a minute but a day of happiness was shared by Minute Burger to the children of Tribu Matigsalog in Arakan, North Cotabato this morning,February 24, 2018. Over 300 children received gifts and enjoyed cheeseburgers and drinks. For Minute Burger, it's time to go big time and it's time to inspire more. (The view of 300 children, smiling in great excitement...
Colorful Opening Ceremony Marks 2nd Edition of Inaul Festival
Inaul Festival is a week-long celebration that promotes the colorful Inaul fabric that reflects the vibrance of the Maguindanaon culture, together with the weavers who painstakingly created them. Inaul is Maguindanao's local hand-woven fabric. It is a treasured cultural tradition as it captures the Maguindanao symbol of distinction and royalty and is passed from mothers to daughters. This year's festival revolves...
One-of-a-Kind Gift Ideas You Can Use this Valentine's Day
Valentine's Day is coming up, which means you'll have to start looking for a gift soon. Here are some great ideas which you can use to wow your significant other. This year, make Valentine's Day one to remember when you treat your partner to: A perfect combination Those "His" and "Hers" items you find in department stores may seem cheesy to some, but...
All set for 2nd Inaul Festival in Maguindanao
Campus & Culture Richard Diongson - Jan 28, 2018
Spotlight on for Maguindanaon women weavers in Mindanao as the Provincial Government of Maguindanao celebrate this years Inaul Festival, come February 5-14 in the Municipality of Buluan. Inaul, a Maguindanaon word that literally means "woven", is a unique fabric manually and meticulously woven and is no longer confined to "malong" and other traditional garments. The color of inaul fabric reflects the...
Virtualahan: Breaking Down Employment Barriers for PWDs
Finding a sustainable source of income is one of the biggest challenge that People with Disabilities (PWD) face on daily basis. People with medical, mental and physical limitations are not just battling for their condition but enduring the inequality in the workplace primarily because of discrimination. "We equip people with skills and the right mindset so they can start working...
Solenn Heusaff's new solo art exhibit "Kalsada"
Campus & Culture Richard Diongson - Nov 3, 2017
Solenn Heussaff's vision to turn street life into art comes to life as Globe brings "Kalsada", Heussaff's second solo exhibit, to art lovers in Bonifacio Global City. "Kalsada" opened Friday, October 19, 2017 at the Provenance Gallery of Modern Art located in Shangri-La at the Fort. Heussaff describes the exhibit as a collaboration between her and her three-year-old nephew, Kaeden. "The...
Global Filipino Schools launches eLib to help 15M Filipino students
Campus & Culture Penpen Villamora - Oct 4, 2016
Globe's Global Filipino Schools launched Its elibrary to benefit over 15 Million K-12 public school students and more than 500 Thousand public school teachers during the National Teachers Day celebration last September 30 at Ateneo de Davao University. The GFSLibrary.com contains more than 1,000 free downloadable K-12 appropriate content ebooks for core-subjects. It's easy download, you just need to create an...
Globe launches eLibrary to Benefit over 15M public school students nationwide
Campus & Culture Penpen Villamora - Sep 29, 2016
Over a thousand educational e-books appropriate for K-1 learning will be made available to over 15 million public elementary and high school students and some 5000.000 public school teachers nationwide beginning September 30 as part of the Global Filipino School 9GFS0 program of leading telecommunications company Globe Telecom. The GFS Library launch coincides with the National Teachers Day celebration of...

redpajama_set_name: RedPajamaCommonCrawl


text:
<?php

function send_response($msg, $isError = false)
{
    header("Content-Type: application/json");
    echo json_encode(array(
        'status' => $isError ? 'failed' : 'ok',
        'response' => $msg
    ));
}

class Client
{
    public static function getName($decoded)
    {
        $name = isset($decoded['name']) ? $decoded['name'] : '';
        $res = preg_replace("/[^A-Za-z0-9?!]/", '', $name);
        return $res;
    }

    public static function getTel($decoded)
    {
        $tel = isset($decoded['tel']) ? $decoded['tel'] : '';
        $res = preg_replace('/\D/', "", $tel);
        return $res;
    }

    public static function getCaptcha($decoded)
    {
        return isset($decoded['captcha']) ? $decoded['captcha'] : '';
    }
}

class RequestMethod
{
    const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify';

    public static function post($secret, $response)
    {
        /**
         * PHP 5.6.0 changed the way you specify the peer name for SSL context options.
         * Using "CN_name" will still work, but it will raise deprecated errors.
         */
        $peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name';
        $params = array('secret' => $secret, 'response' => $response);

        $options = array(
            'http' => array(
                'header' => "Content-type: application/x-www-form-urlencoded\r\n",
                'method' => 'POST',
                'content' => http_build_query($params, '', '&'),
                // Force the peer to validate (not needed in 5.6.0+, but still works
                'verify_peer' => true,
                // Force the peer validation to use www.google.com
                $peer_key => 'www.google.com',
            ),
        );
        $context = stream_context_create($options);
        return file_get_contents(self::SITE_VERIFY_URL, false, $context);
    }
}

class ClientValidator
{
    public static function tel($input)
    {
        return isset($input) ? strlen($input) === 11 : false;
    }

    public static function name($input)
    {
        return isset($input) ? strlen($input) >= 2 : false;
    }

    private static $secret = '6Lc-9gkTAAAAAAyzlwaXfrKV2bgE97t8G19L3pJG';

    public static function captcha($input)
    {
        $res = false;
        if (!empty($input)) {
            $responseData = json_decode(RequestMethod::post(self::$secret, $input), true);
            $res = isset($responseData['success']) && $responseData['success'] == true;
        }
        return $res;
    }

    /**
     * @param $decoded
     * @return array|bool
     */
    public static function hasErrors($decoded)
    {
        $res = array();
        $errors = array();

        if (!self::tel($decoded['tel'])) {
            $errors[] = 'Телефон';
        }

        if (!self::name($decoded['name'])) {
            $errors[] = 'Имя';
        }

        if (!self::captcha($decoded['captcha'])) {
            $errors[] = 'Робот?';
        }

        return count($errors) ? $errors : false;
    }

}

function addCallback($name, $tel)
{
    $urlTempl = 'http://78.140.6.16:4077/execsvcscriptplain?name=web&startparam1=callback&startparam2={phone}&async=0&timeout=30';
    $url = str_replace('{phone}', $tel, $urlTempl);
   // $url = str_replace('name=web', 'name=' . $name, $url);

    $username = 'web';
    $password = 'WCnX39vNY9hGTj5C1ADApk2r';

    $options = array(
        'http' => array(
            'header' => "Authorization: Basic " . base64_encode("$username:$password"),
            'method' => 'GET'
        ),
    );
    $context = stream_context_create($options);

    $resp = file_get_contents($url, false, $context);

    //file_put_contents('input_resp', $resp);

    return $resp;
}

function checkCallbackResponse($resp)
{
    // нет смысла париться и разбирать xml
    return strpos($resp, 'ok') !== false;
}

// main

$ajax;
$req;

try {

    if (isset($_POST['ajax'])) {
        $ajax = $_POST['ajax'];
        $decoded = json_decode($ajax, true);
        $errors = array();

        $errors = ClientValidator::hasErrors($decoded);
        if ($errors) {
            throw new Exception(implode(', ', $errors));
        }

        $name = Client::getName($decoded);
        $tel = Client::getTel($decoded);

     //   file_put_contents('input.txt', file_get_contents("php://input"));

        $callAnswer = addCallback($name, $tel);

        if (!checkCallbackResponse($callAnswer)) {
            $hasError = true;
            send_response('Заявка не принята', $hasError);
        } else {
            $hasError = false;
            send_response('Заявка принята', $hasError);
        }

    } else {
        throw new HttpInvalidParamException('ajax param was not received');
    }

} catch (Exception $e) {
    $hasError = true;
    send_response($e->getMessage(), $hasError);
}