예제 #1
0
        private void EmployeesBtn_Click(object sender, EventArgs e)
        {
            Key = 1;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            JobTitlesbtn.Enabled   = true;
            DepartmentsBtn.Enabled = true;
            OfficesBtn.Enabled     = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Show();
            UpdateBtn.Enabled = false;
            DeleteBtn.Show();
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select p.id_pracownika as ID, p.imie as Imie, p.nazwisko as Nazwisko,  s.nazwa as Stanowisko, d.nazwa_dzialu as 'Nazwa działu', si.nazwa_siedziby as Siedziba, si.adres as Adres" +
                         " from PRACOWNICY p join DZIALY d on p.id_dzialu=d.id_dzialu join STANOWISKA s on p.id_stanowiska=s.id_stanowiska join SIEDZIBY si on d.id_siedziby=si.id_siedziby;";

            LoadDataToSqldataGridView("Pracownicy", sql);
            EmployeesBtn.Enabled = false;
        }
예제 #2
0
        private void DepartmentsBtn_Click(object sender, EventArgs e)
        {
            Key = 4;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            EmployeesBtn.Enabled = true;
            JobTitlesbtn.Enabled = true;
            OfficesBtn.Enabled   = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            UpdateBtn.Show();
            DeleteBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Enabled = false;
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select d.nazwa_dzialu, s.nazwa_siedziby, s.adres from DZIALY d join SIEDZIBY s on  d.id_siedziby=s.id_siedziby ";

            LoadDataToSqldataGridView("Dzialy", sql);
            DepartmentsBtn.Enabled = false;
        }
예제 #3
0
        private void OfficesBtn_Click(object sender, EventArgs e)
        {
            Key = 3;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            EmployeesBtn.Enabled   = true;
            JobTitlesbtn.Enabled   = true;
            DepartmentsBtn.Enabled = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            UpdateBtn.Show();
            DeleteBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Enabled = false;
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select id_siedziby as ID ,nazwa_siedziby as Oddział, adres as Adres from SIEDZIBY ";

            LoadDataToSqldataGridView("Siedziby", sql);
            OfficesBtn.Enabled = false;
        }
예제 #4
0
        private void JobTitlesbtn_Click(object sender, EventArgs e)
        {
            Key = 2;
            tableLayoutPanel3.Hide();
            tableLayoutPanel2.Hide();
            tableLayoutPanel1.Hide();
            SaveBtn.Hide();
            EmployeesBtn.Enabled   = true;
            OfficesBtn.Enabled     = true;
            DepartmentsBtn.Enabled = true;
            SqldataGridView.Show();
            CreateBtn.Show();
            UpdateBtn.Show();
            DeleteBtn.Show();
            CreateBtn.Enabled = true;
            UpdateBtn.Enabled = false;
            DeleteBtn.Enabled = false;
            TurnOnEditBth.Show();
            MainPicture.Hide();
            string sql = "select id_stanowiska, nazwa as Stanowisko from STANOWISKA ";

            LoadDataToSqldataGridView("Stanowiska", sql);
            JobTitlesbtn.Enabled = false;
        }