Example #1
0
        private void LoginBTN()
        {
            f = 0;
            if (textBnombre.Text == "" || txtpass.Text == "")
            {
                lbl_status1.Text = "Complete los campos";
                f = 1;// si no ingresamos algun dato entonces no nos permitira continuar entonces tenemos q ingresar todos los datos
            }
            if (f == 0)
            {
                string observer = Link_BD.Login(textBnombre.Text, txtpass.Text);
                switch (observer)
                {
                    case "Usuario no existe":
                        {
                            lbl_status1.Text = "Usuario no existe";
                            break;
                        }
                    case "Pass incorrecto":
                        {
                            lbl_status1.Text = "Pass incorrecto";
                            break;
                        }
                    case "OK":
                        {

                            HomeOmega A = new HomeOmega(Link_BD.get_CampoUsu("UsuNom"),this);
                            A.Show();
                            txtpass.Text = "";
                            this.Hide();
                            lbl_status1.Text = "";
                            break;
                        }
                    case "":
                        {
                            lbl_status1.Text = "Error BD";
                            break;
                        }

                }
            }
        }