доделал

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 EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyDatabaseImplement", "TravelCompanyDatabaseImplement\TravelCompanyDatabaseImplement.csproj", "{1232CA3D-F5FE-4BD6-88E9-719F822E605B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TravelCompanyDatabaseImplement", "TravelCompanyDatabaseImplement\TravelCompanyDatabaseImplement.csproj", "{1232CA3D-F5FE-4BD6-88E9-719F822E605B}"
EndProject 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 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 EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution 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}.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.ActiveCfg = Release|Any CPU
{1232CA3D-F5FE-4BD6-88E9-719F822E605B}.Release|Any CPU.Build.0 = 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 {F1E802C4-EE5D-4508-B42F-3ACB70621013}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDF8977C-50AE-4011-8771-A39F7442331D}.Debug|Any CPU.Build.0 = Debug|Any CPU {F1E802C4-EE5D-4508-B42F-3ACB70621013}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDF8977C-50AE-4011-8771-A39F7442331D}.Release|Any CPU.ActiveCfg = Release|Any CPU {F1E802C4-EE5D-4508-B42F-3ACB70621013}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDF8977C-50AE-4011-8771-A39F7442331D}.Release|Any CPU.Build.0 = Release|Any CPU {F1E802C4-EE5D-4508-B42F-3ACB70621013}.Release|Any CPU.Build.0 = Release|Any CPU
{8F25F567-8D4C-4178-A5A2-33D54A97417C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E24D011F-7289-4DBA-9C90-D49713C4E495}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F25F567-8D4C-4178-A5A2-33D54A97417C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E24D011F-7289-4DBA-9C90-D49713C4E495}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F25F567-8D4C-4178-A5A2-33D54A97417C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E24D011F-7289-4DBA-9C90-D49713C4E495}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F25F567-8D4C-4178-A5A2-33D54A97417C}.Release|Any CPU.Build.0 = Release|Any CPU {E24D011F-7289-4DBA-9C90-D49713C4E495}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE 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 System.Text;
using Newtonsoft.Json; using Newtonsoft.Json;
using TravelCompanyContracts.ViewModels;
namespace TravelCompanyClientApp 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.BindingModels;
using TravelCompanyContracts.ViewModels; using TravelCompanyContracts.ViewModels;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
namespace TravelCompanyClientApp.Controllers namespace TravelCompanyClientApp.Controllers
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,15 +11,15 @@
<form method="post"> <form method="post">
<div class="row"> <div class="row">
<div class="col-4">Логин:</div> <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>
<div class="row"> <div class="row">
<div class="col-4">Пароль:</div> <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>
<div class="row"> <div class="row">
<div class="col-4">ФИО:</div> <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>
<div class="row"> <div class="row">
<div class="col-8"></div> <div class="col-8"></div>

View File

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

View File

@ -3,34 +3,33 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <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="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" /> <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<script src="~/lib/jquery/dist/jquery.min.js"></script> <link rel="stylesheet" href="~/TravelCompanyClientApp.styles.css" asp-append-version="true" />
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</head> </head>
<body> <body>
<header> <header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bgwhite border-bottom box-shadow mb-3"> <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container"> <div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" aspaction="Index">Туристическая компания</a> <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">TravelCompanyClientApp</a>
<button class="navbar-toggler" type="button" datatoggle="collapse" data-target=".navbar-collapse" ariacontrols="navbarSupportedContent" <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"> aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </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"> <ul class="navbar-nav flex-grow-1">
<li class="nav-item"> <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>
<li class="nav-item"> <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>
<li class="nav-item"> <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>
<li class="nav-item"> <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> </li>
</ul> </ul>
</div> </div>
@ -42,12 +41,15 @@
@RenderBody() @RenderBody()
</main> </main>
</div> </div>
<footer class="border-top footer text-muted"> <footer class="border-top footer text-muted">
<div class="container"> <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> </div>
</footer> </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> <script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false) @await RenderSectionAsync("Scripts", required: false)
</body> </body>
</html> </html>

View File

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

View File

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

View File

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

View File

@ -5,14 +5,6 @@ using TravelCompanyDataModels.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; 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 namespace TravelCompanyDatabaseImplement.Models
{ {

View File

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

View File

@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <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" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup> </ItemGroup>

View File

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