честная цена!

This commit is contained in:
frog24 2024-05-30 00:35:06 +04:00
parent ce9b01a920
commit e89b70f144
2 changed files with 6 additions and 33 deletions

View File

@ -203,12 +203,17 @@ namespace ClientApp.Controllers
ClientId = APIClient.Client.Id,
ServiceId = service,
VisitAnimals = a,
Cost = double.Parse(1000.ToString()) , //TODO: просто цену услуги передать
Cost = GetCost(service),
DateVisit= dateTime,
VisitName = name
});
Response.Redirect("IndexDoctorVisit");
}
public double GetCost(int serviceId)
{
var service = APIClient.GetRequest<ServiceViewModel>($"api/service/getservice?sereviceid={serviceId}");
return service.Price;
}
//=================ПОКУПКИ=================
public IActionResult IndexDrugPurchase()
{

View File

@ -29,38 +29,6 @@ namespace VetclinicBusinessLogic.BusinessLogics
public List<ReportServicesViewModel> GetPetServices(ReportServicesBindingModel model)
{
//List<ReportServicesViewModel> ans = new();
//List<ReportServicesViewModel> response = _serviceStorage.GetReportServices(new ReportPetsSearchModel { servicesIds = services });
//List<ReportPetsViewModel> respons = _petStorage.GetReportServices(new ReportServicesSearchModel { petsIds = pets });
//foreach (var service in response)
//{
// Dictionary<int, (PetViewModel, int)> counter = new();
// foreach (var visit in service.Services)
// {
// foreach (var pet in visit.ServiceMedications)
// {
// if (!counter.ContainsKey(pet.Id))
// counter.Add(pet.Id, (pet, 1));
// else
// {
// counter[pet.Id] = (counter[pet.Id].Item1, counter[pet.Id].Item2 + 1);
// }
// }
// }
// List<PetViewModel> res = new();
// foreach (var cnt in counter)
// {
// if (cnt.Value.Item2 != service.Count)
// continue;
// res.Add(cnt.Value.Item1);
// }
// ans.Add(new ReportPetsViewModel
// {
// ServiceName = service.Item1.ServiceName,
// Animals = res
// });
//}
//return ans;
return _animalStorage.GetReportServices(new() { AnimalIds = model.Animals });
}
public List<ReportVisitsDrugsViewModel> GetVisitsDrugs(ReportVisitsDrugsBindingModel model)