From 6d861608da127060588e355b5d2872261ef59ba8 Mon Sep 17 00:00:00 2001 From: Allllen4a Date: Wed, 1 May 2024 18:15:54 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B2=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B5=20=D0=B8=20=D0=B2=D0=B5=D0=B1=20=D0=BA=D0=BB=D0=B8=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeautySalonView/BeautySalonView.sln | 24 +-- BeautySalonView/ClientWebApp/APIClient.cs | 68 --------- .../ClientWebApp/ClientWebApp.csproj | 24 --- .../Controllers/EvaluationController.cs | 77 ---------- .../Controllers/HomeController.cs | 143 +----------------- .../Controllers/OrderController.cs | 96 ------------ .../Controllers/ProcedureController.cs | 96 ------------ .../ClientWebApp/Models/ErrorViewModel.cs | 4 +- BeautySalonView/ClientWebApp/Program.cs | 3 - .../Properties/launchSettings.json | 8 +- .../Views/Evaluation/CreateEvaluation.cshtml | 25 --- .../Views/Evaluation/UpdateEvaluation.cshtml | 36 ----- .../ClientWebApp/Views/Home/Enter.cshtml | 19 --- .../ClientWebApp/Views/Home/Evaluation.cshtml | 53 ------- .../Views/Home/FormationOrder.cshtml | 44 ------ .../ClientWebApp/Views/Home/Index.cshtml | 8 +- .../ClientWebApp/Views/Home/Order.cshtml | 53 ------- .../ClientWebApp/Views/Home/Privacy.cshtml | 6 + .../ClientWebApp/Views/Home/Procedure.cshtml | 51 ------- .../ClientWebApp/Views/Home/Rating.cshtml | 53 ------- .../ClientWebApp/Views/Home/Register.cshtml | 25 --- .../ClientWebApp/Views/Home/Report.cshtml | 45 ------ .../Views/Home/ServiceList.cshtml | 52 ------- .../ClientWebApp/Views/Order/Create.cshtml | 75 --------- .../Views/Order/CreateOrder.cshtml | 73 --------- .../ClientWebApp/Views/Order/Update.cshtml | 77 ---------- .../Views/Order/UpdateOrder.cshtml | 76 ---------- .../Views/Procedure/Create.cshtml | 49 ------ .../Views/Procedure/CreateProcedure.cshtml | 48 ------ .../Views/Procedure/Update.cshtml | 51 ------- .../Views/Procedure/UpdateProcedure.cshtml | 51 ------- .../ClientWebApp/Views/Rating/Create.cshtml | 25 --- .../ClientWebApp/Views/Rating/Update.cshtml | 38 ----- .../ClientWebApp/Views/Shared/_Layout.cshtml | 33 +--- .../ClientWebApp/Views/_ViewImports.cshtml | 4 +- BeautySalonView/ClientWebApp/appsettings.json | 3 +- .../StaffMemberWebApp/APIClient.cs | 67 -------- .../Controllers/CosmeticController.cs | 102 ------------- .../Controllers/HomeController.cs | 135 +---------------- .../Controllers/LaborCostController.cs | 72 --------- .../Controllers/ServiceController.cs | 108 ------------- .../Models/ErrorViewModel.cs | 4 +- .../Properties/launchSettings.json | 8 +- .../StaffMemberWebApp.csproj | 13 +- .../Views/Cosmetic/Create.cshtml | 26 ---- .../Views/Cosmetic/Update.cshtml | 36 ----- .../Views/Home/Cosmetic.cshtml | 53 ------- .../StaffMemberWebApp/Views/Home/Enter.cshtml | 19 --- .../StaffMemberWebApp/Views/Home/Index.cshtml | 8 +- .../Views/Home/LaborCosts.cshtml | 51 ------- .../Views/Home/Privacy.cshtml | 6 + .../Views/Home/Register.cshtml | 25 --- .../Views/Home/Service.cshtml | 53 ------- .../Views/LaborCosts/Create.cshtml | 15 -- .../Views/LaborCosts/Update.cshtml | 16 -- .../Views/Service/Create.cshtml | 15 -- .../Views/Service/Update.cshtml | 18 --- .../Views/Shared/_Layout.cshtml | 33 +--- .../Views/_ViewImports.cshtml | 4 +- .../StaffMemberWebApp/appsettings.json | 3 +- 60 files changed, 72 insertions(+), 2434 deletions(-) delete mode 100644 BeautySalonView/ClientWebApp/APIClient.cs delete mode 100644 BeautySalonView/ClientWebApp/Controllers/EvaluationController.cs delete mode 100644 BeautySalonView/ClientWebApp/Controllers/OrderController.cs delete mode 100644 BeautySalonView/ClientWebApp/Controllers/ProcedureController.cs delete mode 100644 BeautySalonView/ClientWebApp/Views/Evaluation/CreateEvaluation.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Evaluation/UpdateEvaluation.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Home/Enter.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Home/Evaluation.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Home/FormationOrder.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Home/Order.cshtml create mode 100644 BeautySalonView/ClientWebApp/Views/Home/Privacy.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Home/Procedure.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Home/Rating.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Home/Register.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Home/Report.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Home/ServiceList.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Order/Create.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Order/CreateOrder.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Order/Update.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Order/UpdateOrder.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Procedure/Create.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Procedure/CreateProcedure.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Procedure/Update.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Procedure/UpdateProcedure.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Rating/Create.cshtml delete mode 100644 BeautySalonView/ClientWebApp/Views/Rating/Update.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/APIClient.cs delete mode 100644 BeautySalonView/StaffMemberWebApp/Controllers/CosmeticController.cs delete mode 100644 BeautySalonView/StaffMemberWebApp/Controllers/LaborCostController.cs delete mode 100644 BeautySalonView/StaffMemberWebApp/Controllers/ServiceController.cs delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/Cosmetic/Create.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/Cosmetic/Update.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/Home/Cosmetic.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/Home/Enter.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/Home/LaborCosts.cshtml create mode 100644 BeautySalonView/StaffMemberWebApp/Views/Home/Privacy.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/Home/Register.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/Home/Service.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/LaborCosts/Create.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/LaborCosts/Update.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/Service/Create.cshtml delete mode 100644 BeautySalonView/StaffMemberWebApp/Views/Service/Update.cshtml diff --git a/BeautySalonView/BeautySalonView.sln b/BeautySalonView/BeautySalonView.sln index dc73d8b..73d1008 100644 --- a/BeautySalonView/BeautySalonView.sln +++ b/BeautySalonView/BeautySalonView.sln @@ -11,12 +11,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeautySalonDatabaseImplemen EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeautySalonBusinessLogic", "BeautySalonBusinessLogic\BeautySalonBusinessLogic.csproj", "{36052005-AE3A-4700-B1CF-C95609D045C5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaffMemberWebApp", "StaffMemberWebApp\StaffMemberWebApp.csproj", "{B03C4006-5F6E-4719-BCEB-80EEB651D9E9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientWebApp", "ClientWebApp\ClientWebApp.csproj", "{7ECD5BB5-6AEC-42A1-B035-AEA1259663A8}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BeautySalonRestApi", "BeatySalonRestApi\BeautySalonRestApi.csproj", "{CF01D7E3-0253-4140-A472-C2CCD0C317B9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaffMemberWebApp", "StaffMemberWebApp\StaffMemberWebApp.csproj", "{2DBE4FBF-BA61-4CCD-8AE7-DFA74AB2FA32}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientWebApp", "ClientWebApp\ClientWebApp.csproj", "{B561ED93-1C27-43C5-A243-F120248683C0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,18 +39,18 @@ Global {36052005-AE3A-4700-B1CF-C95609D045C5}.Debug|Any CPU.Build.0 = Debug|Any CPU {36052005-AE3A-4700-B1CF-C95609D045C5}.Release|Any CPU.ActiveCfg = Release|Any CPU {36052005-AE3A-4700-B1CF-C95609D045C5}.Release|Any CPU.Build.0 = Release|Any CPU - {B03C4006-5F6E-4719-BCEB-80EEB651D9E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B03C4006-5F6E-4719-BCEB-80EEB651D9E9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B03C4006-5F6E-4719-BCEB-80EEB651D9E9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B03C4006-5F6E-4719-BCEB-80EEB651D9E9}.Release|Any CPU.Build.0 = Release|Any CPU - {7ECD5BB5-6AEC-42A1-B035-AEA1259663A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7ECD5BB5-6AEC-42A1-B035-AEA1259663A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7ECD5BB5-6AEC-42A1-B035-AEA1259663A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7ECD5BB5-6AEC-42A1-B035-AEA1259663A8}.Release|Any CPU.Build.0 = Release|Any CPU {CF01D7E3-0253-4140-A472-C2CCD0C317B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CF01D7E3-0253-4140-A472-C2CCD0C317B9}.Debug|Any CPU.Build.0 = Debug|Any CPU {CF01D7E3-0253-4140-A472-C2CCD0C317B9}.Release|Any CPU.ActiveCfg = Release|Any CPU {CF01D7E3-0253-4140-A472-C2CCD0C317B9}.Release|Any CPU.Build.0 = Release|Any CPU + {2DBE4FBF-BA61-4CCD-8AE7-DFA74AB2FA32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2DBE4FBF-BA61-4CCD-8AE7-DFA74AB2FA32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2DBE4FBF-BA61-4CCD-8AE7-DFA74AB2FA32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2DBE4FBF-BA61-4CCD-8AE7-DFA74AB2FA32}.Release|Any CPU.Build.0 = Release|Any CPU + {B561ED93-1C27-43C5-A243-F120248683C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B561ED93-1C27-43C5-A243-F120248683C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B561ED93-1C27-43C5-A243-F120248683C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B561ED93-1C27-43C5-A243-F120248683C0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BeautySalonView/ClientWebApp/APIClient.cs b/BeautySalonView/ClientWebApp/APIClient.cs deleted file mode 100644 index f46ca64..0000000 --- a/BeautySalonView/ClientWebApp/APIClient.cs +++ /dev/null @@ -1,68 +0,0 @@ -using BeautySalonContracts.ViewModels; -using Newtonsoft.Json; -using System.Net.Http.Headers; -using System.Text; - -namespace BeutySalonClientApp -{ - public class APIClient - { - private static readonly HttpClient _client = new(); - - public static ClientViewModel? Client { 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; - Console.WriteLine(requestUrl); - 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); - } - } - - public static O? PostRequestWithResult(string requestUrl, I 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) - { - return JsonConvert.DeserializeObject(result); - } - else - { - return default; - } - } - } -} diff --git a/BeautySalonView/ClientWebApp/ClientWebApp.csproj b/BeautySalonView/ClientWebApp/ClientWebApp.csproj index 9c2724c..c78c9c7 100644 --- a/BeautySalonView/ClientWebApp/ClientWebApp.csproj +++ b/BeautySalonView/ClientWebApp/ClientWebApp.csproj @@ -6,28 +6,4 @@ enable - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BeautySalonView/ClientWebApp/Controllers/EvaluationController.cs b/BeautySalonView/ClientWebApp/Controllers/EvaluationController.cs deleted file mode 100644 index f89eb1a..0000000 --- a/BeautySalonView/ClientWebApp/Controllers/EvaluationController.cs +++ /dev/null @@ -1,77 +0,0 @@ -using BeautySalonContracts.BindingModels; -using BeautySalonContracts.ViewModels; -using Microsoft.AspNetCore.Mvc; - -namespace BeutySalonClientApp.Controllers -{ - public class EvaluationController : Controller - { - public IActionResult Create() - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - ViewBag.Procedure = APIClient.GetRequest>($"api/procedure/getall?userId={APIClient.Client.Id}"); - return View(); - } - - [HttpPost] - public void Create(string pointsProcedure, string pointsCosmetics, int procedureId) - { - if (APIClient.Client == null) - { - throw new Exception("403"); - } - APIClient.PostRequest("api/rating/create", new EvaluationBindingModel - { - ClientId = APIClient.Client.Id, - PointsProcedure = double.Parse(pointsProcedure.Replace(".", ",")), - PointsCosmetics = double.Parse(pointsCosmetics.Replace(".", ",")), - ProcedureId = procedureId - }); - Response.Redirect("/Home/Rating"); - } - - public IActionResult Update(int id) - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - ViewBag.Evaluation = APIClient.GetRequest - ($"api/rating/get?id={id}"); - ViewBag.Procedure = APIClient.GetRequest>($"api/procedure/getall?userId={APIClient.Client.Id}"); - return View(); - } - - [HttpPost] - public void Update(int id, string pointsProcedure, string pointsCosmetics, int procedureId) - { - if (APIClient.Client == null) - { - throw new Exception("403"); - } - APIClient.PostRequest("api/rating/update", new EvaluationBindingModel - { - Id = id, - PointsProcedure = double.Parse(pointsProcedure.Replace(".", ",")), - PointsCosmetics = double.Parse(pointsCosmetics.Replace(".", ",")), - ProcedureId = procedureId - }); - Response.Redirect("/Home/Evaluation"); - } - - [HttpPost] - public void Delete(int id) - { - if (APIClient.Client == null) - { - return; - } - APIClient.PostRequest($"api/evaluation/delete", - new ServiceBindingModel() { Id = id }); - return; - } - } -} diff --git a/BeautySalonView/ClientWebApp/Controllers/HomeController.cs b/BeautySalonView/ClientWebApp/Controllers/HomeController.cs index 5102ccf..e432d0d 100644 --- a/BeautySalonView/ClientWebApp/Controllers/HomeController.cs +++ b/BeautySalonView/ClientWebApp/Controllers/HomeController.cs @@ -1,11 +1,8 @@ -using BeautySalonContracts.BindingModels; -using BeautySalonContracts.ViewModels; -using BeutySalonClientApp.Models; -using BeutySalonClientApp; +using ClientWebApp.Models; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; -namespace BeutySalonClientApp.Controllers +namespace ClientWebApp.Controllers { public class HomeController : Controller { @@ -16,143 +13,12 @@ namespace BeutySalonClientApp.Controllers _logger = logger; } - public IActionResult Enter() - { - return View(); - } - - [HttpPost] - public void Enter(string login, string password) - { - if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password)) - { - throw new Exception("Введите логин и пароль"); - } - APIClient.Client = APIClient.GetRequest($"api/client/login?login={login}&password={password}"); - if (APIClient.Client == null) - { - throw new Exception("Неверный логин/пароль"); - } - Response.Redirect("Index"); - } - public IActionResult Procedure(int page) - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - if (page == 0) - { - page = 1; - } - ViewBag.Procedure = APIClient.GetRequest> - ($"api/procedure/getmany?userId={APIClient.Client.Id}&page={page}"); - ViewBag.Page = page; - ViewBag.NumberOfPages = APIClient.GetRequest - ($"api/procedure/getnumberofpages?userId={APIClient.Client.Id}"); - return View(); - } - public IActionResult Register() - { - return View(); - } - - [HttpPost] - public void Register(string login, string fio, string phone, string password, string email) - { - if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(fio) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email)) - { - throw new Exception("Введите логин, пароль и ФИО"); - } - APIClient.PostRequest("api/client/register", new ClientBindingModel - { - ClientLogin = login, - ClientFIO = fio, - ClientPhone = phone, - ClientEmail = email, - ClientPassword = password - }); - Response.Redirect("Enter"); - return; - } - - public IActionResult Order(int page) - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - if (page == 0) - { - page = 1; - } - ViewBag.Order = APIClient.GetRequest> - ($"api/order/getmany?userId={APIClient.Client.Id}&page={page}"); - ViewBag.Page = page; - ViewBag.NumberOfPages = APIClient.GetRequest - ($"api/order/getnumberofpages?userId={APIClient.Client.Id}"); - return View(); - } - - public IActionResult Evaluation(int page) - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - if (page == 0) - { - page = 1; - } - ViewBag.Rating = APIClient.GetRequest> - ($"api/rating/getmany?userId={APIClient.Client.Id}&page={page}"); - ViewBag.Page = page; - ViewBag.NumberOfPages = APIClient.GetRequest - ($"api/rating/getnumberofpages?userId={APIClient.Client.Id}"); - return View(); - } - public IActionResult Index() { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } return View(); } - public IActionResult FormationOrder() - { - return View(); - } - - public IActionResult FormingAnRating() - { - return View(); - } - - public IActionResult LinkingProceduresForSelectedOrders() - { - return View(); - } - - public IActionResult ServiceList() - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - ViewBag.IsAllowed = true; - return View(); - } - - - public IActionResult OrderFormationAccordingProcedures() - { - return View(); - } - - public IActionResult Report() + public IActionResult Privacy() { return View(); } @@ -162,6 +28,5 @@ namespace BeutySalonClientApp.Controllers { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } - } -} \ No newline at end of file +} diff --git a/BeautySalonView/ClientWebApp/Controllers/OrderController.cs b/BeautySalonView/ClientWebApp/Controllers/OrderController.cs deleted file mode 100644 index e2a0023..0000000 --- a/BeautySalonView/ClientWebApp/Controllers/OrderController.cs +++ /dev/null @@ -1,96 +0,0 @@ -using BeautySalonContracts.BindingModels; -using BeautySalonContracts.ViewModels; -using BeutySalonClientApp; -using Microsoft.AspNetCore.Mvc; - -namespace BeutySalonClientApp.Controllers -{ - public class OrderController : Controller - { - public IActionResult Create() - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - return View(); - } - - [HttpPost] - public void Create([FromBody] OrderBindingModel orderModel) - { - if (APIClient.Client == null) - { - throw new Exception("403"); - } - orderModel.ClientId = APIClient.Client.Id; - APIClient.PostRequest("api/order/create", orderModel); - } - - public IActionResult Update(int id) - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - ViewBag.Id = id; - return View(); - } - - [HttpPost] - public void Update([FromBody] OrderBindingModel orderModel) - { - if (APIClient.Client == null) - { - throw new Exception("403"); - } - orderModel.ClientId = APIClient.Client.Id; - APIClient.PostRequest("api/order/update", orderModel); - } - - [HttpPost] - public void Delete(int id) - { - if (APIClient.Client == null) - { - return; - } - APIClient.PostRequest($"api/order/delete", - new OrderBindingModel() { Id = id }); - return; - } - - [HttpGet] - public List? GetAllServices() - { - if (APIClient.Client == null) - { - throw new Exception("403"); - } - var services = APIClient.GetRequest>($"api/service/getall"); - return services; - } - - public OrderViewModel? Get(int id) - { - if (APIClient.Client == null) - { - return new(); - } - OrderViewModel? order = APIClient - .GetRequest($"api/order/get?id={id}"); - return order; - } - - public List? GetAllByUser() - { - if (APIClient.Client == null) - { - return new(); - } - List? order = APIClient - .GetRequest>($"api/order/GetAllByUser?userId={APIClient.Client.Id}"); - return order; - } - } -} diff --git a/BeautySalonView/ClientWebApp/Controllers/ProcedureController.cs b/BeautySalonView/ClientWebApp/Controllers/ProcedureController.cs deleted file mode 100644 index b5075a5..0000000 --- a/BeautySalonView/ClientWebApp/Controllers/ProcedureController.cs +++ /dev/null @@ -1,96 +0,0 @@ -using BeautySalonContracts.BindingModels; -using BeautySalonContracts.ViewModels; -using BeutySalonClientApp; -using Microsoft.AspNetCore.Mvc; - -namespace BeutySalonClientApp.Controllers -{ - public class ProcedureController : Controller - { - public IActionResult Create() - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - return View(); - } - - [HttpPost] - public void Create([FromBody] ProcedureBindingModel procedureModel) - { - if (APIClient.Client == null) - { - throw new Exception("403"); - } - procedureModel.ClientId = APIClient.Client.Id; - APIClient.PostRequest("api/procedure/create", procedureModel); - } - - public IActionResult Update(int id) - { - if (APIClient.Client == null) - { - return Redirect("~/Home/Enter"); - } - ViewBag.Id = id; - return View(); - } - - [HttpPost] - public void Update([FromBody] ProcedureBindingModel procedureModel) - { - if (APIClient.Client == null) - { - throw new Exception("403"); - } - procedureModel.ClientId = APIClient.Client.Id; - APIClient.PostRequest("api/procedure/update", procedureModel); - } - - [HttpPost] - public void Delete(int id) - { - if (APIClient.Client == null) - { - return; - } - APIClient.PostRequest($"api/procedure/delete", - new ProcedureBindingModel() { Id = id }); - return; - } - - [HttpGet] - public List? GetAllCosmetics() - { - if (APIClient.Client == null) - { - throw new Exception("403"); - } - var cosmetics = APIClient.GetRequest>($"api/cosmetic/getall"); - return cosmetics; - } - - public ProcedureViewModel? Get(int id) - { - if (APIClient.Client == null) - { - return new(); - } - ProcedureViewModel? procedure = APIClient - .GetRequest($"api/procedure/get?id={id}"); - return procedure; - } - - public List? GetAllByUser() - { - if (APIClient.Client == null) - { - return new(); - } - List? procedures = APIClient.GetRequest> - ($"api/procedure/getallbyuser?userId={APIClient.Client.Id}"); - return procedures; - } - } -} diff --git a/BeautySalonView/ClientWebApp/Models/ErrorViewModel.cs b/BeautySalonView/ClientWebApp/Models/ErrorViewModel.cs index 5a48625..e17fd5c 100644 --- a/BeautySalonView/ClientWebApp/Models/ErrorViewModel.cs +++ b/BeautySalonView/ClientWebApp/Models/ErrorViewModel.cs @@ -1,4 +1,4 @@ -namespace BeutySalonClientApp.Models +namespace ClientWebApp.Models { public class ErrorViewModel { @@ -6,4 +6,4 @@ namespace BeutySalonClientApp.Models public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } -} \ No newline at end of file +} diff --git a/BeautySalonView/ClientWebApp/Program.cs b/BeautySalonView/ClientWebApp/Program.cs index 3818527..0727468 100644 --- a/BeautySalonView/ClientWebApp/Program.cs +++ b/BeautySalonView/ClientWebApp/Program.cs @@ -1,10 +1,7 @@ -using BeutySalonClientApp; - var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllersWithViews(); -APIClient.Connect(builder.Configuration); var app = builder.Build(); diff --git a/BeautySalonView/ClientWebApp/Properties/launchSettings.json b/BeautySalonView/ClientWebApp/Properties/launchSettings.json index 06bc67c..3d5b378 100644 --- a/BeautySalonView/ClientWebApp/Properties/launchSettings.json +++ b/BeautySalonView/ClientWebApp/Properties/launchSettings.json @@ -3,16 +3,16 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:50733", - "sslPort": 44356 + "applicationUrl": "http://localhost:35820", + "sslPort": 44325 } }, "profiles": { - "ClientApp": { + "ClientWebApp": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "applicationUrl": "https://localhost:7196;http://localhost:5081", + "applicationUrl": "https://localhost:7294;http://localhost:5223", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/BeautySalonView/ClientWebApp/Views/Evaluation/CreateEvaluation.cshtml b/BeautySalonView/ClientWebApp/Views/Evaluation/CreateEvaluation.cshtml deleted file mode 100644 index b764659..0000000 --- a/BeautySalonView/ClientWebApp/Views/Evaluation/CreateEvaluation.cshtml +++ /dev/null @@ -1,25 +0,0 @@ -@{ - ViewData["Title"] = "Оценка"; -} - -

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

- -
-

Баллы за процедуру:

- -

Баллы за косметику:

- -

Процедура:

- - -
- diff --git a/BeautySalonView/ClientWebApp/Views/Evaluation/UpdateEvaluation.cshtml b/BeautySalonView/ClientWebApp/Views/Evaluation/UpdateEvaluation.cshtml deleted file mode 100644 index 4b4a5cf..0000000 --- a/BeautySalonView/ClientWebApp/Views/Evaluation/UpdateEvaluation.cshtml +++ /dev/null @@ -1,36 +0,0 @@ -@{ - ViewData["Title"] = "Оценка"; -} - -

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

- -
- -

Баллы за процедуру:

- -

Баллы за косметику:

- -

Процедура:

- - -
diff --git a/BeautySalonView/ClientWebApp/Views/Home/Enter.cshtml b/BeautySalonView/ClientWebApp/Views/Home/Enter.cshtml deleted file mode 100644 index 57576f8..0000000 --- a/BeautySalonView/ClientWebApp/Views/Home/Enter.cshtml +++ /dev/null @@ -1,19 +0,0 @@ -@{ - ViewData["Title"] = "Вход"; -} - -

Вход в приложение

- -
-
- - -
-
- - -
- -
\ No newline at end of file diff --git a/BeautySalonView/ClientWebApp/Views/Home/Evaluation.cshtml b/BeautySalonView/ClientWebApp/Views/Home/Evaluation.cshtml deleted file mode 100644 index b664105..0000000 --- a/BeautySalonView/ClientWebApp/Views/Home/Evaluation.cshtml +++ /dev/null @@ -1,53 +0,0 @@ -@using BeautySalonContracts.ViewModels - -@{ - ViewData["Title"] = "Оценки"; -} - -

Оценки

- -
- -
-
- - / @ViewBag.NumberOfPages -
- - Перейти - -
-
-
- - - - - - - - - - @foreach (var item in ViewBag.Rating) - { - - - - - - } - -
Баллы за процедуруБаллы за косметикуПроцедура
@item.PointsProcedure@item.PointsCosmetics@item.ProcedureName
-
- - diff --git a/BeautySalonView/ClientWebApp/Views/Home/FormationOrder.cshtml b/BeautySalonView/ClientWebApp/Views/Home/FormationOrder.cshtml deleted file mode 100644 index ba03400..0000000 --- a/BeautySalonView/ClientWebApp/Views/Home/FormationOrder.cshtml +++ /dev/null @@ -1,44 +0,0 @@ - -@{ - ViewData["Title"] = "FormationDinner"; -} - -
-

Формирование заказов

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

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

- return; - } - -

- Создать заказ -

- - - - - - - - - - @foreach (var item in Model) - { - - } - -
- Номер - - Дата создания - - Цена -
- } -
\ No newline at end of file diff --git a/BeautySalonView/ClientWebApp/Views/Home/Index.cshtml b/BeautySalonView/ClientWebApp/Views/Home/Index.cshtml index 445ad23..d2d19bd 100644 --- a/BeautySalonView/ClientWebApp/Views/Home/Index.cshtml +++ b/BeautySalonView/ClientWebApp/Views/Home/Index.cshtml @@ -1,8 +1,8 @@ @{ - ViewData["Title"] = "HomePage"; + ViewData["Title"] = "Home Page"; } -

Мы Вас не ждали, зло пожаловать!

-

Logo

-
\ No newline at end of file +

Welcome

+

Learn about building Web apps with ASP.NET Core.

+ diff --git a/BeautySalonView/ClientWebApp/Views/Home/Order.cshtml b/BeautySalonView/ClientWebApp/Views/Home/Order.cshtml deleted file mode 100644 index b571e83..0000000 --- a/BeautySalonView/ClientWebApp/Views/Home/Order.cshtml +++ /dev/null @@ -1,53 +0,0 @@ -@using BeautySalonContracts.ViewModels - -@{ - ViewData["Title"] = "Заказы"; -} - -

Заказы

- -
- -
-
- - / @ViewBag.NumberOfPages -
- - Перейти - -
-
-
- - - - - - - - - - @foreach (var item in ViewBag.Order) - { - - - - - - } - -
Номер заказаДата заказаСумма заказа
@item.Id@item.OrderDate@item.OrderAmount
-
- - diff --git a/BeautySalonView/ClientWebApp/Views/Home/Privacy.cshtml b/BeautySalonView/ClientWebApp/Views/Home/Privacy.cshtml new file mode 100644 index 0000000..af4fb19 --- /dev/null +++ b/BeautySalonView/ClientWebApp/Views/Home/Privacy.cshtml @@ -0,0 +1,6 @@ +@{ + ViewData["Title"] = "Privacy Policy"; +} +

@ViewData["Title"]

+ +

Use this page to detail your site's privacy policy.

diff --git a/BeautySalonView/ClientWebApp/Views/Home/Procedure.cshtml b/BeautySalonView/ClientWebApp/Views/Home/Procedure.cshtml deleted file mode 100644 index 29d8192..0000000 --- a/BeautySalonView/ClientWebApp/Views/Home/Procedure.cshtml +++ /dev/null @@ -1,51 +0,0 @@ -@using BeautySalonContracts.ViewModels - -@{ - ViewData["Title"] = "Процедуры"; -} - -

Процедуры

- -
- -
-
- - / @ViewBag.NumberOfPages -
- - Перейти - -
-
-
- - - - - - - - - @foreach (var item in ViewBag.Procedure) - { - - - - - } - -
Наименование процедурыЦена процедуры
@item.ProcedureName@item.ProcedurePrice
-
- - diff --git a/BeautySalonView/ClientWebApp/Views/Home/Rating.cshtml b/BeautySalonView/ClientWebApp/Views/Home/Rating.cshtml deleted file mode 100644 index 0b46b9a..0000000 --- a/BeautySalonView/ClientWebApp/Views/Home/Rating.cshtml +++ /dev/null @@ -1,53 +0,0 @@ -@using BeautySalonContracts.ViewModels - -@{ - ViewData["Title"] = "Оценки"; -} - -

Оценки

- -
- -
-
- - / @ViewBag.NumberOfPages -
- - Перейти - -
-
-
- - - - - - - - - - @foreach (var item in ViewBag.Rating) - { - - - - - - } - -
Баллы за процедуруБаллы за косметикуПроцедура
@item.PointsProcedure@item.PointsCosmetics@item.ProcedureName
-
- - diff --git a/BeautySalonView/ClientWebApp/Views/Home/Register.cshtml b/BeautySalonView/ClientWebApp/Views/Home/Register.cshtml deleted file mode 100644 index 87f3b84..0000000 --- a/BeautySalonView/ClientWebApp/Views/Home/Register.cshtml +++ /dev/null @@ -1,25 +0,0 @@ -@{ - ViewData["Title"] = "Регистрация"; -} - -

Регистрация

- -
-
- - -
-
- - -
-
- - -
-
- -
-
diff --git a/BeautySalonView/ClientWebApp/Views/Home/Report.cshtml b/BeautySalonView/ClientWebApp/Views/Home/Report.cshtml deleted file mode 100644 index 8071daf..0000000 --- a/BeautySalonView/ClientWebApp/Views/Home/Report.cshtml +++ /dev/null @@ -1,45 +0,0 @@ -@{ - ViewData["Title"] = "Report"; -} - -

Отчет по услугам

- -
-
-

Дата начала:

- -
-
-

Дата конца:

- -
- - -
- -

- За период с  - ... -  по  - ... -

-
- - - - - - - - - - - -
Номер заказаДатаУслугиОценки
-
- - diff --git a/BeautySalonView/ClientWebApp/Views/Home/ServiceList.cshtml b/BeautySalonView/ClientWebApp/Views/Home/ServiceList.cshtml deleted file mode 100644 index 45ff04c..0000000 --- a/BeautySalonView/ClientWebApp/Views/Home/ServiceList.cshtml +++ /dev/null @@ -1,52 +0,0 @@ -@{ - ViewData["Title"] = "Список услуг по заказам"; -} - -

Список услуг по заказам

- -@{ - if (ViewBag.IsAllowed == false) - { -

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

- return; - } - -
- - -
- -

Выбранные заказы:

-
- - - - - - - - - - - - - - - -
ДатаСумма
Не выбрано
-
- -

Добавить заказ:

-
- - -
- - -} diff --git a/BeautySalonView/ClientWebApp/Views/Order/Create.cshtml b/BeautySalonView/ClientWebApp/Views/Order/Create.cshtml deleted file mode 100644 index 7cddaad..0000000 --- a/BeautySalonView/ClientWebApp/Views/Order/Create.cshtml +++ /dev/null @@ -1,75 +0,0 @@ -@{ - ViewData["Title"] = "Заказ"; -} - -

Создать заказ

- -

Выбранные услуги:

-
- - - - - - - - - - - - - - - - - -
НазваниеСтоимостьКоличество
Не выбрано
-
- -

Добавить услугу:

-

Наименование:

- -

Количество:

- - - -

Выбранные процедуры:

-
- - - - - - - - - - - - - - - - - -
НазваниеСтоимостьКоличество
Не выбрано
-
- -

Привязать процедуру:

-

Наименование:

- -

Количество:

- - - -

Стоимость заказа:

- - - - diff --git a/BeautySalonView/ClientWebApp/Views/Order/CreateOrder.cshtml b/BeautySalonView/ClientWebApp/Views/Order/CreateOrder.cshtml deleted file mode 100644 index e788396..0000000 --- a/BeautySalonView/ClientWebApp/Views/Order/CreateOrder.cshtml +++ /dev/null @@ -1,73 +0,0 @@ -@{ - ViewData["Title"] = "Заказ"; -} - -

Создать заказ

- -

Выбранные услуги:

-
- - - - - - - - - - - - - - - - - -
НазваниеСтоимостьКоличество
Не выбрано
-
- -

Добавить услугу:

-

Наименование:

- -

Количество:

- - - -

Выбранные процедуры:

-
- - - - - - - - - - - - - - - - - -
НазваниеСтоимостьКоличество
Не выбрано
-
- -

Привязать процедуру:

-

Наименование:

- -

Количество:

- - - -

Стоимость заказа:

- - \ No newline at end of file diff --git a/BeautySalonView/ClientWebApp/Views/Order/Update.cshtml b/BeautySalonView/ClientWebApp/Views/Order/Update.cshtml deleted file mode 100644 index e3e7755..0000000 --- a/BeautySalonView/ClientWebApp/Views/Order/Update.cshtml +++ /dev/null @@ -1,77 +0,0 @@ -@{ - ViewData["Title"] = "Заказ"; -} - -

Обновить заказ

- -

Выбранные услуги:

-
- - - - - - - - - - - - - - - - - -
НазваниеСтоимостьКоличество
Не выбрано
-
- -

Добавить услугу:

-

Наименование:

- -

Количество:

- - - -

Выбранные процедуры:

-
- - - - - - - - - - - - - - - - - -
НазваниеСтоимостьКоличество
Не выбрано
-
- -

Добавить процедуру:

-

Наименование:

- -

Количество:

- - - -

Стоимость заказа:

- - - - - - diff --git a/BeautySalonView/ClientWebApp/Views/Order/UpdateOrder.cshtml b/BeautySalonView/ClientWebApp/Views/Order/UpdateOrder.cshtml deleted file mode 100644 index 11c8a5e..0000000 --- a/BeautySalonView/ClientWebApp/Views/Order/UpdateOrder.cshtml +++ /dev/null @@ -1,76 +0,0 @@ -@{ - ViewData["Title"] = "Заказ"; -} - -

Обновить заказ

- -

Выбранные услуги:

-
- - - - - - - - - - - - - - - - - -
НазваниеСтоимостьКоличество
Не выбрано
-
- -

Добавить услугу:

-

Наименование:

- -

Количество:

- - - -

Выбранные процедуры:

-
- - - - - - - - - - - - - - - - - -
НазваниеСтоимостьКоличество
Не выбрано
-
- -

Добавить процедуру:

-

Наименование:

- -

Количество:

- - - -

Стоимость заказа:

- - - - - diff --git a/BeautySalonView/ClientWebApp/Views/Procedure/Create.cshtml b/BeautySalonView/ClientWebApp/Views/Procedure/Create.cshtml deleted file mode 100644 index 31f95a2..0000000 --- a/BeautySalonView/ClientWebApp/Views/Procedure/Create.cshtml +++ /dev/null @@ -1,49 +0,0 @@ -@{ - ViewData["Title"] = "Процедура"; -} - -

Создать процедуру

- -

Название процедуры:

- - -

Выбранная косметика:

-
- - - - - - - - - - - - - - - - - - - -
БрендНаименование косметикиСтоимостьКоличество
Не выбрано
-
- -

Добавить косметику:

-

Наименование:

- -

Количество:

- - - -

Стоимость процедуры:

- - - - diff --git a/BeautySalonView/ClientWebApp/Views/Procedure/CreateProcedure.cshtml b/BeautySalonView/ClientWebApp/Views/Procedure/CreateProcedure.cshtml deleted file mode 100644 index 5b06336..0000000 --- a/BeautySalonView/ClientWebApp/Views/Procedure/CreateProcedure.cshtml +++ /dev/null @@ -1,48 +0,0 @@ -@{ - ViewData["Title"] = "Процедура"; -} - -

Создать процедуру

- -

Название процедуры:

- - -

Выбранная косметика:

-
- - - - - - - - - - - - - - - - - - - -
БрендНаименование косметикиСтоимостьКоличество
Не выбрано
-
- -

Добавить косметику:

-

Наименование:

- -

Количество:

- - - -

Стоимость процедуры:

- - - diff --git a/BeautySalonView/ClientWebApp/Views/Procedure/Update.cshtml b/BeautySalonView/ClientWebApp/Views/Procedure/Update.cshtml deleted file mode 100644 index 9459926..0000000 --- a/BeautySalonView/ClientWebApp/Views/Procedure/Update.cshtml +++ /dev/null @@ -1,51 +0,0 @@ -@{ - ViewData["Title"] = "Процедура"; -} - -

Обновить процедуру

- -

Название процедуры:

- - -

Выбранная косметика:

-
- - - - - - - - - - - - - - - - - - - -
БрендНаименование косметикиСтоимостьКоличество
Не выбрано
-
- -

Добавить косметику:

-

Наименование:

- -

Количество:

- - - -

Стоимость процедуры:

- - - - - - diff --git a/BeautySalonView/ClientWebApp/Views/Procedure/UpdateProcedure.cshtml b/BeautySalonView/ClientWebApp/Views/Procedure/UpdateProcedure.cshtml deleted file mode 100644 index fc9b2f3..0000000 --- a/BeautySalonView/ClientWebApp/Views/Procedure/UpdateProcedure.cshtml +++ /dev/null @@ -1,51 +0,0 @@ -@{ - ViewData["Title"] = "Процедура"; -} - -

Обновить процедуру

- -

Название процедуры:

- - -

Выбранная косметика:

-
- - - - - - - - - - - - - - - - - - - -
БрендНаименование косметикиСтоимостьКоличество
Не выбрано
-
- -

Добавить косметику:

-

Наименование:

- -

Количество:

- - - -

Стоимость процедуры:

- - - - - - diff --git a/BeautySalonView/ClientWebApp/Views/Rating/Create.cshtml b/BeautySalonView/ClientWebApp/Views/Rating/Create.cshtml deleted file mode 100644 index fab79d7..0000000 --- a/BeautySalonView/ClientWebApp/Views/Rating/Create.cshtml +++ /dev/null @@ -1,25 +0,0 @@ -@{ - ViewData["Title"] = "Оценка"; -} - -

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

- -
-

Баллы за процедуру:

- -

Баллы за косметику:

- -

Процедура:

- - -
- diff --git a/BeautySalonView/ClientWebApp/Views/Rating/Update.cshtml b/BeautySalonView/ClientWebApp/Views/Rating/Update.cshtml deleted file mode 100644 index 955aac5..0000000 --- a/BeautySalonView/ClientWebApp/Views/Rating/Update.cshtml +++ /dev/null @@ -1,38 +0,0 @@ -@{ - ViewData["Title"] = "Оценка"; -} - -

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

- -
- -

Баллы за процедуру:

- -

Баллы за косметику:

- -

Процедура:

- - -
- - \ No newline at end of file diff --git a/BeautySalonView/ClientWebApp/Views/Shared/_Layout.cshtml b/BeautySalonView/ClientWebApp/Views/Shared/_Layout.cshtml index c28d453..a1a4eb5 100644 --- a/BeautySalonView/ClientWebApp/Views/Shared/_Layout.cshtml +++ b/BeautySalonView/ClientWebApp/Views/Shared/_Layout.cshtml @@ -3,22 +3,16 @@ - @ViewData["Title"] - BeutySalonClientApp + @ViewData["Title"] - ClientWebApp - +