From 5274fa75b6a40f2a973c4c19909bba17fd0fbbe5 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Sun, 28 Apr 2024 12:55:26 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BC=D0=BE=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D0=B8=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D0=B5=D0=BB=D1=8F,=20=D0=BF=D0=BE=D0=BB=D0=B5=20?= =?UTF-8?q?=D1=80=D0=BE=D0=BB=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Polyclinic/PolyclinicDatabaseImplement/Models/Diagnose.cs | 1 + Polyclinic/PolyclinicDatabaseImplement/Models/User.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Polyclinic/PolyclinicDatabaseImplement/Models/Diagnose.cs b/Polyclinic/PolyclinicDatabaseImplement/Models/Diagnose.cs index 65841af..4b67e42 100644 --- a/Polyclinic/PolyclinicDatabaseImplement/Models/Diagnose.cs +++ b/Polyclinic/PolyclinicDatabaseImplement/Models/Diagnose.cs @@ -14,6 +14,7 @@ namespace PolyclinicDatabaseImplement.Models [Required] public int UserId { get; private set; } public int Id { get; private set; } + public static Diagnose? Create(DiagnoseBindingModel? model) { if (model == null) diff --git a/Polyclinic/PolyclinicDatabaseImplement/Models/User.cs b/Polyclinic/PolyclinicDatabaseImplement/Models/User.cs index 4b1aca3..67f88e5 100644 --- a/Polyclinic/PolyclinicDatabaseImplement/Models/User.cs +++ b/Polyclinic/PolyclinicDatabaseImplement/Models/User.cs @@ -17,6 +17,7 @@ namespace PolyclinicDatabaseImplement.Models [Required] public UserRole Role { get; private set; } = UserRole.Неизвестный; public int Id { get; private set; } + public static User? Create(UserBindingModel? model) { if (model == null) @@ -28,6 +29,7 @@ namespace PolyclinicDatabaseImplement.Models FIO = model.FIO, Email = model.Email, Password = model.Password, + Role = model.Role, Id = model.Id }; } @@ -41,6 +43,7 @@ namespace PolyclinicDatabaseImplement.Models FIO = model.FIO; Email = model.Email; Password = model.Password; + Role = model.Role; FIO = model.FIO; } @@ -49,6 +52,7 @@ namespace PolyclinicDatabaseImplement.Models FIO = FIO, Email = Email, Password = Password, + Role = Role, Id = Id }; }