コード例 #1
0
ファイル: Sell.cs プロジェクト: VictoriyaPetruk/project_zoo
        private void btnback_Click(object sender, EventArgs e)
        {
            this.Hide();
            mainform f = new mainform();

            f.Show();
        }
コード例 #2
0
 public basketfrm(mainform a)
 {
     this.a = a;
     InitializeComponent();
     this.btnclean.BackColor = System.Drawing.Color.Transparent;
     this.label1.BackColor   = System.Drawing.Color.Transparent;
     this.btnback.BackColor  = System.Drawing.Color.Transparent;
     this.lbhead.BackColor   = System.Drawing.Color.Transparent;
 }
コード例 #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);
            }
        }