diff --git a/LawFim/LawFirmGuarantorApp/APIClient.cs b/LawFim/LawFirmGuarantorApp/APIClient.cs new file mode 100644 index 0000000..37e6daf --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/APIClient.cs @@ -0,0 +1,45 @@ +using LawFirmContracts.ViewModels; +using Newtonsoft.Json; +using System.Net.Http.Headers; +using System.Text; + +namespace LawFirmGuarantorApp +{ + public class APIClient + { + private static readonly HttpClient _lawyer = new(); + public static GuarantorViewModel? Guarantor { get; set; } = null; + public static void Connect(IConfiguration configuration) + { + _lawyer.BaseAddress = new Uri(configuration["IPAddress"]); + _lawyer.DefaultRequestHeaders.Accept.Clear(); + _lawyer.DefaultRequestHeaders.Accept.Add(new + MediaTypeWithQualityHeaderValue("application/json")); + } + public static T? GetRequest(string requestUrl) + { + var response = _lawyer.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 = _lawyer.PostAsync(requestUrl, data); + var result = response.Result.Content.ReadAsStringAsync().Result; + if (!response.Result.IsSuccessStatusCode) + { + throw new Exception(result); + } + } + } +} diff --git a/LawFim/LawFirmGuarantorApp/Controllers/ConsultationController.cs b/LawFim/LawFirmGuarantorApp/Controllers/ConsultationController.cs new file mode 100644 index 0000000..c0186f8 --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Controllers/ConsultationController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; + +namespace LawFirmGuarantorApp.Controllers +{ + public class ConsultationController : Controller + { + public IActionResult Index() + { + return View(); + } + } +} diff --git a/LawFim/LawFirmGuarantorApp/Controllers/HearingController.cs b/LawFim/LawFirmGuarantorApp/Controllers/HearingController.cs new file mode 100644 index 0000000..eb9cbcf --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Controllers/HearingController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; + +namespace LawFirmGuarantorApp.Controllers +{ + public class HearingController : Controller + { + public IActionResult Index() + { + return View(); + } + } +} diff --git a/LawFim/LawFirmGuarantorApp/Controllers/LawyerController.cs b/LawFim/LawFirmGuarantorApp/Controllers/LawyerController.cs new file mode 100644 index 0000000..f153aab --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Controllers/LawyerController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; + +namespace LawFirmGuarantorApp.Controllers +{ + public class LawyerController : Controller + { + public IActionResult Index() + { + return View(); + } + } +} diff --git a/LawFim/LawFirmGuarantorApp/LawFirmGuarantorApp.csproj b/LawFim/LawFirmGuarantorApp/LawFirmGuarantorApp.csproj index b708084..5dd4a85 100644 --- a/LawFim/LawFirmGuarantorApp/LawFirmGuarantorApp.csproj +++ b/LawFim/LawFirmGuarantorApp/LawFirmGuarantorApp.csproj @@ -6,6 +6,10 @@ enable + + + + diff --git a/LawFim/LawFirmGuarantorApp/Program.cs b/LawFim/LawFirmGuarantorApp/Program.cs index d1632a1..af8f7ee 100644 --- a/LawFim/LawFirmGuarantorApp/Program.cs +++ b/LawFim/LawFirmGuarantorApp/Program.cs @@ -1,4 +1,11 @@ +using LawFirmContracts.StoragesContracts; +using LawFirmDatabaseImplement.Implements; +using LawFirmGuarantorApp; + var builder = WebApplication.CreateBuilder(args); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); // Add services to the container. builder.Services.AddControllersWithViews(); diff --git a/LawFim/LawFirmGuarantorApp/Views/Consultation/AddLawyer.cshtml b/LawFim/LawFirmGuarantorApp/Views/Consultation/AddLawyer.cshtml new file mode 100644 index 0000000..7adcc31 --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Consultation/AddLawyer.cshtml @@ -0,0 +1,31 @@ +@{ + ViewData["Title"] = "Добавить юристов"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} + +
+

Добавить юристов

+
+
+ +
+
Юрист
+
+ +
+
+
+
Консультация
+
+ +
+
+
+
+
+ +
+
+
diff --git a/LawFim/LawFirmGuarantorApp/Views/Consultation/ConsultationLawyers.cshtml b/LawFim/LawFirmGuarantorApp/Views/Consultation/ConsultationLawyers.cshtml new file mode 100644 index 0000000..11d7499 --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Consultation/ConsultationLawyers.cshtml @@ -0,0 +1,61 @@ +@using LawFirmContracts.ViewModels; + +@model List +@{ + ViewData["Title"] = "Юристы"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} +
+

Юристы

+
+
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + } + +
+ Номер юриста + + ФИО + + Телефон + + Email +
+ @Html.DisplayFor(modelItem => + item.Id) + + @Html.DisplayFor(modelItem => + item.FIO) + + @Html.DisplayFor(modelItem => + item.Phone) + + @Html.DisplayFor(modelItem => + item.Email) +
+ } +
diff --git a/LawFim/LawFirmGuarantorApp/Views/Consultation/CreateConsultation.cshtml b/LawFim/LawFirmGuarantorApp/Views/Consultation/CreateConsultation.cshtml new file mode 100644 index 0000000..33d3e56 --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Consultation/CreateConsultation.cshtml @@ -0,0 +1,34 @@ +@{ + ViewData["Title"] = "Создание консультацию"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} + +
+

Создание консультации

+
+
+
+
Стоимость консультации
+
+ +
+
+
+
Дата и время
+
+ +
+
+
+
Дело
+
+ +
+
+
+
+
+ +
+
+
diff --git a/LawFim/LawFirmGuarantorApp/Views/Consultation/UpdateConsultation.cshtml b/LawFim/LawFirmGuarantorApp/Views/Consultation/UpdateConsultation.cshtml new file mode 100644 index 0000000..1c8a333 --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Consultation/UpdateConsultation.cshtml @@ -0,0 +1,34 @@ +@{ + ViewData["Title"] = "Обновление консультации"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} + +
+

Обновление консультации

+
+
+
+
Стоимость
+
+ +
+
+
+
Дата
+
+ +
+
+
+
Дело
+
+ +
+
+
+
+
+ +
+
+
diff --git a/LawFim/LawFirmGuarantorApp/Views/Hearing/AddLawyer.cshtml b/LawFim/LawFirmGuarantorApp/Views/Hearing/AddLawyer.cshtml new file mode 100644 index 0000000..75c9453 --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Hearing/AddLawyer.cshtml @@ -0,0 +1,30 @@ +@{ + ViewData["Title"] = "Добавить юристов"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} + +
+

Добавить юристов

+
+
+ +
+
Слушание
+
+ +
+
+
+
Юрист
+
+ +
+
+
+
+
+ +
+
+
diff --git a/LawFim/LawFirmGuarantorApp/Views/Hearing/CreateHearing.cshtml b/LawFim/LawFirmGuarantorApp/Views/Hearing/CreateHearing.cshtml new file mode 100644 index 0000000..d8b978c --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Hearing/CreateHearing.cshtml @@ -0,0 +1,28 @@ +@{ + ViewData["Title"] = "Назначение слушания"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} + +
+

Назначение слушания

+
+
+
+
Дата слушания
+
+ +
+
+
+
Суд
+
+ +
+
+
+
+
+ +
+
+
\ No newline at end of file diff --git a/LawFim/LawFirmGuarantorApp/Views/Hearing/HearingLawyers.cshtml b/LawFim/LawFirmGuarantorApp/Views/Hearing/HearingLawyers.cshtml new file mode 100644 index 0000000..2c24e2c --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Hearing/HearingLawyers.cshtml @@ -0,0 +1,60 @@ +@using LawFirmContracts.ViewModels; + +@model List +@{ + ViewData["Title"] = "Юристы"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} +
+

Юристы

+
+
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + } + +
+ Номер юриста + + ФИО + + Телефон + + Email +
+ @Html.DisplayFor(modelItem => + item.Id) + + @Html.DisplayFor(modelItem => + item.FIO) + + @Html.DisplayFor(modelItem => + item.Phone) + + @Html.DisplayFor(modelItem => + item.Email) +
+ } +
\ No newline at end of file diff --git a/LawFim/LawFirmGuarantorApp/Views/Hearing/UpdateHearing.cshtml b/LawFim/LawFirmGuarantorApp/Views/Hearing/UpdateHearing.cshtml new file mode 100644 index 0000000..3d8b9f0 --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Hearing/UpdateHearing.cshtml @@ -0,0 +1,28 @@ +@{ + ViewData["Title"] = "UpdateHearing"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} + +
+

Обновление слушания

+
+
+
+
Дата слушания
+
+ +
+
+
+
Суд
+
+ +
+
+
+
+
+ +
+
+
diff --git a/LawFim/LawFirmGuarantorApp/Views/Lawyer/CreateLawyer.cshtml b/LawFim/LawFirmGuarantorApp/Views/Lawyer/CreateLawyer.cshtml new file mode 100644 index 0000000..16c8aa4 --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Lawyer/CreateLawyer.cshtml @@ -0,0 +1,34 @@ +@{ + ViewData["Title"] = "Создание юриста"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} + +
+

Создание юриста

+
+
+
+
ФИО
+
+ +
+
+
+
Номер телефона
+
+ +
+
+
+
E-mail
+
+ +
+
+
+
+
+ +
+
+
diff --git a/LawFim/LawFirmGuarantorApp/Views/Lawyer/UpdateLawyer.cshtml b/LawFim/LawFirmGuarantorApp/Views/Lawyer/UpdateLawyer.cshtml new file mode 100644 index 0000000..f9a12a5 --- /dev/null +++ b/LawFim/LawFirmGuarantorApp/Views/Lawyer/UpdateLawyer.cshtml @@ -0,0 +1,34 @@ +@{ + ViewData["Title"] = "Обновить юриста"; + Layout = "~/Views/Shared/_LayoutGuarantor.cshtml"; +} + +
+

Изменение юриста

+
+
+
+
ФИО
+
+ +
+
+
+
Номер телефона
+
+ +
+
+
+
E-mail
+
+ +
+
+
+
+
+ +
+
+