This commit is contained in:
David Štaleker
2024-08-02 11:13:53 +02:00
parent 1459205ef3
commit 1dc48d2d85
2 changed files with 24 additions and 1 deletions

View File

@@ -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(() =>

View File

@@ -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>