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;
using System.Data.SqlClient;

namespace diplom
{
    public partial class fWorker : Form
    {


       public dataBase dataBase;
       public login login;
        public adminForm adminForm;
        public DataGridView dt;
        
       



        public fWorker()
        {
            InitializeComponent();
            

        }



        private void fWorker_Load(object sender, EventArgs e)
        {

            dataBase.Show();
            dataBase.Visible = false;
            if (dataBase.workerisDataGridView.Rows[0].Cells[0].Value != null)
            {
                groupBox1.Visible = true;
                pib.Text = dataBase.workerisDataGridView.Rows[0].Cells[1].Value.ToString();
                posada.Text = dataBase.workerisDataGridView.Rows[0].Cells[2].Value.ToString();
                money.Text = dataBase.workerisDataGridView.Rows[0].Cells[3].Value.ToString();
                stazh.Text = dataBase.workerisDataGridView.Rows[0].Cells[4].Value.ToString();
                efect.Text = dataBase.workerisDataGridView.Rows[0].Cells[5].Value.ToString();
            }

            if (dataBase.workerisDataGridView.Rows[1].Cells[0].Value != null)
            {
                groupBox2.Visible = true;
                textBox10.Text = dataBase.workerisDataGridView.Rows[1].Cells[1].Value.ToString();
                textBox9.Text = dataBase.workerisDataGridView.Rows[1].Cells[2].Value.ToString();
                textBox8.Text = dataBase.workerisDataGridView.Rows[1].Cells[3].Value.ToString();
                textBox7.Text = dataBase.workerisDataGridView.Rows[1].Cells[4].Value.ToString();
                textBox6.Text = dataBase.workerisDataGridView.Rows[1].Cells[5].Value.ToString();
            }

            if (dataBase.workerisDataGridView.Rows[2].Cells[0].Value != null)
            {
                groupBox3.Visible = true;
                textBox15.Text = dataBase.workerisDataGridView.Rows[2].Cells[1].Value.ToString();
                textBox14.Text = dataBase.workerisDataGridView.Rows[2].Cells[2].Value.ToString();
                textBox13.Text = dataBase.workerisDataGridView.Rows[2].Cells[3].Value.ToString();
                textBox12.Text = dataBase.workerisDataGridView.Rows[2].Cells[4].Value.ToString();
                textBox11.Text = dataBase.workerisDataGridView.Rows[2].Cells[5].Value.ToString();
            }


        }

        private void fWorker_FormClosed(object sender, FormClosedEventArgs e)
        {
            //login.Show();
            adminForm.Show();
            this.Hide();
            dataBase.Hide();
            
           
        }



        private void додатиToolStripMenuItem_Click(object sender, EventArgs e)
        {

            
        }

        private void groupBox1_Enter(object sender, EventArgs e)
        {

        }

        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

      

    }
}
    
