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

namespace PayrollSystem
{
    public partial class form_main : Form
    {

        public void ShowEmployeesOnDepartment(string id)
        {
            form_employees employees = new form_employees(id);
            employees.TopLevel = false;
            employees.AutoScroll = true;
            panel1.Controls.Clear();
            panel1.Controls.Add(employees);
            employees.Show();
        }

        public form_main()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ShowDash();
        }

        void ShowDash()
        {
            form_dashboard dashboard = new form_dashboard();
            dashboard.TopLevel = false;
            dashboard.AutoScroll = true;
            panel1.Controls.Clear();
            panel1.Controls.Add(dashboard);
            dashboard.Show();
        }

        private void btnEmployees_Click(object sender, EventArgs e)
        {
            form_employees employees = new form_employees();
            employees.TopLevel = false;
            employees.AutoScroll = true;
            panel1.Controls.Clear();
            panel1.Controls.Add(employees);
            employees.Show();
        }

        private void btn_departments_Click(object sender, EventArgs e)
        {
            form_departments deparments = new form_departments(this);
            deparments.TopLevel = false;
            deparments.AutoScroll = true;
            panel1.Controls.Clear();
            panel1.Controls.Add(deparments);
            deparments.Show();

        }

        private void form_main_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void form_main_Load(object sender, EventArgs e)
        {
            ShowDash();
        }
    }
}
