This commit is contained in:
kagbie3nn@mail.ru 2024-05-31 16:50:27 +04:00
parent 8a323f321e
commit e19ee5e3f4
8 changed files with 16 additions and 17 deletions

View File

@ -153,8 +153,8 @@ namespace ZooClientApp.Controllers
{
return Redirect("~/Home/Enter");
}
var helpme = APIClient.GetRequest<List<RouteViewModel>>($"api/route/getroutes?clientid={APIClient.Client.Id}");
return View(helpme);
return View(APIClient.GetRequest<List<RouteViewModel>>($"api/route/getroutes?Clientid={APIClient.Client.Id}"));
}
public IActionResult CreateRoute()
{

View File

@ -7,9 +7,8 @@
<h1 class="display-4">Приложение "Зоопарк "Юрский период". Клиент"</h1>
<div class="list-group">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="IndexDoctorVisit">Посещения врача</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="IndexDrugPurchase">Покупки лекарств</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Политика</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="IndexRoute">Посещения врача</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Политика</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Reports">Отчеты</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Вход</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>

View File

@ -12,7 +12,7 @@ using ZooDataBaseImplement;
namespace ZooDataBaseImplement.Migrations
{
[DbContext(typeof(ZooDatabase))]
[Migration("20240531085434_initialcreate")]
[Migration("20240531115435_initialcreate")]
partial class initialcreate
{
/// <inheritdoc />
@ -20,7 +20,7 @@ namespace ZooDataBaseImplement.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.18")
.HasAnnotation("ProductVersion", "7.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

View File

@ -17,7 +17,7 @@ namespace ZooDataBaseImplement.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.18")
.HasAnnotation("ProductVersion", "7.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

View File

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections;
using System.Collections.Generic;
@ -9,7 +10,7 @@ using ZooDataBaseImplement.Models;
namespace ZooDataBaseImplement
{
public class ZooDatabase : DbContext
public class ZooDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)

View File

@ -19,11 +19,11 @@ namespace ZooRestApi.Controllers
_route = route;
}
[HttpGet]
public Tuple<RouteViewModel, List<string>>? GetRoutes(int visitId)
public Tuple<RouteViewModel, List<string>>? GetRoute(int routeId)
{
try
{
var elem = _route.ReadElement(new RouteSearchModel { Id = visitId });
var elem = _route.ReadElement(new RouteSearchModel { Id = routeId });
if (elem == null)
{
return null;
@ -33,12 +33,12 @@ namespace ZooRestApi.Controllers
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка получения визита по id={Id}", visitId);
_logger.LogError(ex, "Ошибка получения визита по id={Id}", routeId);
throw;
}
}
[HttpGet]
public List<RouteViewModel>? GetRoute(int? clientId)
public List<RouteViewModel>? GetRoutes(int? clientId)
{
try
{
@ -52,7 +52,7 @@ namespace ZooRestApi.Controllers
}
[HttpGet]
public List<RouteViewModel> GetAllVisits()
public List<RouteViewModel> GetAllRoutes()
{
try
{
@ -66,7 +66,7 @@ namespace ZooRestApi.Controllers
}
[HttpPost]
public bool CreateVisit(RouteBindingModel model)
public bool CreateRoute(RouteBindingModel model)
{
try
{

View File

@ -21,8 +21,7 @@ namespace ZooShowEmployeeApp.Controllers
{
return Redirect("~/Home/Enter");
}
return
View(APIEmployee.GetRequest<List<RouteViewModel>>($"api/main/getroutes?EmployeeId={APIEmployee.Employee.Id}"));
return View();
}