Пример #1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            FrAdminMenu r = new FrAdminMenu();

            r.Visible = true;
            this.Hide();
        }
Пример #2
0
        private void btnLogin_Click_1(object sender, EventArgs e)
        {
            try
            {
                List <Usuario> TodaLaPeople = new List <Usuario>();
                TodaLaPeople = BS.MantenimientoLogin._Instancia.Login();

                int largo = Convert.ToInt32(TodaLaPeople.Count.ToString());

                for (int i = 0; i < largo; i++)
                {
                    String user   = TodaLaPeople[i]._Username.ToString();
                    String pass   = TodaLaPeople[i]._Pass.ToString();
                    String exUser = txtUsuario.Text;
                    String exPass = txtPass.Text;


                    if (exUser.Equals(user) && exPass.Equals(pass))
                    {
                        if (exUser.Equals("admin"))
                        {
                            FrAdminMenu AM = new FrAdminMenu();
                            AM.Visible = true;
                            this.Hide();
                        }
                        else
                        {
                            FrMenu re = new FrMenu();



                            usuario  = TodaLaPeople[i]._Nombre.ToString();
                            re._user = usuario;
                            this.Hide();
                            re.Show();
                        }
                    }
                    else
                    {
                        lbIncorrecto.Visible = true;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }