예제 #1
0
 private void btOk_Click(object sender, EventArgs e)
 {
     if (tbUsername.Enabled)
     {
         if (tbUsername.Text.Length == 0)
         {
             MessageBox.Show(this, Resources.MsgBox_UserMandatory, Resources.MsgBox_Title_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         if (AuthenticationHandlerModule.GetUsers().Contains <string>(tbUsername.Text))
         {
             MessageBox.Show(this, Resources.MsgBox_UserNameExist, Resources.MsgBox_Title_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         AuthenticationHandlerModule.SetPassword(tbUsername.Text, tbUserPassword.Text);
         lvUsers.Items.Add(new ListViewItem(tbUsername.Text));
     }
     else
     {
         AuthenticationHandlerModule.SetPassword(tbUsername.Text, tbUserPassword.Text);
     }
     btCancel_Click(sender, e);
 }
예제 #2
0
 private void btSaveGlobalPassword_Click(object sender, EventArgs e)
 {
     AuthenticationHandlerModule.SetPassword(tbPassword.Text);
     tbPassword.Text = string.Empty;
     MessageBox.Show(this, Resources.MsgBox_PasswordSaved, Resources.MsgBox_Title_Save, MessageBoxButtons.OK, MessageBoxIcon.Information);
 }