using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using DataSetToDoTableAdapters;
using System.ComponentModel;

/// <summary>
/// Summary description for ClassBLL
/// </summary>
[Serializable, DataObject()]
public class ClassBLL
{
	#region [Class Members]

	private DBTableAdapter _adapterDB;

	#endregion

	#region [Constrators]

	/// <summary>
	/// Default constructor.
	/// </summary>
	public ClassBLL()
	{

	}

	#endregion

	#region [Methods]

	/// <summary>
	/// Delete an item.
	/// </summary>
	/// <param name="Original_Id">Integer. ItemId.</param>
	/// <returns>Integer. Number of affected items.</returns>
	[DataObjectMethodAttribute(DataObjectMethodType.Delete, true)]
	public int Delete(int Original_Id)
	{
		return (AdapterDB.Delete(Original_Id));
	}

	/// <summary>
	/// Insert a new item.
	/// </summary>
	/// <param name="?">Type. Description.</param>
	/// <returns>Integer. Number of affected items.</returns>
	[DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
	public cInsert(?)
	{
		return (AdapterDB.Insert(?));
	}

	/// <summary>
	/// Get item by its id.
	/// </summary>
	/// <param name="intItemId">Integer. Item Id.</param>
	/// <returns>DBDataTable</returns>
	[DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
	public DataSetDB.DBDataTable GetItem(int intItemId)
	{
		return (AdapterDB.GetDataById(intItemId));
	}


	/// <summary>
	/// Update an item.
	/// </summary>
	/// <param name="?">Type. Description.</param>
	/// <param name="original_Id">Integer. Template id.</param>
	[DataObjectMethodAttribute(DataObjectMethodType.Update, true)]
	public int Update(?, int Original_Id)
	{
		return (AdapterDB.Update(?, Original_Id));
	}

	#endregion

	#region [Class Properties]



	#endregion

	#region [Data Adapters]

	/// <summary>
	/// DB table adapter.
	/// </summary>
	public DBTableAdapter AdapterDB
	{
		get
		{
			if(_adapterDB== null)
				_adapterDB = new DBTableAdapter();

			return(_adapterDB);
		}
	}

	#endregion
}