From 7435264b3d92c8662f8244b973401f12d4002032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=91=D0=B0=D0=BA=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Thu, 30 May 2024 04:21:43 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=BA=D1=80=D0=B0=D0=B9=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BE=D1=81=D1=8F=D0=BA=D0=B8=20=D0=BD=D0=B0=20=D1=81?= =?UTF-8?q?=D0=B5=D0=B9=D1=87=D0=B0=D1=81=20=D0=BF=D0=BE=20=D0=BE=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...fProceduresByMedicamentsAndSymptomsInfo.cs | 8 ---- .../PolyclinicWebAppSuretor/APIClient.cs | 44 ------------------- 2 files changed, 52 deletions(-) delete mode 100644 Polyclinic/PolyclinicWebAppSuretor/APIClient.cs diff --git a/Polyclinic/PolyclinicBusinessLogic/OfficePackage/HelperModels/PDF/PdfProceduresByMedicamentsAndSymptomsInfo.cs b/Polyclinic/PolyclinicBusinessLogic/OfficePackage/HelperModels/PDF/PdfProceduresByMedicamentsAndSymptomsInfo.cs index 5b1129b..328cae7 100644 --- a/Polyclinic/PolyclinicBusinessLogic/OfficePackage/HelperModels/PDF/PdfProceduresByMedicamentsAndSymptomsInfo.cs +++ b/Polyclinic/PolyclinicBusinessLogic/OfficePackage/HelperModels/PDF/PdfProceduresByMedicamentsAndSymptomsInfo.cs @@ -9,13 +9,5 @@ namespace PolyclinicBusinessLogic.OfficePackage.HelperModels.PDF public DateTime DateFrom { get; set; } public DateTime DateTo { get; set; } public List Procedures { get; set; } = new(); - - //public List Procedures{ get; set; } = new(); - - //public List MedicamentSymptom { get; set; } = new(); - - /*public List<(string medicamentName, string symptomName)> MedicamentSymptom { get; set; } = new();*/ - /* public List Medicaments { get; set; } = new(); - public List Symptoms { get; set; } = new();*/ } } diff --git a/Polyclinic/PolyclinicWebAppSuretor/APIClient.cs b/Polyclinic/PolyclinicWebAppSuretor/APIClient.cs deleted file mode 100644 index 861457c..0000000 --- a/Polyclinic/PolyclinicWebAppSuretor/APIClient.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Newtonsoft.Json; -using PolyclinicContracts.ViewModels; -using System.Net.Http.Headers; -using System.Text; - -namespace PolyclinicWebAppSuretor -{ - public class APIClient - { - private static readonly HttpClient _client = new(); - public static UserViewModel? User { get; set; } = null; - - public static void Connect(IConfiguration configuration) - { - _client.BaseAddress = new Uri(configuration["IPAddress"]); - _client.DefaultRequestHeaders.Accept.Clear(); - _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - } - public static T? GetRequest(string requestUrl) - { - var response = _client.GetAsync(requestUrl); - var result = response.Result.Content.ReadAsStringAsync().Result; - if (response.Result.IsSuccessStatusCode) - { - return JsonConvert.DeserializeObject(result); - } - else - { - throw new Exception(result); - } - } - public static void PostRequest(string requestUrl, T model) - { - var json = JsonConvert.SerializeObject(model); - var data = new StringContent(json, Encoding.UTF8, "application/json"); - var response = _client.PostAsync(requestUrl, data); - var result = response.Result.Content.ReadAsStringAsync().Result; - if (!response.Result.IsSuccessStatusCode) - { - throw new Exception(result); - } - } - } -}