lk
This commit is contained in:
parent
8a323f321e
commit
e19ee5e3f4
@ -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()
|
||||
{
|
||||
|
@ -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>
|
||||
|
@ -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);
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user