-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserManager.xaml.cs
39 lines (34 loc) · 1.04 KB
/
UserManager.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System.Windows;
using System.Windows.Controls;
using System.IO;
using System.Text.Json;
using System.Xml;
namespace InformationSecurity
{
/// <summary>
/// Логика взаимодействия для UserManager.xaml
/// </summary>
public partial class UserManager : Window
{
public UserManager()
{
InitializeComponent();
dgUsers.ItemsSource = Authentication.Users;
}
private void CreateUser_Click(object sender, RoutedEventArgs e)
{
var s = sender as Button;
if (s is null) return;
Registration rg = new Registration();
rg.ShowDialog();
}
private void btnSave_Click(object sender, RoutedEventArgs e)
{
File.WriteAllText(ProgramConstants.USERS_JSON, JsonSerializer.Serialize(Authentication.Users, new JsonSerializerOptions { WriteIndented = true} ));
}
private void btnReturn_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}