|
@@ -66,6 +66,14 @@ namespace AvaloniaApplication5.ViewModels
|
|
|
PageUCabinetVM = id == 0 ? new PageUserCabinetViewModel(DBConnect) : new PageUserCabinetViewModel(DBConnect, id);
|
|
|
UCAdmin = new PageUserCabinet();
|
|
|
}
|
|
|
+
|
|
|
+ public void DeleteUser(int id)
|
|
|
+ {
|
|
|
+ Logintable? delUser = DBConnect.Logintables.FirstOrDefault(x => x.Id == id);
|
|
|
+ DBConnect.Logintables.Remove(delUser);
|
|
|
+ DBConnect.SaveChanges();
|
|
|
+ UC = new PageUserList();//для обновления списка на странице
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
|