示例#1
0
 private void EnviarPeriodo()
 {
     using (RLogin rem = new RLogin())
     {
         UserCache.C_idperiodo = rem.GetIdPeriodo(Convert.ToInt32(Num_periodo.Value));
         UserCache.C_periodo   = Num_periodo.Value.ToString();
     }
 }
        private void loginbtn_Click(object sender, EventArgs e)
        {
            RLogin l = new RLogin();

            l.Id       = this.UidtBox.Text;
            l.Password = this.UpasstBox.Text;

            LoginRepository LoginRepo = new LoginRepository();

            if (LoginRepo.UserLoginValidation(l))
            {
                if (l.Type == 1)
                {
                    string      id   = l.Id;
                    string      name = l.Name;
                    Admin_Panel AP   = new Admin_Panel(id, name);
                    AP.Show();
                    this.Hide();
                }
                else if (l.Type == 2)
                {
                    string         id   = l.Id;
                    string         name = l.Name;
                    Employee_Panel EP   = new Employee_Panel(id, name);
                    EP.Show();
                    this.Hide();
                }
                else if (l.Type == 3)
                {
                    string id   = l.Id;
                    string name = l.Name;

                    Passenger_Panel PP = new Passenger_Panel(id, name);
                    PP.Show();
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("Invalid Id or Password", "Login Failed");
            }
        }
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            Usuario user  = new Usuario();
            RLogin  login = new RLogin();

            if (Usertext.Text.Length > 0 && pwdText.Text.Length > 0)
            {
                if (login.Auntenticar(Usertext.Text, pwdText.Text))
                {
                    FormsAuthentication.RedirectFromLoginPage(user.Email, true);
                }
                else
                {
                    Utils.ShowToastr(this.Page, "Usuario o contraseña Incorrecta", "Error", "error");
                }
            }
            else
            {
                Utils.ShowToastr(this.Page, "Debe ingresar su usuario y contraseña", "Error", "error");
            }
        }