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

namespace DataQueryAccess
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
        }

        private void mnuQueryData_Click(object sender, EventArgs e)
        {
            DataConnection lobjConnection = new DataConnection("DataBase.mdb", "", "", DatabaseManager.Access);
            string lstrSQL = "SELECT * FROM Staff";
            DataTable ldatData = lobjConnection.SQLSelectExecute(lstrSQL);
            lobjConnection.CloseConnection();

            DataRow ldarRow;
            int[] lintHiddenColumns = new int[2];

            lintHiddenColumns[0] = 0;
            lintHiddenColumns[1] = 4;
    
            ldarRow = Utilities.ShowQueryDataWindow(ldatData, lintHiddenColumns, "Query Data SwanCSharp 2.0", " Main Data ", QueryWindowSize.Medium, InterfaceLanguage.English, true);
        }

        private void queryDataModifyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataConnection lobjConnection = new DataConnection("DataBase.mdb", "", "", DatabaseManager.Access);
            string lstrSQL = "SELECT * FROM Staff";
            DataTable ldatData = lobjConnection.SQLSelectExecute(lstrSQL);
            lobjConnection.CloseConnection();


            ldatData = Utilities.ShowQueryDataModifyWindow(ldatData, null, "Query Data SwanCSharp 2.0", " Main Data ", QueryWindowSize.Medium, InterfaceLanguage.English, true);
        }
    }
}