using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Data.SQLite;

using RMtrix.Forms;

namespace RMtrix.Class
{
    public class dBProperties
    // adapted from C# & SQLite 1007000 By kribo | 3 May 2011, http://www.codeproject.com/Articles/190223/C-SQLite-1007000
    {
        //private dBHelper helper = null;



        private void MainGrid_Load(object sender, EventArgs e)
        {
            GetData();
        }
        private void GetData()
        {
            // Determin the ConnectionString
            string connectionString = dBFunctions.ConnectionStringSQLite;

            // Determin the DataAdapter = CommandText + Connection
            // string commandText = @"SELECT * FROM Contact ORDER BY contact_id";

/*            // Make a new object
            helper = new dBHelper(connectionString);

            // Load the data
            if (helper.Load(commandText, "") == true)
            {
                // Show the data in the datagridview
                dataGridViewMain.DataSource = helper.DataSet.Tables[0];
            }
*/        }

/*        /// <summary>
        /// Needs revision is this still required ?
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridViewMain_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            // Do something on double click, except when on the header.
            if (e.RowIndex == -1)
            {
                return;
            }
            // Have aquired a valided row
            UpdateSidePannel();
        }
        private void UpdateSidePannel()
        {
            Int32 i = Convert.ToInt32(dataGridViewMain.CurrentRow.Cells[0].Value);
            DataRow dataRow = helper.DataSet.Tables[0].Rows[i - 1];
            MessageBox.Show(dataRow[1].ToString() + ' ' + dataRow[2].ToString());
        }
*/
        
        private void bindingSourceContactList_CurrentChanged(object sender, EventArgs e)
        {

        }







    }
}
