示例#1
0
        private void ValidateUser()
        {
            try
            {
                // valida user
                SysUser newUser = service.UserAuthentication(
                    new SysUser
                {
                    UserName = txtUsername.Text,
                    Password = txtPassword.Password,
                    Domain   = App.curUser.Domain
                });

                // valida si tiene permisos para la opción enviada
                if (Util.AllowOption(menuOption, newUser.UserRols[0].Rol))
                {
                    App.curAuthUser = newUser.UserName;
                    DialogResult    = true;
                    Close();
                }
                else
                {
                    Util.ShowError("Unauthorized User.");
                    DialogResult = false;
                }
            }
            catch (Exception ex)
            {
                Util.ShowError(ex.Message);
            }
        }
示例#2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (Util.AllowOption(menuOption))
     {
         DialogResult = true;
         Close();
     }
 }