From ac043889c22c1059437a518f722776c0ed6e41b4 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Sat, 20 Apr 2024 14:25:29 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C=20?= =?UTF-8?q?=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B8=D1=81?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB=D1=8F=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/Implementer.cs | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 SecuritySystem/SecuritySystemListImplement/Models/Implementer.cs diff --git a/SecuritySystem/SecuritySystemListImplement/Models/Implementer.cs b/SecuritySystem/SecuritySystemListImplement/Models/Implementer.cs new file mode 100644 index 0000000..8dbccc7 --- /dev/null +++ b/SecuritySystem/SecuritySystemListImplement/Models/Implementer.cs @@ -0,0 +1,49 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.ViewModels; +using SecuritySystemDataModels.Models; + +namespace SecuritySystemListImplement.Models +{ + public class Implementer : IImplementerModel + { + public string ImplementerFIO { get; private set; } = string.Empty; + public string Password { get; private set; } = string.Empty; + public int WorkExperience { get; private set; } + public int Qualification { get; private set; } + public int Id { get; private set; } + public static Implementer? Create(ImplementerBindingModel? model) + { + if (model == null) + { + return null; + } + return new Implementer() + { + Id = model.Id, + Qualification = model.Qualification, + Password = model.Password, + ImplementerFIO = model.ImplementerFIO, + WorkExperience = model.WorkExperience + }; + } + public void Update(ImplementerBindingModel? model) + { + if (model == null) + { + return; + } + Qualification = model.Qualification; + Password = model.Password; + ImplementerFIO = model.ImplementerFIO; + WorkExperience = model.WorkExperience; + } + public ImplementerViewModel GetViewModel => new() + { + Id = Id, + Qualification = Qualification, + Password = Password, + ImplementerFIO = ImplementerFIO, + WorkExperience = WorkExperience + }; + } +}