You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.3 KiB
71 lines
2.3 KiB
using System.Windows;
|
|
|
|
namespace Housing.Login
|
|
{
|
|
/*
|
|
* Usage in App.xaml.cs or Program.cs:
|
|
*
|
|
* var loginWindow = new Housing.Login.StartupLoginWindow();
|
|
* if (loginWindow.ShowDialog() != true)
|
|
* {
|
|
* return;
|
|
* }
|
|
*
|
|
* StartupLoginWindowResult loginResult = loginWindow.Result;
|
|
*/
|
|
|
|
public sealed class StartupLoginWindowResult
|
|
{
|
|
public string Maker { get; set; } = string.Empty;
|
|
public string Model { get; set; } = string.Empty;
|
|
public string ColorCode { get; set; } = string.Empty;
|
|
public string Operator { get; set; } = string.Empty;
|
|
public string Password { get; set; } = string.Empty;
|
|
public string LineNo { get; set; } = string.Empty;
|
|
public string LotNo { get; set; } = string.Empty;
|
|
public string JigNo { get; set; } = string.Empty;
|
|
}
|
|
|
|
public partial class StartupLoginWindow : Window
|
|
{
|
|
public StartupLoginWindowResult Result { get; private set; } = new StartupLoginWindowResult();
|
|
|
|
public StartupLoginWindow()
|
|
{
|
|
InitializeComponent();
|
|
PasswordBox.Password = "test";
|
|
}
|
|
|
|
private void LogInButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(OperatorTextBox.Text))
|
|
{
|
|
MessageBox.Show(this, "Please enter Operator.", "Login", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
OperatorTextBox.Focus();
|
|
return;
|
|
}
|
|
|
|
if (string.IsNullOrWhiteSpace(PasswordBox.Password))
|
|
{
|
|
MessageBox.Show(this, "Please enter Password.", "Login", MessageBoxButton.OK, MessageBoxImage.Warning);
|
|
PasswordBox.Focus();
|
|
return;
|
|
}
|
|
|
|
Result = new StartupLoginWindowResult
|
|
{
|
|
Maker = MakerTextBox.Text.Trim(),
|
|
Model = ModelTextBox.Text.Trim(),
|
|
ColorCode = ColorCodeTextBox.Text.Trim(),
|
|
Operator = OperatorTextBox.Text.Trim(),
|
|
Password = PasswordBox.Password,
|
|
LineNo = LineNoTextBox.Text.Trim(),
|
|
LotNo = LotNoTextBox.Text.Trim(),
|
|
JigNo = JigNoTextBox.Text.Trim()
|
|
};
|
|
|
|
DialogResult = true;
|
|
Close();
|
|
}
|
|
}
|
|
}
|
|
|