private void btnInapoi_Click(object sender, EventArgs e)
        {
            conectare.ConectareBazDate();
            conn = conectare.ConectareBazDate();

            OleDbCommand cmdSelect;

            OleDbDataReader reader;

            conn.Open();

            cmdSelect = new OleDbCommand("SELECT Rol FROM Conturi where Conturi.idCont = @idCont", conn);
            cmdSelect.Parameters.AddWithValue("@idCont", Cont);
            reader = cmdSelect.ExecuteReader();

            reader.Read();



            if (reader.GetValue(0).ToString() == "Administrator")
            {
                this.Hide();
                var meniu = new MeniuAdministrator(Cont);
                meniu.ShowDialog();
                this.Close();
            }
            else
            {
                if (reader.GetValue(0).ToString() == "Personal Hotel")
                {
                    this.Hide();
                    var meniu = new MeniuPersonalHotel(Cont);
                    meniu.ShowDialog();
                    this.Close();
                }
                else
                {
                    if (reader.GetValue(0).ToString() == "Personal Restaurant")
                    {
                        this.Hide();
                        var meniu = new MeniuPersonalRestaurant(Cont);
                        meniu.ShowDialog();
                        this.Close();
                    }


                    else
                    {
                        if (reader.GetValue(0).ToString() == "ResponsabilEvenimente")
                        {
                            this.Hide();
                            var meniu = new MeniuResponsabilEvenimente(Cont);
                            meniu.ShowDialog();
                            this.Close();
                        }
                    }
                }
            }
        }
Exemple #2
0
        private void btnAprobare_Click(object sender, EventArgs e)
        {
            conn.Open();
            OleDbCommand cmd = new OleDbCommand();



            cmd.Connection  = conn;
            cmd.CommandText = " UPDATE  SolicitariEvenimente SET Aprobare = 'Aprobat' where idSolicitare =@Solicitare";
            cmd.Parameters.AddWithValue("@Soliocitare", dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[6].Value.ToString());

            cmd.ExecuteNonQuery();
            conn.Close();
            this.Hide();
            var vizualizareCont = new MeniuResponsabilEvenimente(cont);

            vizualizareCont.ShowDialog();
            this.Close();
        }
Exemple #3
0
        public void btnConectare_Click(object sender, EventArgs e)
        {
            conectare.ConectareBazDate();
            conn = conectare.ConectareBazDate();

            OleDbCommand cmdSelect, cmdSelect2;

            OleDbDataReader reader, reader2;

            conn.Open();
            // verificarea existentei user-ului
            cmdSelect = new OleDbCommand("SELECT User, Parola, Rol FROM Conturi where Conturi.User = @User AND Conturi.Parola = @Parola", conn);
            cmdSelect.Parameters.AddWithValue("@User", this.txtUser.Text);
            cmdSelect.Parameters.AddWithValue("@Parola", this.txtParola.Text);
            reader = cmdSelect.ExecuteReader();

            if (reader.HasRows)
            {
                reader.Read();
                cmdSelect2 = new OleDbCommand("SELECT idCont FROM Conturi where Conturi.User = @User", conn);
                cmdSelect2.Parameters.AddWithValue("@User", this.txtUser.Text);
                reader2 = cmdSelect2.ExecuteReader();

                reader2.Read();
                idCont = reader2.GetValue(0);

                if (reader.GetValue(2).ToString() == "Client")
                {
                    this.Hide();
                    var meniu = new MeniuClient(idCont);
                    meniu.ShowDialog();
                    this.Close();
                }
                else
                {
                    if (reader.GetValue(2).ToString() == "Administrator")
                    {
                        this.Hide();
                        var meniu = new MeniuAdministrator(idCont);
                        meniu.ShowDialog();
                        this.Close();
                    }
                    else
                    {
                        if (reader.GetValue(2).ToString() == "Personal Hotel")
                        {
                            this.Hide();
                            var meniu = new MeniuPersonalHotelPrincipal(idCont);
                            meniu.ShowDialog();
                            this.Close();
                        }
                        else
                        {
                            if (reader.GetValue(2).ToString() == "Personal Restaurant")
                            {
                                this.Hide();
                                var meniu = new MeniuPersonalRestaurant(idCont);
                                meniu.ShowDialog();
                                this.Close();
                            }


                            else
                            {
                                if (reader.GetValue(2).ToString() == "ResponsabilEvenimente")
                                {
                                    this.Hide();
                                    var meniu = new MeniuResponsabilEvenimente(idCont);
                                    meniu.ShowDialog();
                                    this.Close();
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("User-ul sau parola au fost introduse gresit!");
                conn.Close();
            }
        }