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

31 lines
839 B
C#

using Avalonia.Controls;
using Avalonia.Interactivity;
using Demka_Snova_1.Hardik.Conect.Dao;
namespace Demka_Snova_1.OknaFunciy;
public partial class ChangeRoleWindow : Window
{
public SotrudnikDao UpdatedSotrudnik { get; private set; }
private SotrudnikDao _sotrudnik;
public ChangeRoleWindow(SotrudnikDao sotrudnik)
{
InitializeComponent();
_sotrudnik = sotrudnik;
this.FindControl<TextBox>("FiO").Text = sotrudnik.Fio;
this.FindControl<TextBox>("Position").Text = sotrudnik.TipeEnt;
}
private void SavePosition(object sender, RoutedEventArgs e)
{
_sotrudnik.TipeEnt = this.FindControl<TextBox>("Position").Text;
UpdatedSotrudnik = _sotrudnik;
Close();
}
private void Cancel(object sender, RoutedEventArgs e)
{
Close();
}
}