Login debugging

This commit is contained in:
Robert McRackan 2021-07-29 07:39:14 -04:00
parent 69a7ab5b0c
commit d4fbb03577
5 changed files with 20 additions and 7 deletions

View File

@ -12,6 +12,8 @@ namespace LibationWinForms.Dialogs.Login
private void approvedBtn_Click(object sender, EventArgs e) private void approvedBtn_Click(object sender, EventArgs e)
{ {
Serilog.Log.Logger.Information("Submit button clicked");
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
} }

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Dinah.Core;
using InternalUtilities; using InternalUtilities;
namespace LibationWinForms.Dialogs.Login namespace LibationWinForms.Dialogs.Login
@ -29,6 +30,8 @@ namespace LibationWinForms.Dialogs.Login
Email = accountId; Email = accountId;
Password = this.passwordTb.Text; Password = this.passwordTb.Text;
Serilog.Log.Logger.Information("Submit button clicked: {@DebugInfo}", new { email = Email?.ToMask(), passwordLength = Password.Length });
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
// Close() not needed for AcceptButton // Close() not needed for AcceptButton
} }

View File

@ -26,6 +26,8 @@ namespace LibationWinForms.Dialogs.Login
{ {
Answer = this.answerTb.Text; Answer = this.answerTb.Text;
Serilog.Log.Logger.Information("Submit button clicked: {@DebugInfo}", new { Answer });
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
// Close() not needed for AcceptButton // Close() not needed for AcceptButton
} }

View File

@ -63,26 +63,29 @@ namespace LibationWinForms.Dialogs.Login
public string SelectedValue { get; private set; } public string SelectedValue { get; private set; }
private void submitBtn_Click(object sender, EventArgs e) private void submitBtn_Click(object sender, EventArgs e)
{ {
Serilog.Log.Logger.Information("RadioButton states: {@DebugInfo}", new { var selected = radioButtons.FirstOrDefault(rb => rb.Checked);
Serilog.Log.Logger.Information("Submit button clicked: {@DebugInfo}", new {
rb1_visible = radioButton1.Visible, rb1_visible = radioButton1.Visible,
rb1_checked = radioButton1.Checked, rb1_checked = radioButton1.Checked,
r21_visible = radioButton2.Visible, rb2_visible = radioButton2.Visible,
r21_checked = radioButton2.Checked, rb2_checked = radioButton2.Checked,
rb3_visible = radioButton3.Visible, rb3_visible = radioButton3.Visible,
rb3_checked = radioButton3.Checked rb3_checked = radioButton3.Checked,
isSelected = selected is not null,
name = selected?.Name,
value = selected?.Tag
}); });
var selected = radioButtons.FirstOrDefault(rb => rb.Checked);
if (selected is null) if (selected is null)
{ {
MessageBox.Show("No MFA option selected", "None selected", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("No MFA option selected", "None selected", MessageBoxButtons.OK, MessageBoxIcon.Error);
return; return;
} }
Serilog.Log.Logger.Information("Selected: {@DebugInfo}", new { isSelected = selected is not null, name = selected?.Name, value = selected?.Tag });
SelectedName = selected.Name; SelectedName = selected.Name;
SelectedValue = (string)selected.Tag; SelectedValue = (string)selected.Tag;

View File

@ -15,6 +15,9 @@ namespace LibationWinForms.Dialogs.Login
private void submitBtn_Click(object sender, EventArgs e) private void submitBtn_Click(object sender, EventArgs e)
{ {
Code = this.codeTb.Text; Code = this.codeTb.Text;
Serilog.Log.Logger.Information("Submit button clicked: {@DebugInfo}", new { Code });
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
} }