Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                authorization = new Authorization(txbx_login.Text, txbx_password.Text);
                serverConn    = new SQLServerConnect(@"DESKTOP-0PMHTR5", "FruitVegetablesShop", $"{authorization.Login}", $"{authorization.Password}");

                if (!serverConn.OpenSqlConnection())
                {
                    MessageBox.Show("Unable to login, you entered an incorrect username or password");
                    return;
                }
                SetRole(authorization.Login);
                SQLConnectionEvent?.Invoke(serverConn);
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }