private void btnback_Click(object sender, EventArgs e)
        {
            this.Hide();
            mainform f = new mainform();

            f.Show();
        }
Пример #2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            DialogResult resualt = MessageBox.Show("Вы уверены,что хотите удалить заказ?", "Удалить", MessageBoxButtons.YesNo);

            if (resualt.ToString() == "Yes")
            {
                f = true;
                comboBox4.Enabled = true;
                comboBox6.Enabled = true;
                string s = Convert.ToString(ListSell[1].ID);
                string l = @"Update animals a,bill b  set a.count_a=a.count_a+b.count where a.id_a=b.id_a and b.id_sell=" + s + ";";
                db.ExecuteNonQuery("zoo.db", l, 0);
                string k = @"delete from sell a  where a.id_sell=" + s + ";";
                db.ExecuteNonQuery("zoo.db", k, 0);
                ListSell.Clear();
                MessageBox.Show("Заказ отменен");
                button1.Visible   = false;
                btnbasket.Enabled = false;
            }
            //add delete sell and bill
            mainform a = new mainform();

            this.Hide();
            a.Show();
        }
Пример #3
0
        private void LogIn()
        {
            string           loginuser = tblog.Text;
            string           passuser  = tbpas.Text;
            DataBase         db        = new DataBase();
            DataTable        table     = new DataTable();
            MySqlDataAdapter adapter   = new MySqlDataAdapter();
            MySqlCommand     command   = new MySqlCommand("SELECT * FROM `enter` WHERE `login`=@log AND `password`=@pas", db.getconn());

            command.Parameters.Add("@log", MySqlDbType.VarChar).Value = loginuser;
            command.Parameters.Add("@pas", MySqlDbType.VarChar).Value = passuser;
            adapter.SelectCommand = command;
            adapter.Fill(table);
            if (table.Rows.Count > 0)
            {
                this.Hide();
                mainform f = new mainform();
                f.Show();
            }
            else
            {
                MessageBox.Show("Такого пользователя нет в системе или неверный пароль", "Ошибка входа", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #4
0
 private void btnback_Click(object sender, EventArgs e)
 {
     this.Hide();
     a.Show();
 }