Demka_kur/OknaFunciy/AddSotrudnikWindow.axaml.cs
2025-03-05 12:12:58 +03:00

39 lines
947 B
C#

using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Demka_Snova_1.Hardik.Conect.Dao;
namespace Demka_Snova_1.OknaFunciy;
public partial class AddSotrudnikWindow : Window
{
public SotrudnikDao NewSotrudnik { get; set; }
public AddSotrudnikWindow()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
private void SaveSotrudnik(object sender, RoutedEventArgs e)
{
NewSotrudnik = new SotrudnikDao
{
Fio = this.FindControl<TextBox>("FIO").Text,
Pozition = this.FindControl<TextBox>("Pozition").Text,
Login = this.FindControl<TextBox>("Login").Text,
Pass = this.FindControl<TextBox>("Pass").Text,
TipeEnt = "User"
};
Close();
}
private void Cancel(object sender, RoutedEventArgs e)
{
Close();
}
}