Beispiel #1
0
        private void label7_Click(object sender, EventArgs e)
        {
            this.Hide();
            AvtoMesh avto = new AvtoMesh();

            avto.Show();
            avto.id.Text      = id;
            avto.admin        = ad;
            avto.Valutka.Text = valll;
        }
Beispiel #2
0
        private void label5_Click(object sender, EventArgs e)
        {
            DataGridViewRow row = dataGridView1.CurrentRow;

            DB        db    = new DB();
            DataTable table = new DataTable();

            MySqlDataAdapter adapter = new MySqlDataAdapter();

            MySqlCommand command = new MySqlCommand("UPDATE `zapic` set `idAv`=@namz, `nameAv`=@vidwork, `idAvu`=@adVu, `Status`=@stat WHERE `id`=@id", db.GetConnection());

            command.Parameters.Add("@id", MySqlDbType.VarChar).Value      = row.Cells[0].Value.ToString();
            command.Parameters.Add("@namz", MySqlDbType.VarChar).Value    = id;
            command.Parameters.Add("@vidwork", MySqlDbType.VarChar).Value = nameAv;
            command.Parameters.Add("@adVu", MySqlDbType.VarChar).Value    = id;
            command.Parameters.Add("@stat", MySqlDbType.VarChar).Value    = 2;



            db.openConnection();
            if (command.ExecuteNonQuery() == 1)
            {
                MessageBox.Show("Заказ взят");
                this.Hide();
                AvtoMesh avto = new AvtoMesh();
                avto.Show();
                avto.id.Text      = id;
                avto.nameAv       = nameAv;
                avto.admin        = ad;
                avto.Valutka.Text = valll;
            }

            else
            {
                MessageBox.Show("Ошибка");
            }

            db.closeConnection();
        }
Beispiel #3
0
        private void label7_Click(object sender, EventArgs e)
        {
            if (ad == "0")
            {
                this.Hide();
                Menu mainMenu = new Menu();
                mainMenu.Show();
                mainMenu.id.Text      = id1;
                mainMenu.admin        = ad;
                mainMenu.Valutka.Text = valll;
            }

            else if (ad == "1")
            {
                this.Hide();
                AdminPanel adminPanel = new AdminPanel();
                adminPanel.Show();
                adminPanel.id.Text      = id1;
                adminPanel.admin        = ad;
                adminPanel.Valutka.Text = valll;
            }
            else if (ad == "2")
            {
                this.Hide();
                AvtoMesh avto = new AvtoMesh();
                avto.Show();
                avto.id.Text      = id1;
                avto.admin        = ad;
                avto.nameAv       = nameAv;
                avto.Valutka.Text = valll;
            }
            else
            {
                MessageBox.Show("Вы даун");
            }
        }
Beispiel #4
0
        private void bLogin_Click(object sender, EventArgs e)
        {
            DB        db    = new DB();
            DataTable table = new DataTable();

            MySqlDataAdapter adapter = new MySqlDataAdapter();

            MySqlCommand command = new MySqlCommand("UPDATE `users` set `Valutka`=`Valutka`+@namz WHERE `id`=@id", db.GetConnection());

            command.Parameters.Add("@id", MySqlDbType.VarChar).Value   = id;
            command.Parameters.Add("@namz", MySqlDbType.VarChar).Value = balnc.Text;



            db.openConnection();


            if (command.ExecuteNonQuery() == 1)
            {
                MessageBox.Show("Баланс успешно пополнен");
            }

            else
            {
                MessageBox.Show("Ошибка");
            }


            db.closeConnection();


            DB        dbb    = new DB();
            DataTable ttable = new DataTable();

            MySqlDataAdapter aadapter = new MySqlDataAdapter();

            MySqlCommand ccommand = new MySqlCommand("SELECT * FROM `users` WHERE `id`=@id", dbb.GetConnection());

            ccommand.Parameters.Add("@id", MySqlDbType.VarChar).Value = id;

            aadapter.SelectCommand = ccommand;
            aadapter.Fill(ttable);

            valll = ttable.Rows[0][7].ToString();

            dbb.openConnection();

            if (ad == "1")
            {
                this.Hide();
                AdminPanel adminPanel = new AdminPanel();
                adminPanel.Show();
                adminPanel.id.Text      = id;
                adminPanel.admin        = ad;
                adminPanel.Valutka.Text = valll;
            }
            if (ad == "2")
            {
                this.Hide();
                AvtoMesh avtoMesh = new AvtoMesh();
                avtoMesh.id.Text      = id;
                avtoMesh.admin        = ad;
                avtoMesh.Valutka.Text = valll;
            }
            if (ad == "0")
            {
                this.Hide();
                Menu mainMenu = new Menu();
                mainMenu.Show();
                mainMenu.id.Text      = id;
                mainMenu.admin        = ad;
                mainMenu.Valutka.Text = valll;
            }



            dbb.closeConnection();
        }
Beispiel #5
0
        public void bLogin_Click(object sender, EventArgs e)
        {
            String loginUser = loginField.Text;
            String passUser  = passField.Text;

            DB db = new DB();

            DataTable table = new DataTable();

            MySqlDataAdapter adapter = new MySqlDataAdapter();

            MySqlCommand command = new MySqlCommand("SELECT * FROM `users` WHERE `login`=@uL AND `pass`=@uP AND `Admin` != 'NULL'", db.GetConnection());

            command.Parameters.Add("@uL", MySqlDbType.VarChar).Value = loginUser;
            command.Parameters.Add("@uP", MySqlDbType.VarChar).Value = passUser;


            adapter.SelectCommand = command;
            adapter.Fill(table);
            if (table.Rows.Count == 0

                )
            {
                MessageBox.Show("Такого аккаунта не существует");
                return;
            }


            admin = table.Rows[0][6].ToString();
            if (table.Rows.Count > 0 && admin == "0")
            {
                this.Hide();
                Menu mainForm = new Menu();
                mainForm.Show();
                mainForm.id.Text      = table.Rows[0][0].ToString();
                mainForm.admin        = table.Rows[0][6].ToString();
                mainForm.Valutka.Text = table.Rows[0][7].ToString();
            }

            else if (table.Rows.Count > 0 && admin == "1")
            {
                this.Hide();
                AdminPanel adminchik = new AdminPanel();
                adminchik.Show();
                adminchik.id.Text      = table.Rows[0][0].ToString();
                adminchik.admin        = table.Rows[0][6].ToString();
                adminchik.Valutka.Text = table.Rows[0][7].ToString();
            }
            else if (table.Rows.Count > 0 && admin == "2")
            {
                this.Hide();
                AvtoMesh adminc = new AvtoMesh();
                adminc.Show();
                adminc.id.Text      = table.Rows[0][0].ToString();
                adminc.admin        = table.Rows[0][6].ToString();
                adminc.nameAv       = table.Rows[0][3].ToString();
                adminc.Valutka.Text = table.Rows[0][7].ToString();
            }
            else
            {
                MessageBox.Show("No");
            }
        }