From f03bb241c04baf32f726217390c52149968ea21f Mon Sep 17 00:00:00 2001 From: maxnes3 <112558334+maxnes3@users.noreply.github.com> Date: Fri, 19 May 2023 14:39:49 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=BC=D0=B5=D0=B6=D1=83?= =?UTF-8?q?=D1=82=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8=D1=82?= =?UTF-8?q?,=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B1=D0=B0=D0=B3=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Specializations.cs | 13 +++++++++- .../CaseAccountingDatabase.cs | 4 ++-- .../Models/Case.cs | 1 + .../Controllers/CaseController.cs | 10 ++++++++ .../Views/Case/Create.cshtml | 1 - .../Views/Case/Update.cshtml | 1 - .../Views/Hearing/Create.cshtml | 1 - .../Views/Hearing/Update.cshtml | 1 - .../wwwroot/js/case/case-create.js | 22 ++++++++--------- .../wwwroot/js/case/case-update.js | 22 ++++++++--------- .../wwwroot/js/hearing/hearing-create.js | 24 +++++++++---------- .../wwwroot/js/hearing/hearing-update.js | 22 ++++++++--------- .../Controllers/CaseController.cs | 20 ++++++++++++++-- .../Controllers/SpecializationController.cs | 13 ---------- 14 files changed, 88 insertions(+), 67 deletions(-) diff --git a/CaseAccounting/CaseAccountingCustomerView/Controllers/Specializations.cs b/CaseAccounting/CaseAccountingCustomerView/Controllers/Specializations.cs index 6872185..be0e49e 100644 --- a/CaseAccounting/CaseAccountingCustomerView/Controllers/Specializations.cs +++ b/CaseAccounting/CaseAccountingCustomerView/Controllers/Specializations.cs @@ -79,5 +79,16 @@ namespace CaseAccountingCustomerView.Controllers SpecializationViewModel? specialization = APIUser.GetRequest($"api/specialization/get?id={id}"); return specialization; } - } + + public List GetAll() + { + if (APIUser.User == null) + { + return new(); + } + List? specializations = APIUser.GetRequest>($"api/specialization/getall"); + return specializations ?? new(); + } + + } } diff --git a/CaseAccounting/CaseAccountingDataBaseImplement/CaseAccountingDatabase.cs b/CaseAccounting/CaseAccountingDataBaseImplement/CaseAccountingDatabase.cs index 55243a9..75477ba 100644 --- a/CaseAccounting/CaseAccountingDataBaseImplement/CaseAccountingDatabase.cs +++ b/CaseAccounting/CaseAccountingDataBaseImplement/CaseAccountingDatabase.cs @@ -18,8 +18,8 @@ namespace CaseAccountingDataBaseImplement Host=localhost; Port=5432; Database=CaseAccountingDatabase; - Username=postgres; - Password=postgres"); + Username=courseuser; + Password=courseuser"); } base.OnConfiguring(optionsBuilder); } diff --git a/CaseAccounting/CaseAccountingDataBaseImplement/Models/Case.cs b/CaseAccounting/CaseAccountingDataBaseImplement/Models/Case.cs index e5de4e5..de9098b 100644 --- a/CaseAccounting/CaseAccountingDataBaseImplement/Models/Case.cs +++ b/CaseAccounting/CaseAccountingDataBaseImplement/Models/Case.cs @@ -139,6 +139,7 @@ namespace CaseAccountingDataBaseImplement.Models Annotation = Annotation, Date = Date, SpecializationId = SpecializationId, + Specialization = Specialization.Name, UserId = UserId }; } diff --git a/CaseAccounting/CaseAccountingProviderView/Controllers/CaseController.cs b/CaseAccounting/CaseAccountingProviderView/Controllers/CaseController.cs index 8ef7313..b8a7fbb 100644 --- a/CaseAccounting/CaseAccountingProviderView/Controllers/CaseController.cs +++ b/CaseAccounting/CaseAccountingProviderView/Controllers/CaseController.cs @@ -119,5 +119,15 @@ namespace CaseAccountingProviderView.Controllers CaseViewModel? caseModel = APIUser.GetRequest($"api/case/get?id={id}"); return caseModel; } + + public List GetAllSpecializations() + { + if (APIUser.User == null) + { + return new(); + } + List? specializationModel = APIUser.GetRequest>($"api/case/getallspecializations"); + return specializationModel ?? new(); + } } } diff --git a/CaseAccounting/CaseAccountingProviderView/Views/Case/Create.cshtml b/CaseAccounting/CaseAccountingProviderView/Views/Case/Create.cshtml index ba66465..629984a 100644 --- a/CaseAccounting/CaseAccountingProviderView/Views/Case/Create.cshtml +++ b/CaseAccounting/CaseAccountingProviderView/Views/Case/Create.cshtml @@ -22,7 +22,6 @@

Специализация: