с таким тз это все
This commit is contained in:
parent
1684e57bcc
commit
852dea96b4
@ -172,7 +172,8 @@ namespace ClientApp.Controllers
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return View(APIClient.GetRequest<List<DoctorVisitViewModel>>($"api/doctorvisit/getvisits?clientid={APIClient.Client.Id}"));
|
||||
var helpme = APIClient.GetRequest<List<DoctorVisitViewModel>>($"api/doctorvisit/getvisits?clientid={APIClient.Client.Id}");
|
||||
return View(helpme);
|
||||
}
|
||||
public IActionResult CreateDoctorVisit()
|
||||
{
|
||||
|
@ -34,14 +34,19 @@ namespace VetclinicDatabaseImplement.Implements
|
||||
|
||||
public List<DoctorVisitViewModel> GetFilteredList(DoctorVisitSearchModel model)
|
||||
{
|
||||
if (!model.Id.HasValue)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
using var context = new VetclinicDatabase();
|
||||
return context.DoctorVisits.Where(x => x.Id == model.Id)
|
||||
.Include(x => x.Client).Include(x => x.Service).Include(x => x.Animals).ThenInclude(x => x.Animal)
|
||||
.Select(x => x.GetViewModel).ToList();
|
||||
if (model.DateVisit == null && model.VisitName == null && model.ServiceId == null && model.Id == null && model.ClientId != null)
|
||||
{
|
||||
return context.DoctorVisits.Where(x => x.ClientId == model.ClientId).Include(x => x.Client).Include(x => x.Animals).ThenInclude(x => x.Animal).Include(x => x.Service)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
}
|
||||
return context.DoctorVisits.Where(x => x.ClientId == model.ClientId).Include(x => x.Client).Include(x => x.Animals).ThenInclude(x => x.Animal).Include(x => x.Service)
|
||||
.Where(x => ((!model.Id.HasValue || x.Id == model.Id) &&
|
||||
(!model.ClientId.HasValue || x.ClientId <= model.ClientId) &&
|
||||
(!model.ServiceId.HasValue || x.ServiceId == model.ServiceId)))
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
}
|
||||
public List<DoctorVisitViewModel> GetFullList()
|
||||
{
|
||||
|
@ -12,8 +12,8 @@ using VetclinicDatabaseImplement;
|
||||
namespace VetclinicDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(VetclinicDatabase))]
|
||||
[Migration("20240529004732_hope3")]
|
||||
partial class hope3
|
||||
[Migration("20240529103650_hope4")]
|
||||
partial class hope4
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
namespace VetclinicDatabaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class hope3 : Migration
|
||||
public partial class hope4 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
@ -68,7 +68,7 @@ namespace VetclinicDatabaseImplement.Models
|
||||
Cost = Cost,
|
||||
ClientId = ClientId,
|
||||
ServiceName = Service?.ServiceName ?? string.Empty,
|
||||
VisitAnimals = VisitAnimals
|
||||
// VisitAnimals = VisitAnimals
|
||||
};
|
||||
|
||||
public void Update(DoctorVisitBindingModel model)
|
||||
|
@ -38,7 +38,7 @@ namespace VetclinicRestApi.Controllers
|
||||
}
|
||||
}
|
||||
[HttpGet]
|
||||
public List<DoctorVisitViewModel>? GetVisits(int? clientId = null)
|
||||
public List<DoctorVisitViewModel>? GetVisits(int? clientId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user