login
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using InfosysPublisher.Classes;
|
||||
using Microsoft.Data.SqlClient;
|
||||
|
||||
@@ -19,16 +20,37 @@ namespace InfosysPublisher
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
tbUsername.KeyDown += (sender, args) =>
|
||||
{
|
||||
if (args.Key != Key.Enter) return;
|
||||
tbPassword.Focus();
|
||||
};
|
||||
tbPassword.KeyDown += (sender, args) =>
|
||||
{
|
||||
if (args.Key != Key.Enter) return;
|
||||
Login();
|
||||
};
|
||||
|
||||
tblVersion.Text = $"Version: {App.CurrentVersion}";
|
||||
|
||||
tbUsername.Focus();
|
||||
}
|
||||
|
||||
private async void Login_OnClick(object sender, RoutedEventArgs e)
|
||||
private void Login_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Login();
|
||||
}
|
||||
|
||||
private async void Login()
|
||||
{
|
||||
var succeeded = false;
|
||||
var isLockedOut = false;
|
||||
|
||||
var username = tbUsername.Text;
|
||||
var password = tbPassword.Password;
|
||||
|
||||
tbPassword.Password = "";
|
||||
|
||||
User user = null;
|
||||
|
||||
await Task.Run(() =>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:local="clr-namespace:InfosysPublisher"
|
||||
mc:Ignorable="d"
|
||||
Icon="infosysPublisher.ico"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="Infosys-Publisher" Height="445" Width="580">
|
||||
<Grid Margin="10, 0, 10, 10">
|
||||
<Grid.RowDefinitions>
|
||||
|
||||
Reference in New Issue
Block a user