This commit is contained in:
kagbie3nn@mail.ru 2024-05-31 23:47:28 +04:00
parent c9fb6972e2
commit 3f62f48c05
9 changed files with 117 additions and 5 deletions

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZooContracts.SearchModels
{
public class ReportPreserversPriceSearchModels
{
public List<int>? PreserveIds { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZooContracts.SearchModels
{
public class ReportRoutesCostsSearchModels
{
public List<int>? RoutesIds { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZooContracts.ViewModels
{
internal class ReportPreserversPriceViewModel
{
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZooContracts.ViewModels
{
public class ReportRoutesCostsViewModel
{
public string RouteName { get; set; } = string.Empty;
// public List<DrugViewModel> Drugs { get; set; }
}
}

View File

@ -0,0 +1,6 @@
namespace ZooRestApi.Controllers
{
public class Count
{
}
}

View File

@ -0,0 +1,48 @@
using Microsoft.AspNetCore.Mvc;
using ZooContracts.BindingModels;
using ZooContracts.BusinessLogicsContracts;
namespace ZooRestApi.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class ReportClientController : Controller
{
private readonly ILogger _logger;
private readonly IReportClientLogic _reportClient;
public ReportClientController(ILogger<ILogger> logger, IReportClientLogic reportClient)
{
_reportClient = reportClient;
_logger = logger;
}
[Microsoft.AspNetCore.Mvc.HttpGet]
public IActionResult Index(IReportClientLogic reportClient)
{
return View();
}
[HttpPost]
public void CreateServiceListWordFile(ReportPreserveBindingModel model)
{
try
{
_reportClient.SavePreservesToWordFile(model);
}
catch (Exception ex)
{
throw;
}
}
[HttpPost]
public void CreateServiceListExcelFile(ReportPreserveBindingModel model)
{
try
{
_reportClient.SavePreservesToExcelFile(model);
}
catch (Exception ex)
{
throw;
}
}
}
}

View File

@ -35,7 +35,7 @@
Стоимость
</th>
<th>
Удалить животное
Удалить заповедник
</th>
</tr>
</thead>

View File

@ -6,7 +6,7 @@
<h1 class="display-4">Отчеты</h1>
<div class="list-group">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="ListPreserves">Списки маршрутов</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="AnimalVisitsAndDrugs">Посещения и лекарства животных</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="AnimalVisitsAndDrugs">Заповедники и стоимость животных</a>
</div>
</div>

View File

@ -2,17 +2,17 @@
ViewData["Title"] = "UpdatePreserve";
}
<div class="text-center">
<h2 class="display-4">Редактирование животного</h2>
<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="pet" name="name" class="form-control" asp-items="@(new SelectList(@ViewBag.Preserves, "Id", "PreserveName"))"></select>
</div>
</div>
<div class="row">
<div class="col-4">Возраст:</div>
<div class="col-4">Стоимость:</div>
<div class="col-8"><input type="text" name="price" /></div>
</div>
<div class="row">