コード例 #1
0
        private void button7_Click(object sender, EventArgs e)
        {
            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(1);

            PBDA.Show();
            this.Close();
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            Boolean mozna      = true;
            String  trescBledu = "Nie mozna usunac stanowiska " + Stanowisko.Rows[0][1] + " ponieważ: ";

            sda = new SqlDataAdapter("select count(*) from PRACOWNICY where ID_STANOWISKA='" + id + "'", conn);
            DataTable check1 = new DataTable();

            sda.Fill(check1);

            if (Convert.ToString(check1.Rows[0][0]) != "0")
            {
                mozna      = false;
                trescBledu = trescBledu + "\nIstnieją jeszcze pracownicy na tym stanowisku";
            }

            sda = new SqlDataAdapter("select count(*) from OFERTY where ID_STANOWISKA='" + id + "'", conn);
            DataTable check2 = new DataTable();

            sda.Fill(check2);

            if (Convert.ToString(check2.Rows[0][0]) != "0")
            {
                mozna      = false;
                trescBledu = trescBledu + "\nIstnieją jeszcze oferty na to stanowisko";
            }

            sda = new SqlDataAdapter("select count(*) from Podania where ID_STANOWISKA='" + id + "'", conn);
            DataTable check3 = new DataTable();

            sda.Fill(check3);

            if (Convert.ToString(check3.Rows[0][0]) != "0")
            {
                mozna      = false;
                trescBledu = trescBledu + "\nIstnieją jeszcze podania na to stanowisko";
            }

            if (mozna)
            {
                Sq = new SqlCommand("DELETE FROM STANOWISKA WHERE ID_STANOWISKA='" + id + "'", conn);
                conn.Open();
                SqlDataReader SDR = Sq.ExecuteReader();
                conn.Close();

                MessageBox.Show("Usunięto STANOWISKO!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

                PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(1);
                PBDA.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show(trescBledu, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("INSERT INTO STANOWISKA (ID_DZIALU, NAZWA_STANOWISKA, MIEJSCA, UPRAWNIENIA) VALUES ('" + IDDZIALU + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Dodano Stanowisko!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(1);

            PBDA.Show();
            this.Close();
        }
コード例 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("UPDATE OFERTY set ID_STANOWISKA='" + indexStanowiska + "', NAZWA_STANOWISKA='" + textBox2.Text + "', OPIS='" + textBox3.Text + "', WYMOGI='" + textBox4.Text + "', WYNAGRODZENIE='" + textBox5.Text + "', DOSTEPNE_MIEJSCA='" + textBox6.Text + "' where ID__OFERTY='" + id + "'", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Edytowano Oferte!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(3);

            PBDA.Show();
            this.Close();
        }
コード例 #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("DELETE FROM OFERTY WHERE ID__OFERTY='" + id + "'", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Usunięto Oferte!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(3);

            PBDA.Show();
            this.Close();
        }
コード例 #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("INSERT INTO DZIAL (NAZWA_DZIALU) VALUES ('" + textBox1.Text + "')", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Dodano Dział!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(4);

            PBDA.Show();
            this.Close();
        }
コード例 #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("INSERT INTO OFERTY (ID_STANOWISKA, NAZWA_STANOWISKA, OPIS, WYMOGI, WYNAGRODZENIE, DOSTEPNE_MIEJSCA) VALUES ('" + indexStanowiska + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "')", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Dodano Oferte!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(3);

            PBDA.Show();
            this.Close();
        }
コード例 #8
0
        private void button3_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("DELETE FROM PRACOWNICY WHERE ID_PRACOWNIKA='" + id + "'", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Usunięto Pracownika!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(0);

            PBDA.Show();
            this.Close();
        }
コード例 #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("UPDATE PRACOWNICY set ID_STANOWISKA='" + IDSTANOWISKA + "', ID_DZIALU='" + IDDZIALU + "', IMIE_PRACOWNIKA='" + textBox1.Text + "', NAZWISKO_PRACOWNIKA='" + textBox2.Text + "', E_MAIL_PRACOWNIKA='" + textBox3.Text + "', HASLO_PRACOWNIKA='" + textBox4.Text + "' where ID_PRACOWNIKA='" + id + "'", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Zmieniono informacje!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(0);

            PBDA.Show();
            this.Close();
        }
コード例 #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("UPDATE STANOWISKA set ID_DZIALU='" + IDDZIALU + "' , NAZWA_STANOWISKA='" + textBox2.Text + "', MIEJSCA='" + textBox3.Text + "', UPRAWNIENIA='" + textBox4.Text + "' where ID_STANOWISKA='" + id + "'", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Zmieniono Stanowisko!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(1);

            PBDA.Show();
            this.Close();
        }
コード例 #11
0
        private void button3_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("UPDATE PODANIA set STAN='1' where ID_PODANIA='" + id + "'", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Odłożono Podanie!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(2);

            PBDA.Show();
            this.Close();
        }
コード例 #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("UPDATE DZIAL set NAZWA_DZIALU='" + textBox1.Text + "' where ID_DZIALU='" + id + "'", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Edytowano Dział!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(4);

            PBDA.Show();
            this.Close();
        }
コード例 #13
0
        private void button1_Click(object sender, EventArgs e)
        {
            Sq = new SqlCommand("INSERT INTO PRACOWNICY (ID_STANOWISKA, ID_DZIALU, IMIE_PRACOWNIKA, NAZWISKO_PRACOWNIKA, E_MAIL_PRACOWNIKA, HASLO_PRACOWNIKA) VALUES ('" + IDSTANOWISKA + "','" + IDDZIALU + "','" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')", conn);
            conn.Open();
            SqlDataReader SDR = Sq.ExecuteReader();

            conn.Close();

            MessageBox.Show("Dodano Pracownika!", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information);

            PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(0);

            PBDA.Show();
            this.Close();
        }
コード例 #14
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            SqlDataAdapter sda;
            DataTable      dtt;
            SqlConnection  conn = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;Integrated Security=True;AttachDbFilename=|DataDirectory|\BazaDanych.mdf"); sda = new SqlDataAdapter("select count(*) from STANOWISKA INNER JOIN PRACOWNICY ON STANOWISKA.ID_STANOWISKA = PRACOWNICY.ID_STANOWISKA where PRACOWNICY.E_MAIL_PRACOWNIKA ='" + textBox1.Text + "' and PRACOWNICY.HASLO_PRACOWNIKA='" + textBox2.Text + "' and STANOWISKA.UPRAWNIENIA='Administrator'", conn);

            dtt = new DataTable();
            sda.Fill(dtt);
            if (dtt.Rows[0][0].ToString() == "1")
            {
                this.Hide();
                PrzeglądanieBDAdmin PBDA = new PrzeglądanieBDAdmin(0);

                sda = new SqlDataAdapter("select IMIE_PRACOWNIKA, NAZWISKO_PRACOWNIKA from PRACOWNICY where E_MAIL_PRACOWNIKA ='" + textBox1.Text + "' and HASLO_PRACOWNIKA='" + textBox2.Text + "'", conn);
                DataTable dttt = new DataTable();
                sda.Fill(dttt);

                MessageBox.Show("Witamy " + dttt.Rows[0][0] + " " + dttt.Rows[0][1] + "", "Witamy!", MessageBoxButtons.OK, MessageBoxIcon.Information);

                PBDA.Show();
            }
            else
            {
                sda = new SqlDataAdapter("select count(*) from STANOWISKA INNER JOIN PRACOWNICY ON STANOWISKA.ID_STANOWISKA = PRACOWNICY.ID_STANOWISKA where PRACOWNICY.E_MAIL_PRACOWNIKA ='" + textBox1.Text + "' and PRACOWNICY.HASLO_PRACOWNIKA='" + textBox2.Text + "'", conn);
                dtt = new DataTable();
                sda.Fill(dtt);
                if (dtt.Rows[0][0].ToString() == "1")
                {
                    MessageBox.Show("Przepraszamy! Nie posiadasz uprawnień administratora ", "alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Prosze podaj poprawny email i haslo", "alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }