using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace LLNet.DAL
{
	/// <summary>
	/// Summary description for SqlServerDAL.
	/// </summary>
	public class SqlServerDAL : System.Windows.Forms.UserControl, IDAL
  	{
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		private Hashtable queryMap;

        public string ConnectionString(string connName)
        {
            return null;
        }


		public SqlServerDAL()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			OnLoadQueries += new OnLoadQueriesEventHandler(LoadQueries);
			OnLoadQueries();

		}


		private void LoadQueries()
		{
			QueryMap = new System.Collections.Hashtable();
//			QueryMap.Add("beginPaging","SELECT * FROM (	SELECT x.*, ROWNUM tupla FROM (");
//			QueryMap.Add("endPaging",") x	WHERE ROWNUM <= :endPaging ) y WHERE tupla >= :beginPaging");
			QueryMap.Add("count","SELECT COUNT(1) FROM &TABLENAME&");

		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			// 
			// SqlServerDAL
			// 
			this.Name = "SqlServerDAL";
			this.Size = new System.Drawing.Size(24, 24);

		}
		#endregion

		#region IDAL Members

		public void BeginTransaction()
		{
			// TODO:  Add SqlServerDAL.BeginTransaction implementation
		}

		public void Commit()
		{
			// TODO:  Add SqlServerDAL.Commit implementation
		}

		public void Rollback()
		{
			// TODO:  Add SqlServerDAL.Rollback implementation
		}

		public void Update(IDataAdapter adp, ref DataSet ds)
		{
			// TODO:  Add SqlServerDAL.Update implementation
		}

		public int ExecuteNonQuery(string sql)
		{
			// TODO:  Add SqlServerDAL.ExecuteNonQuery implementation
			return 0;
		}

		public object ExecuteScalar(string sql)
		{
			// TODO:  Add SqlServerDAL.ExecuteEscalar implementation
			return null;
		}

		public event LLNet.DAL.OnLoadQueriesEventHandler OnLoadQueries;

		public Hashtable QueryMap
		{
			get{return queryMap;}
			set{queryMap = value;}
		}

		public bool Connect(string connName)
		{
			// TODO:  Add SqlServerDAL.Connect implementation
			return false;
		}

		public IDbConnection Connection
		{
			get
			{
				// TODO:  Add SqlServerDAL.Connection getter implementation
				return null;
			}
		}

		public IDataAdapter SelectAdapter
		{
			get
			{
				// TODO:  Add SqlServerDAL.SelectAdapter getter implementation
				return null;
			}
		}

		public IDataAdapter PagingAdapter
		{
			get
			{
				// TODO:  Add SqlServerDAL.PagingAdapter getter implementation
				return null;
			}
		}

		public IDbCommand SingleCommand
		{
			get
			{
				// TODO:  Add SqlServerDAL.SingleCommand getter implementation
				return null;
			}
		}

		public string FindSelectCmdText(string pTableName)
		{
			// TODO:  Add SqlServerDAL.FindSelectCmdText implementation
			return null;
		}

		public string SetSelectCommand(string sql)
		{
			// TODO:  Add SqlServerDAL.SetSelectCommand implementation
			return null;
		}

		string LLNet.DAL.IDAL.SetSelectCommand(string sql, long startRecord, long endRecord)
		{
			// TODO:  Add SqlServerDAL.LLNet.DAL.IDAL.SetSelectCommand implementation
			return null;
		}

		public IDataAdapter FindAdapter(string pTableName)
		{
			// TODO:  Add SqlServerDAL.FindAdapter implementation
			return null;
		}

		public DataSet FillDataSet(DataSet ds, string pTableName, IDataAdapter adapter)
		{
			// TODO:  Add SqlServerDAL.FillDataSet implementation
			return null;
		}

		object LLNet.DAL.IDAL.ExecuteScalar(string sql, bool hidden)
		{
			// TODO:  Add SqlServerDAL.LLNet.DAL.IDAL.ExecuteScalar implementation
			return null;
		}

		DataSet LLNet.DAL.IDAL.FillDataSet(DataSet ds, IDataAdapter adapter)
		{
			// TODO:  Add SqlServerDAL.LLNet.DAL.IDAL.FillDataSet implementation
			return null;
		}

		public string FindQueryInDB(string pQueryName)
		{
			// TODO:  Add SqlServerDAL.FindQueryInBDD implementation
			return null;
		}

		#endregion
	}
}
