Добавьте файлы проекта.

This commit is contained in:
zxckawory
2026-09-03 20:49:08 +03:00
parent b76a11ae22
commit e221eda36a
35 changed files with 975 additions and 0 deletions
@@ -0,0 +1,36 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using zooManagerPro.Context;
using zooManagerPro.Models;
namespace zooManagerPro.ViewModels
{
public partial class LoginViewModel : ObservableObject
{
[ObservableProperty]
public partial string Login { get; set; }
[ObservableProperty]
public partial string Password { get; set; }
[RelayCommand]
public async Task EntranceAsync()
{
await using ZooManagerProContext context = new();
if (context.Employees.FirstOrDefault(x => x.Login == Login && x.Password == Password) is Employee employee)
{
await MainView.Current.ReplaceAsync(new LoginView() // поменять
{
DataContext = new LoginViewModel()
});
}
}
}
}
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace zooManagerPro.ViewModels
{
internal class MainWindowViewModel
{
}
}
@@ -0,0 +1,8 @@
using CommunityToolkit.Mvvm.ComponentModel;
namespace zooManagerPro.ViewModels
{
public abstract class ViewModelBase : ObservableObject
{
}
}