private void btnRefresh_Click(object sender, EventArgs e)
        {
            LoginDetails k = new LoginDetails();
            Connection g = new Connection();

            using (SqlConnection con = new SqlConnection(g.connectionClass()))
            {
                using (SqlCommand cmd = new SqlCommand("SELECT Report_Title, Report_DateTime, Report_Recipient, Report_Content FROM Synch_Report WHERE Report_UserAccount=" + k.GetUserID(), con))
                {
                    cmd.CommandType = CommandType.Text;
                    using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
                    {
                        using (DataTable dt = new DataTable())
                        {
                            sda.Fill(dt);
                            gridview.DataSource = dt;
                            gridview.AutoGenerateColumns = false;

                            gridview.Columns["Report_Title"].HeaderText = "Title";
                            gridview.Columns["Report_DateTime"].HeaderText = "Date Time Created";
                            gridview.Columns["Report_DateTime"].HeaderText = "Recipient";
                            gridview.Columns["Report_Content"].HeaderText = "Content";

                        }
                    }
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            LoginDetails lg = new LoginDetails();
            lg.Synch_EmpNo = txtEmpNo.Text;
            lg.Synch_EmpPass = txtPass.Text;

            if (lg.GetValidationResults() == 1)
            {
                this.Hide();
                var form2 = new MainForm();
                form2.Show();
            }
            else
            {
                MessageBox.Show("Sorry but Employee ID / Password does not exists!", "Error Login");
            }
        }
        private void SendReportNew()
        {
            Connection g = new Connection();
            LoginDetails l = new LoginDetails();
            using (SqlConnection connection = new SqlConnection(g.connectionClass()))
            {
                connection.Open();
                SqlCommand addSite = new SqlCommand("INSERT INTO Synch_Report (Report_UserAccount ,Report_Title, Report_DateTime, Report_Recipient, Report_Content)" +
                                     "VALUES (@report_account,@report_title, @report_date, @report_recipient, @report_content)", connection);
                addSite.Parameters.AddWithValue("@report_account", l.GetUserID());
                addSite.Parameters.AddWithValue("@report_title", textBox1.Text);
                addSite.Parameters.AddWithValue("@report_date", DateTime.Now.ToString());
                addSite.Parameters.AddWithValue("@report_recipient", comboBox1.SelectedValue.ToString());
                addSite.Parameters.AddWithValue("@report_content", richTextBox1.Text);

                addSite.ExecuteNonQuery();
                MessageBox.Show("Your Report has been submitted to your Manager.");
                txtManager.Text = "";
                textBox1.Text = "";
                richTextBox1.Text = "";
                connection.Close();
            }
        }
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.synch_AccountsTableAdapter.Fill(this.synchDataDataSet.Synch_Accounts);
            LoginDetails k = new LoginDetails();
            Inside l = new Inside();
            label4.Text = "Welcome," + l.GetMyName(k.GetUserID()) + "!";
            timer1.Enabled = true;
            timer1.Interval = 1000;

            Connection g = new Connection();

            using (SqlConnection con = new SqlConnection(g.connectionClass()))
            {
                using (SqlCommand cmd = new SqlCommand("SELECT Report_Title, Report_DateTime, Report_Recipient, Report_Content FROM Synch_Report WHERE Report_UserAccount=" + k.GetUserID(), con))
                {
                    cmd.CommandType = CommandType.Text;
                    using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
                    {
                        using (DataTable dt = new DataTable())
                        {
                            sda.Fill(dt);
                            gridview.DataSource = dt;
                            gridview.AutoGenerateColumns = false;

                            gridview.Columns["Report_Title"].HeaderText = "Title";
                            gridview.Columns["Report_DateTime"].HeaderText = "Date Time Created";
                            gridview.Columns["Report_DateTime"].HeaderText = "Recipient";
                            gridview.Columns["Report_Content"].HeaderText = "Content";

                        }
                    }
                }
            }
        }