изменения в клиенте и веб клиенты
This commit is contained in:
parent
d95e6f8b9b
commit
6d861608da
@ -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
|
||||
|
@ -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<T>(string requestUrl)
|
||||
{
|
||||
var response = _client.GetAsync(requestUrl);
|
||||
var result = response.Result.Content.ReadAsStringAsync().Result;
|
||||
Console.WriteLine(requestUrl);
|
||||
if (response.Result.IsSuccessStatusCode)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(result);
|
||||
}
|
||||
}
|
||||
|
||||
public static void PostRequest<T>(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<I, O>(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<O>(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -6,28 +6,4 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Views\Home\Enter.cshtml" />
|
||||
<None Include="Views\Home\Evaluation.cshtml" />
|
||||
<None Include="Views\Home\Index.cshtml" />
|
||||
<None Include="Views\Home\Order.cshtml" />
|
||||
<None Include="Views\Home\Procedure.cshtml" />
|
||||
<None Include="Views\Home\Register.cshtml" />
|
||||
<None Include="Views\Order\CreateOrder.cshtml" />
|
||||
<None Include="Views\Order\UpdateOrder.cshtml" />
|
||||
<None Include="Views\Procedure\CreateProcedure.cshtml" />
|
||||
<None Include="Views\Procedure\UpdateProcedure.cshtml" />
|
||||
<None Include="Views\Shared\Error.cshtml" />
|
||||
<None Include="Views\Shared\_Layout.cshtml" />
|
||||
<None Include="Views\Shared\_ValidationScriptsPartial.cshtml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BeautySalonContracts\BeautySalonContracts.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -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<List<ProcedureViewModel>>($"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<EvaluationBindingModel>
|
||||
($"api/rating/get?id={id}");
|
||||
ViewBag.Procedure = APIClient.GetRequest<List<ProcedureViewModel>>($"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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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<ClientViewModel>($"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<List<ProcedureViewModel>>
|
||||
($"api/procedure/getmany?userId={APIClient.Client.Id}&page={page}");
|
||||
ViewBag.Page = page;
|
||||
ViewBag.NumberOfPages = APIClient.GetRequest<int>
|
||||
($"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<List<OrderViewModel>>
|
||||
($"api/order/getmany?userId={APIClient.Client.Id}&page={page}");
|
||||
ViewBag.Page = page;
|
||||
ViewBag.NumberOfPages = APIClient.GetRequest<int>
|
||||
($"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<List<EvaluationViewModel>>
|
||||
($"api/rating/getmany?userId={APIClient.Client.Id}&page={page}");
|
||||
ViewBag.Page = page;
|
||||
ViewBag.NumberOfPages = APIClient.GetRequest<int>
|
||||
($"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 });
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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<ServiceViewModel>? GetAllServices()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
var services = APIClient.GetRequest<List<ServiceViewModel>>($"api/service/getall");
|
||||
return services;
|
||||
}
|
||||
|
||||
public OrderViewModel? Get(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
OrderViewModel? order = APIClient
|
||||
.GetRequest<OrderViewModel>($"api/order/get?id={id}");
|
||||
return order;
|
||||
}
|
||||
|
||||
public List<OrderViewModel>? GetAllByUser()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
List<OrderViewModel>? order = APIClient
|
||||
.GetRequest<List<OrderViewModel>>($"api/order/GetAllByUser?userId={APIClient.Client.Id}");
|
||||
return order;
|
||||
}
|
||||
}
|
||||
}
|
@ -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<CosmeticViewModel>? GetAllCosmetics()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
var cosmetics = APIClient.GetRequest<List<CosmeticViewModel>>($"api/cosmetic/getall");
|
||||
return cosmetics;
|
||||
}
|
||||
|
||||
public ProcedureViewModel? Get(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
ProcedureViewModel? procedure = APIClient
|
||||
.GetRequest<ProcedureViewModel>($"api/procedure/get?id={id}");
|
||||
return procedure;
|
||||
}
|
||||
|
||||
public List<ProcedureViewModel>? GetAllByUser()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
List<ProcedureViewModel>? procedures = APIClient.GetRequest<List<ProcedureViewModel>>
|
||||
($"api/procedure/getallbyuser?userId={APIClient.Client.Id}");
|
||||
return procedures;
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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"
|
||||
}
|
||||
|
@ -1,25 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Оценка";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать оценку</h4>
|
||||
|
||||
<form method="post" asp-controller="Evaluation" asp-action="Create">
|
||||
<p class="mb-0">Баллы за процедуру:</p>
|
||||
<input type="number" min="0" max="10" step="0.01" name="pointsProcedure" class="form-control mb-2" />
|
||||
<p class="mb-0">Баллы за косметику:</p>
|
||||
<input type="number" min="0" max="10" step="0.01" name="pointsCosmetics" class="form-control mb-2" />
|
||||
<p class="mb-0">Процедура:</p>
|
||||
<select class="form-select mb-2" name="procedureId">
|
||||
@foreach (var procedure in @ViewBag.Procedure)
|
||||
{
|
||||
<option value="@procedure.Id">
|
||||
@(procedure.ProcedureName); @(procedure.ProcedurePrice) р.
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
<button class="button-primary text-button">
|
||||
Создать
|
||||
</button>
|
||||
</form>
|
||||
|
@ -1,36 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Оценка";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить оценку</h4>
|
||||
|
||||
<form method="post" asp-controller="Evaluation" asp-action="Create">
|
||||
<input name="id" value="@ViewBag.Rating.Id" style="display: none;" />
|
||||
<p class="mb-0">Баллы за процедуру:</p>
|
||||
<input type="number" min="0" max="10" step="0.01" name="pointsProcedure" class="form-control mb-2"
|
||||
value="@ViewBag.Rating.PointsProcedure.ToString("0.00").Replace(",", ".")" />
|
||||
<p class="mb-0">Баллы за косметику:</p>
|
||||
<input type="number" min="0" max="10" step="0.01" name="pointsCosmetics" class="form-control mb-2"
|
||||
value="@ViewBag.Rating.PointsCosmetics.ToString("0.00").Replace(",", ".")" />
|
||||
<p class="mb-0">Процедура:</p>
|
||||
<select class="form-select mb-2" name="procedureId">
|
||||
@foreach (var procedure in @ViewBag.Procedure)
|
||||
{
|
||||
@if (procedure.Id == ViewBag.Rating.ProcedureId)
|
||||
{
|
||||
<option value="@procedure.Id" selected>
|
||||
@(procedure.ProcedureName); @(procedure.ProcedurePrice) р.
|
||||
</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@procedure.Id">
|
||||
@(procedure.ProcedureName); @(procedure.ProcedurePrice) р.
|
||||
</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<button class="button-primary text-button">
|
||||
Обновить
|
||||
</button>
|
||||
</form>
|
@ -1,19 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Вход";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Вход в приложение</h4>
|
||||
|
||||
<form method="post">
|
||||
<div class="mb-3">
|
||||
<label for="login" class="form-label">Логин:</label>
|
||||
<input id="login" name="login" type="text" class="form-control" aria-label="Login">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Пароль:</label>
|
||||
<input id="password" name="password" type="password" class="form-control" aria-label="Password">
|
||||
</div>
|
||||
<button type="submit" class="btn button-primary">
|
||||
Войти
|
||||
</button>
|
||||
</form>
|
@ -1,53 +0,0 @@
|
||||
@using BeautySalonContracts.ViewModels
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Оценки";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Оценки</h4>
|
||||
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between">
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<a asp-controller="Evaluation" asp-action="Create" class="button-primary">
|
||||
Создать
|
||||
</a>
|
||||
<a id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</a>
|
||||
<button id="delete-button" class="button-primary me-5">
|
||||
Удалить
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<div class="input-group" style="width: auto;">
|
||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||
</div>
|
||||
<a href="/Home/Rating?page=@ViewBag.Page" id="go-button" class="button-primary">
|
||||
Перейти
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border">
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Баллы за процедуру</th>
|
||||
<th>Баллы за косметику</th>
|
||||
<th>Процедура</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ViewBag.Rating)
|
||||
{
|
||||
<tr class="table-row" id="row-@item.Id">
|
||||
<td>@item.PointsProcedure</td>
|
||||
<td>@item.PointsCosmetics</td>
|
||||
<td>@item.ProcedureName</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="~/js/rating.js" asp-append-version="true"></script>
|
@ -1,44 +0,0 @@
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "FormationDinner";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Формирование заказов</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="text-center">
|
||||
@{
|
||||
if (Model == null)
|
||||
{
|
||||
<h3 class="display-4">Авторизируйтесь</h3>
|
||||
return;
|
||||
}
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Создать заказ</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Номер
|
||||
</th>
|
||||
<th>
|
||||
Дата создания
|
||||
</th>
|
||||
<th>
|
||||
Цена
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
@ -1,8 +1,8 @@
|
||||
@{
|
||||
ViewData["Title"] = "HomePage";
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
<h1 class="display-4 text-center">Мы Вас не ждали, зло пожаловать!</h1>
|
||||
|
||||
<div class="text-center">
|
||||
<p><img src="/images/logo.png" alt="Logo" /></p>
|
||||
</div>
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
||||
</div>
|
||||
|
@ -1,53 +0,0 @@
|
||||
@using BeautySalonContracts.ViewModels
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Заказы";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Заказы</h4>
|
||||
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between">
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<a asp-controller="Order" asp-action="Create" class="button-primary">
|
||||
Создать
|
||||
</a>
|
||||
<a id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</a>
|
||||
<button id="delete-button" class="button-primary me-5">
|
||||
Удалить
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<div class="input-group" style="width: auto;">
|
||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||
</div>
|
||||
<a href="/Home/Cars?page=@ViewBag.Page" id="go-button" class="button-primary">
|
||||
Перейти
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border">
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Номер заказа</th>
|
||||
<th>Дата заказа</th>
|
||||
<th>Сумма заказа</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ViewBag.Order)
|
||||
{
|
||||
<tr class="table-row" id="row-@item.Id">
|
||||
<td>@item.Id</td>
|
||||
<td>@item.OrderDate</td>
|
||||
<td>@item.OrderAmount</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="~/js/order.js" asp-append-version="true"></script>
|
6
BeautySalonView/ClientWebApp/Views/Home/Privacy.cshtml
Normal file
6
BeautySalonView/ClientWebApp/Views/Home/Privacy.cshtml
Normal file
@ -0,0 +1,6 @@
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<p>Use this page to detail your site's privacy policy.</p>
|
@ -1,51 +0,0 @@
|
||||
@using BeautySalonContracts.ViewModels
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Процедуры";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Процедуры</h4>
|
||||
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between">
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<a asp-controller="Procedure" asp-action="Create" class="button-primary">
|
||||
Создать
|
||||
</a>
|
||||
<a id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</a>
|
||||
<button id="delete-button" class="button-primary me-5">
|
||||
Удалить
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<div class="input-group" style="width: auto;">
|
||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||
</div>
|
||||
<a href="/Home/Procedure?page=@ViewBag.Page" id="go-button" class="button-primary">
|
||||
Перейти
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border">
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Наименование процедуры</th>
|
||||
<th>Цена процедуры</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ViewBag.Procedure)
|
||||
{
|
||||
<tr class="table-row" id="row-@item.Id">
|
||||
<td>@item.ProcedureName</td>
|
||||
<td>@item.ProcedurePrice</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="~/js/procedure.js" asp-append-version="true"></script>
|
@ -1,53 +0,0 @@
|
||||
@using BeautySalonContracts.ViewModels
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Оценки";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Оценки</h4>
|
||||
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between">
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<a asp-controller="Rating" asp-action="Create" class="button-primary">
|
||||
Создать
|
||||
</a>
|
||||
<a id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</a>
|
||||
<button id="delete-button" class="button-primary me-5">
|
||||
Удалить
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<div class="input-group" style="width: auto;">
|
||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||
</div>
|
||||
<a href="/Home/Rating?page=@ViewBag.Page" id="go-button" class="button-primary">
|
||||
Перейти
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border">
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Баллы за процедуру</th>
|
||||
<th>Баллы за косметику</th>
|
||||
<th>Процедура</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ViewBag.Rating)
|
||||
{
|
||||
<tr class="table-row" id="row-@item.Id">
|
||||
<td>@item.PointsProcedure</td>
|
||||
<td>@item.PointsCosmetics</td>
|
||||
<td>@item.ProcedureName</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="~/js/rating.js" asp-append-version="true"></script>
|
@ -1,25 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Регистрация";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Регистрация</h4>
|
||||
|
||||
<form method="post">
|
||||
<div class="mb-3">
|
||||
<label for="login" class="form-label">Логин:</label>
|
||||
<input id="login" name="login" type="text" class="form-control" aria-label="Login">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Пароль:</label>
|
||||
<input id="password" name="password" type="password" class="form-control" aria-label="Password">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Адрес электронной почты:</label>
|
||||
<input id="email" name="email" type="email" class="form-control" aria-label="Email">
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn button-primary">
|
||||
Регистрация
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
@ -1,45 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Report";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Отчет по услугам</h4>
|
||||
|
||||
<div class="d-flex flex-wrap gap-1 align-items-end mb-2">
|
||||
<div class="mb-2">
|
||||
<p class="mb-0">Дата начала:</p>
|
||||
<input id="date-from-input" class="form-control" type="date" />
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<p class="mb-0">Дата конца:</p>
|
||||
<input id="date-to-input" class="form-control" type="date" />
|
||||
</div>
|
||||
<button id="generate-button" class="button-primary mb-2">
|
||||
Показать
|
||||
</button>
|
||||
<button id="send-by-mail-button" class="button-primary mb-2">
|
||||
На почту
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p class="mb-0">
|
||||
<span>За период с </span>
|
||||
<span id="date-from-span" class="fw-bold">...</span>
|
||||
<span> по </span>
|
||||
<span id="date-to-span" class="fw-bold">...</span>
|
||||
</p>
|
||||
<div class="table-shell mb-2 border">
|
||||
<table class="table mb-0">
|
||||
<thead class="table-head">
|
||||
<tr>
|
||||
<th>Номер заказа</th>
|
||||
<th>Дата</th>
|
||||
<th>Услуги</th>
|
||||
<th>Оценки</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="~/js/report.js" asp-append-version="true"></script>
|
@ -1,52 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Список услуг по заказам";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Список услуг по заказам</h4>
|
||||
|
||||
@{
|
||||
if (ViewBag.IsAllowed == false)
|
||||
{
|
||||
<h3 class="display-4">Авторизируйтесь</h3>
|
||||
return;
|
||||
}
|
||||
|
||||
<div class="mb-2">
|
||||
<button id="word-button" class="button-primary">
|
||||
Word
|
||||
</button>
|
||||
<button id="excel-button" class="button-primary">
|
||||
Excel
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p class="mb-0">Выбранные заказы:</p>
|
||||
<div class="table-shell border">
|
||||
<table class="table mb-0">
|
||||
<thead class="table-head">
|
||||
<tr>
|
||||
<th>Дата</th>
|
||||
<th>Сумма</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0">Добавить заказ:</p>
|
||||
<div class="d-flex gap-1 mb-2">
|
||||
<select class="form-select mb-0" id="order-select"></select>
|
||||
<button id="add-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<script src="~/js/list.js" asp-append-version="true"></script>
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Заказ";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать заказ</h4>
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранные услуги:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="service-tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить услугу:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="service-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="service-count-input" class="form-control mb-2" />
|
||||
<button id="add-service-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранные процедуры:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="procedure-tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Привязать процедуру:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="procedure-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="procedure-count-input" class="form-control mb-2" />
|
||||
<button id="add-procedure-button" class="button-primary">
|
||||
Привязать
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Стоимость заказа:</p>
|
||||
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
|
||||
<button id="create-button" class="button-primary">
|
||||
Создать
|
||||
</button>
|
||||
|
||||
<script src="~/js/order-create.js" asp-append-version="true"></script>
|
@ -1,73 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Заказ";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать заказ</h4>
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранные услуги:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="service-tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить услугу:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="service-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="service-count-input" class="form-control mb-2" />
|
||||
<button id="add-service-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранные процедуры:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="procedure-tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Привязать процедуру:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="procedure-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="procedure-count-input" class="form-control mb-2" />
|
||||
<button id="add-procedure-button" class="button-primary">
|
||||
Привязать
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Стоимость заказа:</p>
|
||||
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
|
||||
<button id="create-button" class="button-primary">
|
||||
Создать
|
||||
</button>
|
@ -1,77 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Заказ";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить заказ</h4>
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранные услуги:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="service-tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить услугу:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="service-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="service-count-input" class="form-control mb-2" />
|
||||
<button id="add-service-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранные процедуры:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="procedure-tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить процедуру:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="procedure-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="procedure-count-input" class="form-control mb-2" />
|
||||
<button id="add-procedure-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Стоимость заказа:</p>
|
||||
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
|
||||
<button id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</button>
|
||||
|
||||
<input id="id" value="@ViewBag.Id" style="display: none;" />
|
||||
|
||||
<script src="~/js/order-update.js" asp-append-version="true"></script>
|
@ -1,76 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Заказ";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить заказ</h4>
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранные услуги:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="service-tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить услугу:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="service-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="service-count-input" class="form-control mb-2" />
|
||||
<button id="add-service-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранные процедуры:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="procedure-tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить процедуру:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="procedure-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="procedure-count-input" class="form-control mb-2" />
|
||||
<button id="add-procedure-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Стоимость заказа:</p>
|
||||
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
|
||||
<button id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</button>
|
||||
|
||||
<input id="id" value="@ViewBag.Id" style="display: none;" />
|
||||
|
@ -1,49 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Процедура";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать процедуру</h4>
|
||||
|
||||
<p class="mb-0">Название процедуры:</p>
|
||||
<input id="name-input" class="form-control mb-2" />
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранная косметика:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Бренд</th>
|
||||
<th>Наименование косметики</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить косметику:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="cosmetic-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="count-input" class="form-control mb-2" />
|
||||
<button id="add-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Стоимость процедуры:</p>
|
||||
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
|
||||
<button id="create-button" class="button-primary">
|
||||
Создать
|
||||
</button>
|
||||
|
||||
<script src="~/js/procedure-create.js" asp-append-version="true"></script>
|
@ -1,48 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Процедура";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать процедуру</h4>
|
||||
|
||||
<p class="mb-0">Название процедуры:</p>
|
||||
<input id="name-input" class="form-control mb-2" />
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранная косметика:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Бренд</th>
|
||||
<th>Наименование косметики</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить косметику:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="cosmetic-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="count-input" class="form-control mb-2" />
|
||||
<button id="add-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Стоимость процедуры:</p>
|
||||
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
|
||||
<button id="create-button" class="button-primary">
|
||||
Создать
|
||||
</button>
|
||||
|
@ -1,51 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Процедура";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить процедуру</h4>
|
||||
|
||||
<p class="mb-0">Название процедуры:</p>
|
||||
<input id="name-input" class="form-control mb-2" />
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранная косметика:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Бренд</th>
|
||||
<th>Наименование косметики</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить косметику:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="cosmetic-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="count-input" class="form-control mb-2" />
|
||||
<button id="add-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Стоимость процедуры:</p>
|
||||
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
|
||||
<button id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</button>
|
||||
|
||||
<input id="id" value="@ViewBag.Id" style="display: none;" />
|
||||
|
||||
<script src="~/js/procedure-update.js" asp-append-version="true"></script>
|
@ -1,51 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Процедура";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить процедуру</h4>
|
||||
|
||||
<p class="mb-0">Название процедуры:</p>
|
||||
<input id="name-input" class="form-control mb-2" />
|
||||
|
||||
<p class="mb-0 fw-bold">Выбранная косметика:</p>
|
||||
<div>
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Бренд</th>
|
||||
<th>Наименование косметики</th>
|
||||
<th>Стоимость</th>
|
||||
<th>Количество</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
<tr>
|
||||
<td>Не выбрано</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="mb-0 fw-bold">Добавить косметику:</p>
|
||||
<p class="mb-0">Наименование:</p>
|
||||
<select class="form-select mb-0" id="cosmetic-select"></select>
|
||||
<p class="mb-0">Количество:</p>
|
||||
<input type="number" min="1" value="1" id="count-input" class="form-control mb-2" />
|
||||
<button id="add-button" class="button-primary">
|
||||
Добавить
|
||||
</button>
|
||||
|
||||
<p class="mb-0 fw-bold">Стоимость процедуры:</p>
|
||||
<input type="number" step="0.01" id="price-input" class="form-control mb-2" value="0.01" readonly />
|
||||
<button id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</button>
|
||||
|
||||
<input id="id" value="@ViewBag.Id" style="display: none;" />
|
||||
|
||||
|
@ -1,25 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Оценка";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать оценку</h4>
|
||||
|
||||
<form method="post" asp-controller="Rating" asp-action="Create">
|
||||
<p class="mb-0">Баллы за процедуру:</p>
|
||||
<input type="number" min="0" max="10" step="0.01" name="pointsProcedure" class="form-control mb-2" />
|
||||
<p class="mb-0">Баллы за косметику:</p>
|
||||
<input type="number" min="0" max="10" step="0.01" name="pointsCosmetics" class="form-control mb-2" />
|
||||
<p class="mb-0">Процедура:</p>
|
||||
<select class="form-select mb-2" name="procedureId">
|
||||
@foreach (var procedure in @ViewBag.Procedure)
|
||||
{
|
||||
<option value="@procedure.Id">
|
||||
@(procedure.ProcedureName); @(procedure.ProcedurePrice) р.
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
<button class="button-primary text-button">
|
||||
Создать
|
||||
</button>
|
||||
</form>
|
||||
|
@ -1,38 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Оценка";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить оценку</h4>
|
||||
|
||||
<form method="post" asp-controller="Rating" asp-action="Create">
|
||||
<input name="id" value="@ViewBag.Rating.Id" style="display: none;" />
|
||||
<p class="mb-0">Баллы за процедуру:</p>
|
||||
<input type="number" min="0" max="10" step="0.01" name="pointsProcedure" class="form-control mb-2"
|
||||
value="@ViewBag.Rating.PointsProcedure.ToString("0.00").Replace(",", ".")" />
|
||||
<p class="mb-0">Баллы за косметику:</p>
|
||||
<input type="number" min="0" max="10" step="0.01" name="pointsCosmetics" class="form-control mb-2"
|
||||
value="@ViewBag.Rating.PointsCosmetics.ToString("0.00").Replace(",", ".")" />
|
||||
<p class="mb-0">Процедура:</p>
|
||||
<select class="form-select mb-2" name="procedureId">
|
||||
@foreach (var procedure in @ViewBag.Procedure)
|
||||
{
|
||||
@if (procedure.Id == ViewBag.Rating.ProcedureId)
|
||||
{
|
||||
<option value="@procedure.Id" selected>
|
||||
@(procedure.ProcedureName); @(procedure.ProcedurePrice) р.
|
||||
</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@procedure.Id">
|
||||
@(procedure.ProcedureName); @(procedure.ProcedurePrice) р.
|
||||
</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<button class="button-primary text-button">
|
||||
Обновить
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<script src="~/js/rating.js" asp-append-version="true"></script>
|
@ -3,22 +3,16 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - BeutySalonClientApp</title>
|
||||
<title>@ViewData["Title"] - ClientWebApp</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/BeutySalonClientApp.styles.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/ClientWebApp.styles.css" asp-append-version="true" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex flex-column">
|
||||
<a class="navbar-brand fw-weight-bold py-0 px-2" asp-area="" asp-controller="Home" asp-action="Index">Вы Ужасны</a>
|
||||
<div class="px-2">ClientApp</div>
|
||||
</div>
|
||||
<div class="mx-2">
|
||||
<img src="https://png.pngtree.com/png-clipart/20191120/original/pngtree-spider-glyph-icon-vector-png-image_5056646.jpg" alt="mdo" width="35" height="35" class="rounded-circle">
|
||||
</div>
|
||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">ClientWebApp</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@ -26,25 +20,10 @@
|
||||
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Авторизация</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Procedure">Процедуры</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Order">Заказы</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Rating">Оценки</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="ServiceList">Список</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Report">Отчет</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -59,7 +38,7 @@
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2023 - BeutySalonClientApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
© 2024 - ClientWebApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
|
@ -1,3 +1,3 @@
|
||||
@using BeutySalonClientApp
|
||||
@using BeutySalonClientApp.Models
|
||||
@using ClientWebApp
|
||||
@using ClientWebApp.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
|
@ -5,6 +5,5 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"IPAddress": "http://localhost:5277/"
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
|
@ -1,67 +0,0 @@
|
||||
using BeautySalonContracts.ViewModels;
|
||||
using Newtonsoft.Json;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
|
||||
namespace BeutySalonStaffMemberApp
|
||||
{
|
||||
public class APIClient
|
||||
{
|
||||
private static readonly HttpClient _client = new();
|
||||
|
||||
public static StaffMemberViewModel? 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<T>(string requestUrl)
|
||||
{
|
||||
var response = _client.GetAsync(requestUrl);
|
||||
var result = response.Result.Content.ReadAsStringAsync().Result;
|
||||
if (response.Result.IsSuccessStatusCode)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(result);
|
||||
}
|
||||
}
|
||||
|
||||
public static void PostRequest<T>(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<I, O>(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<O>(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BeutySalonStaffMemberApp.Controllers
|
||||
{
|
||||
public class CosmeticController : Controller
|
||||
{
|
||||
public IActionResult Create()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Create(string brand, string cosmeticName, string cosmeticPrice)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
APIClient.PostRequest("api/cosmetic/create", new CosmeticBindingModel
|
||||
{
|
||||
LaborCostId = APIClient.Client.Id,
|
||||
Brand = brand,
|
||||
CosmeticName = cosmeticName,
|
||||
CosmeticPrice = double.Parse(cosmeticPrice.Replace(".", ","))
|
||||
|
||||
});
|
||||
Response.Redirect("/Home/Cosmetic");
|
||||
}
|
||||
|
||||
public IActionResult Update(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
ViewBag.Service = APIClient.GetRequest<ServiceBindingModel>
|
||||
($"api/service/get?id={id}");
|
||||
ViewBag.Procedure = APIClient.GetRequest<ProcedureBindingModel>
|
||||
($"api/procedure/get?id={id}");
|
||||
ViewBag.Cosmetic = APIClient.GetRequest<List<LaborCostsViewModel>>
|
||||
($"api/cosmetic/getall?userId={APIClient.Client.Id}");
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Update(int id, string brand, string cosmeticName, string cosmeticPrice)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
APIClient.PostRequest("api/cosmetic/update", new CosmeticBindingModel
|
||||
{
|
||||
Id = id,
|
||||
Brand = brand,
|
||||
CosmeticName = cosmeticName,
|
||||
CosmeticPrice = double.Parse(cosmeticPrice.Replace(".", ","))
|
||||
});
|
||||
Response.Redirect("/Home/Wishes");
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Delete(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
APIClient.PostRequest($"api/cosmetic/delete",
|
||||
new ServiceBindingModel() { Id = id });
|
||||
return;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public List<ProcedureViewModel>? GetAllProcedures()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
var procedures = APIClient.GetRequest<List<ProcedureViewModel>>($"api/procedure/getall");
|
||||
return procedures;
|
||||
}
|
||||
[HttpGet]
|
||||
public List<CosmeticViewModel>? GetAllByUser()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var cosmetics = APIClient.GetRequest<List<CosmeticViewModel>>
|
||||
($"api/cosmetic/getallbyuser?userId={APIClient.Client.Id}");
|
||||
return cosmetics;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +1,8 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
using BeutySalonStaffMemberApp.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using StaffMemberWebApp.Models;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace BeutySalonStaffMemberApp.Controllers
|
||||
namespace StaffMemberWebApp.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
@ -16,134 +13,12 @@ namespace BeutySalonStaffMemberApp.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<StaffMemberViewModel>($"api/staffmember/login?login={login}&password={password}");
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("Неверный логин/пароль");
|
||||
}
|
||||
Response.Redirect("Index");
|
||||
}
|
||||
|
||||
public IActionResult LaborCosts(int page)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
if (page == 0)
|
||||
{
|
||||
page = 1;
|
||||
}
|
||||
ViewBag.LaborCosts = APIClient.GetRequest<List<LaborCostsViewModel>>
|
||||
($"api/laborcosts/getmany?userId={APIClient.Client.Id}&page={page}");
|
||||
// ViewBag.Page = page;
|
||||
// ViewBag.NumberOfPages = APIClient.GetRequest<int>
|
||||
// ($"api/laborcosts/getnumberofpages?userId={APIClient.Client.Id}");
|
||||
return View();
|
||||
}
|
||||
public IActionResult Cosmetic(int page)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
if (page == 0)
|
||||
{
|
||||
page = 1;
|
||||
}
|
||||
ViewBag.Cosmetic = APIClient.GetRequest<List<CosmeticViewModel>>
|
||||
($"api/cosmetic/getmany?userId={APIClient.Client.Id}&page={page}");
|
||||
// ViewBag.Page = page;
|
||||
// ViewBag.NumberOfPages = APIClient.GetRequest<int>
|
||||
// ($"api/cosmetic/getnumberofpages?userId={APIClient.Client.Id}");
|
||||
return View();
|
||||
}
|
||||
public IActionResult Service(int page)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
if (page == 0)
|
||||
{
|
||||
page = 1;
|
||||
}
|
||||
ViewBag.Service = APIClient.GetRequest<List<ServiceViewModel>>
|
||||
($"api/service/getmany?userId={APIClient.Client.Id}&page={page}");
|
||||
// ViewBag.Page = page;
|
||||
// ViewBag.NumberOfPages = APIClient.GetRequest<int>
|
||||
// ($"api/service/getnumberofpages?userId={APIClient.Client.Id}");
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult LaborCostsService()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult ListCosmetics()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
ViewBag.IsAllowed = true;
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult ProcedureCosmetic()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Register()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Register(string login, string password, string email)
|
||||
{
|
||||
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email))
|
||||
{
|
||||
throw new Exception("Введите логин, пароль и ФИО");
|
||||
}
|
||||
APIClient.PostRequest("api/staffmember/register", new StaffMemberBindingModel
|
||||
{
|
||||
StaffMemberEmail = email,
|
||||
StaffMemberLogin = login,
|
||||
StaffMemberPassword = password
|
||||
});
|
||||
Response.Redirect("Enter");
|
||||
return;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return View();
|
||||
}
|
||||
public IActionResult Report()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult ServiceCosmetic()
|
||||
public IActionResult Privacy()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
@ -154,4 +29,4 @@ namespace BeutySalonStaffMemberApp.Controllers
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,72 +0,0 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
using BeautySalonDatabaseImplement.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BeutySalonStaffMemberApp.Controllers
|
||||
{
|
||||
public class LaborCostsController : Controller
|
||||
{
|
||||
public IActionResult Create()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Create(int numberHours, int staffMemberId)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
APIClient.PostRequest("api/laborcosts/create", new LaborCostsBindingModel
|
||||
{
|
||||
StaffMemberId = APIClient.Client.Id,
|
||||
NumberHours = numberHours
|
||||
});
|
||||
Response.Redirect("/Home/LaborCosts");
|
||||
}
|
||||
|
||||
public IActionResult Update(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
ViewBag.LaborCosts = APIClient.GetRequest<LaborCostsBindingModel>($"api/laborcosts/get?id={id}");
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Update(int id, int numberHours, int staffMemberId)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
APIClient.PostRequest("api/laborcosts/update", new LaborCostsBindingModel
|
||||
{
|
||||
Id = id,
|
||||
NumberHours = numberHours,
|
||||
StaffMemberId = staffMemberId
|
||||
});
|
||||
Response.Redirect("/Home/LaborCosts");
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Delete(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
APIClient.PostRequest($"api/laborcosts/delete",
|
||||
new ServiceBindingModel() { Id = id });
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,108 +0,0 @@
|
||||
using BeautySalonContracts.BindingModels;
|
||||
using BeautySalonContracts.ViewModels;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BeutySalonStaffMemberApp.Controllers
|
||||
{
|
||||
public class ServiceController : Controller
|
||||
{
|
||||
public IActionResult Create()
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
ViewBag.LaborCostsList = APIClient.GetRequest<List<LaborCostsViewModel>>($"api/laborcosts/getall?userId={APIClient.Client.Id}");
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Create(string serviceName, string servicePrice, int laborCostsId)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
APIClient.PostRequest("api/service/create", new ServiceBindingModel
|
||||
{
|
||||
StaffMemberId = APIClient.Client.Id,
|
||||
ServiceName = serviceName,
|
||||
ServicePrice = double.Parse(servicePrice.Replace(".", ",")),
|
||||
});
|
||||
Response.Redirect("/Home/Service");
|
||||
}
|
||||
|
||||
public IActionResult Update(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
ViewBag.Service = APIClient.GetRequest<ServiceBindingModel>
|
||||
($"api/service/get?id={id}");
|
||||
ViewBag.LaborCostsList = APIClient.GetRequest<List<LaborCostsViewModel>>
|
||||
($"api/laborcosts/getall?userId={APIClient.Client.Id}");
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Update(int id, string serviceName, string servicePrice, int laborCostsId)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
APIClient.PostRequest("api/service/update", new ServiceBindingModel
|
||||
{
|
||||
Id = id,
|
||||
StaffMemberId = APIClient.Client.Id,
|
||||
ServiceName = serviceName,
|
||||
ServicePrice = double.Parse(servicePrice.Replace(".", ",")),
|
||||
});
|
||||
Response.Redirect("/Home/Service");
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Delete(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
APIClient.PostRequest($"api/service/delete",
|
||||
new ServiceBindingModel() { Id = id });
|
||||
return;
|
||||
}
|
||||
|
||||
public IActionResult Bind(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
ViewBag.ServiceId = id;
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public void Bind([FromBody] ServiceBindingModel serviceModel)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
throw new Exception("403");
|
||||
}
|
||||
APIClient.PostRequest("api/service/update", serviceModel);
|
||||
}
|
||||
|
||||
public ServiceViewModel? Get(int id)
|
||||
{
|
||||
if (APIClient.Client == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
ServiceViewModel? service = APIClient
|
||||
.GetRequest<ServiceViewModel>($"api/service/get?id={id}");
|
||||
return service;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace BeutySalonStaffMemberApp.Models
|
||||
namespace StaffMemberWebApp.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
@ -6,4 +6,4 @@ namespace BeutySalonStaffMemberApp.Models
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,16 +3,16 @@
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:8371",
|
||||
"sslPort": 44334
|
||||
"applicationUrl": "http://localhost:48777",
|
||||
"sslPort": 44352
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"BeautySalonWebApp": {
|
||||
"StaffMemberWebApp": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:7091;http://localhost:5099",
|
||||
"applicationUrl": "https://localhost:7237;http://localhost:5264",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
@ -6,15 +6,4 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BeautySalonBusinessLogic\BeautySalonBusinessLogic.csproj" />
|
||||
<ProjectReference Include="..\BeautySalonContracts\BeautySalonContracts.csproj" />
|
||||
<ProjectReference Include="..\BeautySalonDatabaseImplement\BeautySalonDatabaseImplement.csproj" />
|
||||
<ProjectReference Include="..\BeautySalonDataModels\BeautySalonDataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,26 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Косметика";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать косметику</h4>
|
||||
|
||||
<form method="post" asp-controller="Cosmetic" asp-action="Create">
|
||||
<p class="mb-0">Бренд:</p>
|
||||
<input type="text" name="brand" class="form-control mb-3" />
|
||||
<p class="mb-0">Наименование косметики:</p>
|
||||
<input type="text" name="cosmeticName" class="form-control mb-3" />
|
||||
<p class="mb-0">Стоимость:</p>
|
||||
<input type="number" step="0.01" min="0.01" name="cosmeticPrice" class="form-control mb-3" />
|
||||
<p class="mb-0">Выбрать трудозатрату для привязки:</p>
|
||||
<select class="form-select mb-2" name="laborCostsId">
|
||||
@foreach (var laborCosts in @ViewBag.LaborCostsList)
|
||||
{
|
||||
<option value="@laborCosts.Id">
|
||||
часы: @(laborCosts.NumberHours), сложность: @(laborCosts.Difficulty)
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
<button type="submit" class="btn button-primary">
|
||||
Создать
|
||||
</button>
|
||||
</form>
|
@ -1,36 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Косметика";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить косметику</h4>
|
||||
|
||||
<form method="post" asp-controller="Cosmetic" asp-action="Update">
|
||||
<input name="id" value="@ViewBag.Cosmetic.Id" style="display: none;" />
|
||||
<p class="mb-0">Бренд:</p>
|
||||
<input type="text" value="@ViewBag.Cosmetic.Brand" name="brand" class="form-control mb-3" />
|
||||
<p class="mb-0">Наименование косметики:</p>
|
||||
<input type="text" value="@ViewBag.Cosmetic.CosmeticName" name="cosmeticName" class="form-control mb-3" />
|
||||
<p class="mb-0">Стоимость:</p>
|
||||
<input type="number" step="0.01" value="0.01" name="cosmeticPrice" class="form-control mb-3" />
|
||||
<p class="mb-0">Трудозатраты:</p>
|
||||
<select class="form-select mb-2" name="laborCostsId">
|
||||
@foreach (var laborCosts in @ViewBag.LaborCostsList)
|
||||
{
|
||||
@if (laborCosts.Id == ViewBag.Service.LaborCostsId)
|
||||
{
|
||||
<option value="@laborCosts.Id" selected>
|
||||
часы: @(laborCosts.NumberHours), специалисты: @(laborCosts.NumberSpecialists)
|
||||
</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@laborCosts.Id">
|
||||
часы: @(laborCosts.NumberHours), специалисты: @(laborCosts.NumberSpecialists)
|
||||
</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<button type="submit" class="button-primary">
|
||||
Обновить
|
||||
</button>
|
||||
</form>
|
@ -1,53 +0,0 @@
|
||||
@using BeautySalonContracts.ViewModels
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Косметика";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Косметика</h4>
|
||||
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between">
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<a asp-controller="Cosmetic" asp-action="Create" class="btn button-primary">
|
||||
Создать
|
||||
</a>
|
||||
<button id="update-button" class="btn button-primary">
|
||||
Обновить
|
||||
</button>
|
||||
<button id="delete-button" class="btn button-primary me-5">
|
||||
Удалить
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<div class="input-group" style="width: auto;">
|
||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||
</div>
|
||||
<a href="/Home/Cars?page=@ViewBag.Page" id="go-button" class="btn btn-lg button-primary">
|
||||
Перейти
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border">
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Бренд</th>
|
||||
<th>Наименование косметики</th>
|
||||
<th>Стоимость</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ViewBag.Cosmetic)
|
||||
{
|
||||
<tr class="table-row" id="row-@item.Id">
|
||||
<td>@item.Brand</td>
|
||||
<td>@item.CosmeticName</td>
|
||||
<td>@item.CosmeticPrice</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="~/js/cosmetic.js" asp-append-version="true"></script>
|
@ -1,19 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Вход";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Вход в приложение</h4>
|
||||
|
||||
<form method="post">
|
||||
<div class="mb-3">
|
||||
<label for="login" class="form-label">Логин:</label>
|
||||
<input id="login" name="login" type="text" class="form-control" aria-label="Login">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Пароль:</label>
|
||||
<input id="password" name="password" type="password" class="form-control" aria-label="Password">
|
||||
</div>
|
||||
<button type="submit" class="btn button-primary">
|
||||
Войти
|
||||
</button>
|
||||
</form>
|
@ -1,8 +1,8 @@
|
||||
@{
|
||||
ViewData["Title"] = "HomePage";
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
<h1 class="display-4 text-center">текст в центре окей</h1>
|
||||
|
||||
<div class="text-center">
|
||||
<p><img src="" alt="Logo" /></p>
|
||||
</div>
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
||||
</div>
|
||||
|
@ -1,51 +0,0 @@
|
||||
@using BeautySalonContracts.ViewModels
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Трудозатраты";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Трудозатраты</h4>
|
||||
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between">
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<a asp-controller="LaborCosts" asp-action="Create" class="button-primary">
|
||||
Создать
|
||||
</a>
|
||||
<a id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</a>
|
||||
<button id="delete-button" class="button-primary me-5">
|
||||
Удалить
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<div class="input-group" style="width: auto;">
|
||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||
</div>
|
||||
<a href="/Home/Cosmetics?page=@ViewBag.Page" id="go-button" class="button-primary">
|
||||
Перейти
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border">
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Количество часов</th>
|
||||
<th>Сложность</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ViewBag.LaborCosts)
|
||||
{
|
||||
<tr class="table-row" id="row-@item.Id">
|
||||
<td>@item.NumberHours</td>
|
||||
<td>@item.Difficlty</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="~/js/laborcosts.js" asp-append-version="true"></script>
|
@ -0,0 +1,6 @@
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<p>Use this page to detail your site's privacy policy.</p>
|
@ -1,25 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Регистрация";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Регистрация</h4>
|
||||
|
||||
<form method="post">
|
||||
<div class="mb-3">
|
||||
<label for="login" class="form-label">Логин:</label>
|
||||
<input id="login" name="login" type="text" class="form-control" aria-label="Login">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Пароль:</label>
|
||||
<input id="password" name="password" type="password" class="form-control" aria-label="Password">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Адрес электронной почты:</label>
|
||||
<input id="email" name="email" type="email" class="form-control" aria-label="Email">
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn button-primary">
|
||||
Регистрация
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
@ -1,53 +0,0 @@
|
||||
@using BeautySalonContracts.ViewModels
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Услуга";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Услуги</h4>
|
||||
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between">
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<a asp-controller="Service" asp-action="Create" class="button-primary">
|
||||
Создать
|
||||
</a>
|
||||
<a id="update-button" class="button-primary">
|
||||
Обновить
|
||||
</a>
|
||||
<a id="bind-button" class="button-primary">
|
||||
Связать с косметикой
|
||||
</a>
|
||||
<button id="delete-button" class="button-primary me-5">
|
||||
Удалить
|
||||
</button>
|
||||
</div>
|
||||
<div class="d-flex mb-2 gap-1">
|
||||
<div class="input-group" style="width: auto;">
|
||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||
</div>
|
||||
<a href="/Home?page=@ViewBag.Page" id="go-button" class="button-primary">
|
||||
Перейти
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border">
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Наименование</th>
|
||||
<th>Стоимость</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in ViewBag.Service)
|
||||
{
|
||||
<tr class="table-row" id="row-@item.Id">
|
||||
<td>@item.ServiceName</td>
|
||||
<td>@item.ServicePrice</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script src="~/js/service.js" asp-append-version="true"></script>
|
@ -1,15 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Трудозатраты";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать трудозатрату</h4>
|
||||
|
||||
<form method="post" asp-controller="LaborCosts" asp-action="Create">
|
||||
<p class="mb-0">Количество часов:</p>
|
||||
<input type="number" name="numberHours" class="form-control mb-3" />
|
||||
<p class="mb-0">Сложность:</p>
|
||||
<input type="text" name="difficulty" class="form-control mb-3" />
|
||||
<button type="submit" class="btn button-primary">
|
||||
Создать
|
||||
</button>
|
||||
</form>
|
@ -1,16 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Трудозатраты";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить трудозатраты</h4>
|
||||
|
||||
<form method="post" asp-controller="LaborCosts" asp-action="Update">
|
||||
<input name="id" value="@ViewBag.LaborCosts.Id" style="display: none;" />
|
||||
<p class="mb-0">Количество часов:</p>
|
||||
<input type="number" value="@ViewBag.LaborCosts.NumberHours" name="numberHours" class="form-control mb-3" />
|
||||
<p class="mb-0">Сложность:</p>
|
||||
<input type="text" value="@ViewBag.LaborCosts.Difficulty" name="difficulty" class="form-control mb-3" />
|
||||
<button type="submit" class="btn button-primary">
|
||||
Обновить
|
||||
</button>
|
||||
</form>
|
@ -1,15 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Услуги";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Создать услугу</h4>
|
||||
|
||||
<form method="post" asp-controller="Service" asp-action="Create">
|
||||
<p class="mb-0">Наименование услуги:</p>
|
||||
<input name="serviceName" class="form-control mb-2" />
|
||||
<p class="mb-0">Стоимость услуги:</p>
|
||||
<input type="number" step="0.01" name="servicePrice" class="form-control mb-2" />
|
||||
<button id="create-button" class="button-primary text-button">
|
||||
Создать
|
||||
</button>
|
||||
</form>
|
@ -1,18 +0,0 @@
|
||||
@{
|
||||
ViewData["Title"] = "Услуга";
|
||||
}
|
||||
|
||||
<h4 class="fw-bold">Обновить услугу</h4>
|
||||
|
||||
<form method="post" asp-controller="Service" asp-action="Update">
|
||||
<input name="id" value="@ViewBag.Service.Id" style="display: none;" />
|
||||
<p class="mb-0">Наименование услуги:</p>
|
||||
<input value="@ViewBag.Service.ServiceName" name="serviceName" class="form-control mb-2" />
|
||||
<p class="mb-0">Стоимость услуги:</p>
|
||||
<input value="@ViewBag.Service.ServicePrice.ToString("0.00").Replace(",", ".")"
|
||||
type="number" step="0.01" name="servicePrice" class="form-control mb-2" />
|
||||
<button class="button-primary">
|
||||
Обновить
|
||||
</button>
|
||||
</form>
|
||||
|
@ -3,22 +3,16 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - BeutySalonStaffMemberApp</title>
|
||||
<title>@ViewData["Title"] - StaffMemberWebApp</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/BeutySalonStaffMemberApp.styles.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/StaffMemberWebApp.styles.css" asp-append-version="true" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex flex-column">
|
||||
<a class="navbar-brand fw-weight-bold py-0 px-2" asp-area="" asp-controller="Home" asp-action="Index">Вы Ужасны</a>
|
||||
<div class="px-2">StaffMemberApp</div>
|
||||
</div>
|
||||
<div class="mx-2">
|
||||
<img src="https://png.pngtree.com/png-clipart/20191120/original/pngtree-spider-glyph-icon-vector-png-image_5056646.jpg" alt="mdo" width="35" height="35" class="rounded-circle">
|
||||
</div>
|
||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">StaffMemberWebApp</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@ -26,25 +20,10 @@
|
||||
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Авторизация</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Service">Услуги</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="LaborCosts">Трудозатраты</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Cosmetic">Косметика</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="ListCosmetics">Список</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Report">Отчет</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -59,7 +38,7 @@
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2023 - BeutySalonStaffMemberApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
© 2024 - StaffMemberWebApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
|
@ -1,3 +1,3 @@
|
||||
@using BeutySalonStaffMemberApp
|
||||
@using BeutySalonStaffMemberApp.Models
|
||||
@using StaffMemberWebApp
|
||||
@using StaffMemberWebApp.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
|
@ -5,6 +5,5 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"IPAddress": "http://localhost:5277/"
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user