33 lines
998 B
C#
33 lines
998 B
C#
|
using Avalonia.Controls;
|
|||
|
using blagodat.Models;
|
|||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
|
using System.Linq;
|
|||
|
|
|||
|
namespace blagodat
|
|||
|
{
|
|||
|
public partial class MainWindow : Window
|
|||
|
{
|
|||
|
public MainWindow()
|
|||
|
{
|
|||
|
InitializeComponent();
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
private void Button_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
|||
|
{
|
|||
|
string login = loginBox.Text;
|
|||
|
string password = passwordBox.Text;
|
|||
|
using var context = new User20Context();
|
|||
|
var checkUser = context.Clients.FirstOrDefault(e => e.Email == login);
|
|||
|
bool checkPassword = checkUser.Password == password;
|
|||
|
//var checkEmployes = context.Employes.FirstOrDefault(e => e.Login == login);
|
|||
|
//bool checkPassEmpl = checkEmployes.Password == password;
|
|||
|
|
|||
|
if (!checkPassword)
|
|||
|
{
|
|||
|
PasswordCheck.Text = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|