доделал

This commit is contained in:
goldfest 2024-04-18 21:08:02 +04:00
parent d5f510250c
commit d025f0b025
19 changed files with 251 additions and 264 deletions

View File

@ -17,9 +17,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyFileImplement"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyDatabaseImplement", "TravelCompanyDatabaseImplement\TravelCompanyDatabaseImplement.csproj", "{1232CA3D-F5FE-4BD6-88E9-719F822E605B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelCompanyRestApi", "TravelCompanyRestApi\TravelCompanyRestApi.csproj", "{EDF8977C-50AE-4011-8771-A39F7442331D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyClientApp", "TravelCompanyClientApp\TravelCompanyClientApp.csproj", "{F1E802C4-EE5D-4508-B42F-3ACB70621013}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelCompanyClientApp", "TravelCompanyClientApp\TravelCompanyClientApp.csproj", "{8F25F567-8D4C-4178-A5A2-33D54A97417C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TravelCompanyRestApi", "TravelCompanyRestApi\TravelCompanyRestApi.csproj", "{E24D011F-7289-4DBA-9C90-D49713C4E495}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -55,14 +55,14 @@ Global
{1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Release|Any CPU.Build.0 = Release|Any CPU
{EDF8977C-50AE-4011-8771-A39F7442331D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDF8977C-50AE-4011-8771-A39F7442331D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDF8977C-50AE-4011-8771-A39F7442331D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDF8977C-50AE-4011-8771-A39F7442331D}.Release|Any CPU.Build.0 = Release|Any CPU
{8F25F567-8D4C-4178-A5A2-33D54A97417C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F25F567-8D4C-4178-A5A2-33D54A97417C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F25F567-8D4C-4178-A5A2-33D54A97417C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F25F567-8D4C-4178-A5A2-33D54A97417C}.Release|Any CPU.Build.0 = Release|Any CPU
{F1E802C4-EE5D-4508-B42F-3ACB70621013}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1E802C4-EE5D-4508-B42F-3ACB70621013}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1E802C4-EE5D-4508-B42F-3ACB70621013}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1E802C4-EE5D-4508-B42F-3ACB70621013}.Release|Any CPU.Build.0 = Release|Any CPU
{E24D011F-7289-4DBA-9C90-D49713C4E495}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E24D011F-7289-4DBA-9C90-D49713C4E495}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E24D011F-7289-4DBA-9C90-D49713C4E495}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E24D011F-7289-4DBA-9C90-D49713C4E495}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,7 +1,7 @@
using TravelCompanyContracts.ViewModels;
using System.Net.Http.Headers;
using System.Net.Http.Headers;
using System.Text;
using Newtonsoft.Json;
using TravelCompanyContracts.ViewModels;
namespace TravelCompanyClientApp

View File

@ -1,8 +1,9 @@
using TravelCompanyClientApp.Models;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
using TravelCompanyClientApp.Models;
using TravelCompanyClientApp;
using TravelCompanyContracts.BindingModels;
using TravelCompanyContracts.ViewModels;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
namespace TravelCompanyClientApp.Controllers
{

View File

@ -18,6 +18,7 @@ if (!app.Environment.IsDevelopment())
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();

View File

@ -1,11 +1,10 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:6592",
"sslPort": 44336
"applicationUrl": "http://localhost:8145",
"sslPort": 44343
}
},
"profiles": {
@ -13,8 +12,7 @@
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7237;http://localhost:5059",
"applicationUrl": "https://localhost:7019;http://localhost:5041",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
@ -22,7 +20,6 @@
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

View File

@ -8,12 +8,10 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TravelCompanyContracts\TravelCompanyContracts.csproj" />
<ProjectReference Include="..\TravelCompanyRestApi\TravelCompanyRestApi.csproj" />
</ItemGroup>
</Project>

View File

@ -1,37 +1,30 @@
@{
ViewData["Title"] = "Create";
}
<div class="text-center">
<h2 class="display-4">Создание заказа</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Путёвка:</div>
<div class="col-4">Изделие:</div>
<div class="col-8">
<select id="travel" name="travel" class="form-control" asp-items="@(new SelectList(@ViewBag.travels,"Id", "TravelName"))"></select>
<select id="travel" name="travel" class="form-control" asp-items="@(new SelectList(@ViewBag.Travels,"Id", "TravelName"))"></select>
</div>
</div>
<div class="row">
<div class="col-4">Количество:</div>
<div class="col-8">
<input type="text" name="count" id="count" />
</div>
<div class="col-8"><input type="text" name="count" id="count" /></div>
</div>
<div class="row">
<div class="col-4">Сумма:</div>
<div class="col-8">
<input type="text" id="sum" name="sum" readonly />
</div>
<div class="col-8"><input type="text" id="sum" name="sum" readonly /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Создать" class="btn
btn-primary" />
</div>
<div class="col-4"><input type="submit" value="Создать" class="btn btn-primary" /></div>
</div>
</form>
<script>
$('#travel').on('change', function () {
check();

View File

@ -1,6 +1,7 @@
@{
ViewData["Title"] = "Enter";
}
<div class="text-center">
<h2 class="display-4">Вход в приложение</h2>
</div>
@ -15,6 +16,6 @@
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Вход" class="btn btnprimary" /></div>
<div class="col-4"><input type="submit" value="Вход" class="btn btn-primary" /></div>
</div>
</form>

View File

@ -1,11 +1,16 @@
@using TravelCompanyContracts.ViewModels
@model List<OrderViewModel>
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Заказы</h1>
</div>
<div class="text-center">
@{
if (Model == null)
@ -13,6 +18,7 @@
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<p>
<a asp-action="Create">Создать заказ</a>
</p>
@ -44,28 +50,22 @@
{
<tr>
<td>
@Html.DisplayFor(modelItem =>
item.Id)
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.TravelName)
@Html.DisplayFor(modelItem => item.TravelName)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.DateCreate)
@Html.DisplayFor(modelItem => item.DateCreate)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.Count)
@Html.DisplayFor(modelItem => item.Count)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.Sum)
@Html.DisplayFor(modelItem => item.Sum)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.Status)
@Html.DisplayFor(modelItem => item.Status)
</td>
</tr>
}

View File

@ -11,15 +11,15 @@
<form method="post">
<div class="row">
<div class="col-4">Логин:</div>
<div class="col-8"><input type="text" name="login" value="@Model.Email"/></div>
<div class="col-8"><input type="text" name="login" value="@Model.Email" /></div>
</div>
<div class="row">
<div class="col-4">Пароль:</div>
<div class="col-8"><input type="password" name="password" value="@Model.Password"/></div>
<div class="col-8"><input type="password" name="password" value="@Model.Password" /></div>
</div>
<div class="row">
<div class="col-4">ФИО:</div>
<div class="col-8"><input type="text" name="fio" value="@Model.ClientFIO"/></div>
<div class="col-8"><input type="text" name="fio" value="@Model.ClientFIO" /></div>
</div>
<div class="row">
<div class="col-8"></div>

View File

@ -20,9 +20,6 @@
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Регистрация"
class="btn btn-primary" />
</div>
<div class="col-4"><input type="submit" value="Регистрация" class="btn btn-primary" /></div>
</div>
</form>

View File

@ -3,34 +3,33 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - travelShopClientApp</title>
<title>@ViewData["Title"] - TravelCompanyClientApp</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/TravelCompanyClientApp.styles.css" asp-append-version="true" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bgwhite border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-controller="Home" aspaction="Index">Туристическая компания</a>
<button class="navbar-toggler" type="button" datatoggle="collapse" data-target=".navbar-collapse" ariacontrols="navbarSupportedContent"
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">TravelCompanyClientApp</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>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-smrow-reverse">
<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" asparea="" asp-controller="Home" asp-action="Index">Заказы</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Заказы</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Вход</a>
<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" asparea="" asp-controller="Home" asp-action="Register">Регистрация</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
</li>
</ul>
</div>
@ -42,12 +41,15 @@
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2024 - Магазин мороженного - <a asp-area="" aspcontroller="Home" asp-action="Privacy">Личные данные</a>
&copy; 2024 - TravelCompanyClientApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>

View File

@ -6,5 +6,5 @@
}
},
"AllowedHosts": "*",
"IPAddress": "http://localhost:5189"
"IPAddress": "http://localhost:5247/"
}

View File

@ -20,7 +20,7 @@ namespace TravelCompanyContracts.ViewModels
public int ClientId { get; set; }
[DisplayName("Клиент")]
public string ClientFIO { get; set; } = string.Empty;
[DisplayName("Мороженное")]
[DisplayName("Путёвка")]
public string TravelName { get; set; } = string.Empty;
[DisplayName("Количество")]
public int Count { get; set; }

View File

@ -3,6 +3,11 @@ using TravelCompanyContracts.SearchModels;
using TravelCompanyContracts.StoragesContracts;
using TravelCompanyContracts.ViewModels;
using TravelCompanyDatabaseImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TravelCompanyDatabaseImplement.Implements
{

View File

@ -5,14 +5,6 @@ using TravelCompanyDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TravelCompanyContracts.BindingModels;
using TravelCompanyContracts.ViewModels;
using TravelCompanyDatabaseImplement.Models;
using TravelCompanyDataModels.Enums;
using TravelCompanyDataModels.Models;
namespace TravelCompanyDatabaseImplement.Models
{

View File

@ -4,8 +4,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:54003",
"sslPort": 44386
"applicationUrl": "http://localhost:27763",
"sslPort": 44336
}
},
"profiles": {
@ -14,7 +14,7 @@
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7040;http://localhost:5297",
"applicationUrl": "https://localhost:7056;http://localhost:5247",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

View File

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="6.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="c:/temp/IceCreamShopRestApi.log" />
<file value="c:/temp/PizzeriaRestApi.log" />
<appendToFile value="true" />
<maximumFileSize value="100KB" />
<maxSizeRollBackups value="2" />