Exemplo n.º 1
0
 private void _bLogin_Click(object sender, RoutedEventArgs e)
 {
     if (_cbUsers.SelectedIndex <= 0)
     {
         _tbUserMessage.Text = TextByTag(16);
         _bClear_Click(sender, e);
         ClearUserInfo.Start();
     }
     else if (InsertedPSW.Length != 4)
     {
         _tbUserMessage.Text = TextByTag(15);
         _tbPassword.Text    = "";
         InsertedPSW         = "";
         ClearUserInfo.Start();
     }
     else
     {
         if (CheckUser())
         {
             LoggedUser          = TextByTag(Convert.ToInt16(SelectedUser["UsernameTag"].ToString()));
             LoggedUserLevel     = (_cGlobalVariables.Permission)Convert.ToInt32(SelectedUser["AccessMask"].ToString());
             _tbName.Text        = LoggedUser;
             _tbPermission.Text  = TextByTag(Convert.ToInt16(SelectedUser["IdentificationTag"].ToString()));
             _tbUserMessage.Text = TextByTag(18);
             _bClear_Click(sender, e);
             ClearUserInfo.Start();
             _cGlobalVariables._wMainWindowInterface.SetPermissions((int)LoggedUserLevel);
         }
         else
         {
             _tbUserMessage.Text = TextByTag(15);
             _bClear_Click(sender, e);
             ClearUserInfo.Start();
         }
     }
 }
Exemplo n.º 2
0
 public void LoginDefaultUser(int value)
 {
     SelectedUser    = _cGlobalVariables.Ds_Users.Tables[0].Rows[value - 1];
     LoggedUser      = TextByTag(Convert.ToInt16(SelectedUser["UsernameTag"].ToString()));
     LoggedUserLevel = (_cGlobalVariables.Permission)Convert.ToInt32(SelectedUser["AccessMask"].ToString());
 }