Compare commits
No commits in common. "ca5e671616e5d9bd3bfd4b1b03eabac9f5727d44" and "196dbf8f6c0e82375249baa03ca8c6e6f08560cc" have entirely different histories.
ca5e671616
...
196dbf8f6c
@ -1,108 +0,0 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.BusinessLogicsContracts;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.StoragesContracts;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicBusinessLogic.BusinessLogics
|
||||
{
|
||||
public class GuidanceLogic : IGuidanceLogic
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IGuidanceStorage _guidanceStorage;
|
||||
|
||||
public GuidanceLogic(ILogger<GuidanceLogic> logger, IGuidanceStorage guidanceStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_guidanceStorage = guidanceStorage;
|
||||
}
|
||||
|
||||
public GuidanceViewModel? ReadElement(GuidanceSearchModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
_logger.LogInformation("ReadElement. Id:{ Id}", model.Id);
|
||||
var element = _guidanceStorage.GetElement(model);
|
||||
if (element == null)
|
||||
{
|
||||
_logger.LogWarning("ReadElement element not found");
|
||||
return null;
|
||||
}
|
||||
_logger.LogInformation("ReadElement find. Id:{Id}", element.Id);
|
||||
return element;
|
||||
}
|
||||
|
||||
public List<GuidanceViewModel>? ReadList(GuidanceSearchModel? model)
|
||||
{
|
||||
_logger.LogInformation("ReadList. Id:{ Id}", model?.Id);
|
||||
var list = model == null ? _guidanceStorage.GetFullList() :
|
||||
_guidanceStorage.GetFilteredList(model);
|
||||
if (list == null)
|
||||
{
|
||||
_logger.LogWarning("ReadList return null list");
|
||||
return null;
|
||||
}
|
||||
_logger.LogInformation("ReadList. Count:{Count}", list.Count);
|
||||
return list;
|
||||
}
|
||||
|
||||
public bool Create(GuidanceBindingModel model)
|
||||
{
|
||||
CheckModel(model);
|
||||
if (_guidanceStorage.Insert(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Insert operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool Update(GuidanceBindingModel model)
|
||||
{
|
||||
CheckModel(model);
|
||||
if (_guidanceStorage.Update(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Update operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool Delete(GuidanceBindingModel model)
|
||||
{
|
||||
CheckModel(model, false);
|
||||
_logger.LogInformation("Delete. Id:{Id}", model.Id);
|
||||
if (_guidanceStorage.Delete(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Delete operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private void CheckModel(GuidanceBindingModel model, bool withParams =
|
||||
true)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
if (!withParams)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.Text))
|
||||
{
|
||||
throw new ArgumentNullException("Нет текста рекомендации",
|
||||
nameof(model.Text));
|
||||
}
|
||||
|
||||
_logger.LogInformation("Guidance. Text:{Text}.", model.Text);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.BusinessLogicsContracts;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.StoragesContracts;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicBusinessLogic.BusinessLogics
|
||||
{
|
||||
public class MedicineLogic : IMedicineLogic
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IMedicineStorage _medicineStorage;
|
||||
public MedicineLogic(ILogger<MedicineLogic> logger, IMedicineStorage iceCreamStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_medicineStorage = iceCreamStorage;
|
||||
}
|
||||
|
||||
public List<MedicineViewModel>? ReadList(MedicineSearchModel? model)
|
||||
{
|
||||
_logger.LogInformation("ReadList. MedicineName:{MedicineName}. Id:{ Id}", model?.MedicineName, model?.Id);
|
||||
var list = model == null ? _medicineStorage.GetFullList() :
|
||||
_medicineStorage.GetFilteredList(model);
|
||||
if (list == null)
|
||||
{
|
||||
_logger.LogWarning("ReadList return null list");
|
||||
return null;
|
||||
}
|
||||
_logger.LogInformation("ReadList. Count:{Count}", list.Count);
|
||||
return list;
|
||||
}
|
||||
public MedicineViewModel? ReadElement(MedicineSearchModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
_logger.LogInformation("ReadElement. MedicineName:{MedicineName}.Id:{ Id}", model.MedicineName, model.Id);
|
||||
var element = _medicineStorage.GetElement(model);
|
||||
if (element == null)
|
||||
{
|
||||
_logger.LogWarning("ReadElement element not found");
|
||||
return null;
|
||||
}
|
||||
_logger.LogInformation("ReadElement find. Id:{Id}", element.Id);
|
||||
return element;
|
||||
}
|
||||
|
||||
public bool Create(MedicineBindingModel model)
|
||||
{
|
||||
CheckModel(model);
|
||||
if (_medicineStorage.Insert(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Insert operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Update(MedicineBindingModel model)
|
||||
{
|
||||
CheckModel(model);
|
||||
if (_medicineStorage.Update(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Update operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool Delete(MedicineBindingModel model)
|
||||
{
|
||||
CheckModel(model, false);
|
||||
_logger.LogInformation("Delete. Id:{Id}", model.Id);
|
||||
if (_medicineStorage.Delete(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Delete operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void CheckModel(MedicineBindingModel model, bool withParams =
|
||||
true)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
if (!withParams)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.MedicineName))
|
||||
{
|
||||
throw new ArgumentNullException("Нет названия медикамента",
|
||||
nameof(model.MedicineName));
|
||||
}
|
||||
if (model.Price <= 0)
|
||||
{
|
||||
throw new ArgumentNullException("Цена медикамента должна быть больше 0", nameof(model.Price));
|
||||
}
|
||||
_logger.LogInformation("Medicine. Medicine:{MedicineName}. Price:{ Price }. Id: { Id}", model.MedicineName, model.Price, model.Id);
|
||||
var element = _medicineStorage.GetElement(new MedicineSearchModel
|
||||
{
|
||||
MedicineName = model.MedicineName
|
||||
});
|
||||
if (element != null && element.Id != model.Id)
|
||||
{
|
||||
throw new InvalidOperationException("Медикамент с таким названием уже есть");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.BusinessLogicsContracts;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.StoragesContracts;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicBusinessLogic.BusinessLogics
|
||||
{
|
||||
public class PharmacistLogic : IPharmacistLogic
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IPharmacistStorage _pharmacistStorage;
|
||||
public PharmacistLogic(ILogger<PharmacistLogic> logger, IPharmacistStorage
|
||||
pharmacistStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_pharmacistStorage = pharmacistStorage;
|
||||
}
|
||||
public List<PharmacistViewModel>? ReadList(PharmacistSearchModel? model)
|
||||
{
|
||||
_logger.LogInformation("ReadList. PharmacistFIO:{PharmacistFIO}. Id:{ Id}", model?.PharmacistFIO, model?.Id);
|
||||
var list = model == null ? _pharmacistStorage.GetFullList() :
|
||||
_pharmacistStorage.GetFilteredList(model);
|
||||
if (list == null)
|
||||
{
|
||||
_logger.LogWarning("ReadList return null list");
|
||||
return null;
|
||||
}
|
||||
_logger.LogInformation("ReadList. Count:{Count}", list.Count);
|
||||
return list;
|
||||
}
|
||||
public PharmacistViewModel? ReadElement(PharmacistSearchModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
_logger.LogInformation("ReadElement. PharmacistFIO:{PharmacistFIO}.Id:{ Id}", model.PharmacistFIO, model.Id);
|
||||
var element = _pharmacistStorage.GetElement(model);
|
||||
if (element == null)
|
||||
{
|
||||
_logger.LogWarning("ReadElement element not found");
|
||||
return null;
|
||||
}
|
||||
_logger.LogInformation("ReadElement find. Id:{Id}", element.Id);
|
||||
return element;
|
||||
}
|
||||
public bool Create(PharmacistBindingModel model)
|
||||
{
|
||||
CheckModel(model);
|
||||
if (_pharmacistStorage.Insert(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Insert operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool Update(PharmacistBindingModel model)
|
||||
{
|
||||
CheckModel(model);
|
||||
if (_pharmacistStorage.Update(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Update operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool Delete(PharmacistBindingModel model)
|
||||
{
|
||||
CheckModel(model, false);
|
||||
_logger.LogInformation("Delete. Id:{Id}", model.Id);
|
||||
if (_pharmacistStorage.Delete(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Delete operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private void CheckModel(PharmacistBindingModel model, bool withParams =
|
||||
true)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
if (!withParams)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.PharmacistFIO))
|
||||
{
|
||||
throw new ArgumentNullException("Нет ФИО клиента",
|
||||
nameof(model.PharmacistFIO));
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.Email))
|
||||
{
|
||||
throw new ArgumentNullException("Нет Email клиента",
|
||||
nameof(model.Email));
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.Password))
|
||||
{
|
||||
throw new ArgumentNullException("Нет пароля клиента",
|
||||
nameof(model.Password));
|
||||
}
|
||||
_logger.LogInformation("Pharmacist. PharmacistFIO:{PharmacistFIO}." +
|
||||
"Email:{ Email}. Password:{ Password}. Id: { Id} ", model.PharmacistFIO, model.Email, model.Password, model.Id);
|
||||
var element = _pharmacistStorage.GetElement(new PharmacistSearchModel
|
||||
{
|
||||
Email = model.Email,
|
||||
});
|
||||
if (element != null && element.Id != model.Id)
|
||||
{
|
||||
throw new InvalidOperationException("Клиент с таким логином уже есть");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,120 +0,0 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.BusinessLogicsContracts;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.StoragesContracts;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicBusinessLogic.BusinessLogics
|
||||
{
|
||||
public class ServiceLogic : IServiceLogic
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly IServiceStorage _serviceStorage;
|
||||
public ServiceLogic(ILogger<ServiceLogic> logger, IServiceStorage serviceStorage)
|
||||
{
|
||||
_logger = logger;
|
||||
_serviceStorage = serviceStorage;
|
||||
}
|
||||
|
||||
public List<ServiceViewModel>? ReadList(ServiceSearchModel? model)
|
||||
{
|
||||
_logger.LogInformation("ReadList. ServiceName:{ServiceName}. Id:{ Id}", model?.ServiceName, model?.Id);
|
||||
var list = model == null ? _serviceStorage.GetFullList() :
|
||||
_serviceStorage.GetFilteredList(model);
|
||||
if (list == null)
|
||||
{
|
||||
_logger.LogWarning("ReadList return null list");
|
||||
return null;
|
||||
}
|
||||
_logger.LogInformation("ReadList. Count:{Count}", list.Count);
|
||||
return list;
|
||||
}
|
||||
public ServiceViewModel? ReadElement(ServiceSearchModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
_logger.LogInformation("ReadElement. ServiceName:{ServiceName}.Id:{ Id}", model.ServiceName, model.Id);
|
||||
var element = _serviceStorage.GetElement(model);
|
||||
if (element == null)
|
||||
{
|
||||
_logger.LogWarning("ReadElement element not found");
|
||||
return null;
|
||||
}
|
||||
_logger.LogInformation("ReadElement find. Id:{Id}", element.Id);
|
||||
return element;
|
||||
}
|
||||
|
||||
public bool Create(ServiceBindingModel model)
|
||||
{
|
||||
CheckModel(model);
|
||||
if (_serviceStorage.Insert(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Insert operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Update(ServiceBindingModel model)
|
||||
{
|
||||
CheckModel(model);
|
||||
if (_serviceStorage.Update(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Update operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool Delete(ServiceBindingModel model)
|
||||
{
|
||||
CheckModel(model, false);
|
||||
_logger.LogInformation("Delete. Id:{Id}", model.Id);
|
||||
if (_serviceStorage.Delete(model) == null)
|
||||
{
|
||||
_logger.LogWarning("Delete operation failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void CheckModel(ServiceBindingModel model, bool withParams =
|
||||
true)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
if (!withParams)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.ServiceName))
|
||||
{
|
||||
throw new ArgumentNullException("Нет названия услуги",
|
||||
nameof(model.ServiceName));
|
||||
}
|
||||
if (model.Price <= 0)
|
||||
{
|
||||
throw new ArgumentNullException("Цена мороженного услуги быть больше 0", nameof(model.Price));
|
||||
}
|
||||
_logger.LogInformation("Service. ServiceName:{ServiceName}. Price:{ Price }. Id: { Id}", model.ServiceName, model.Price, model.Id);
|
||||
var element = _serviceStorage.GetElement(new ServiceSearchModel
|
||||
{
|
||||
ServiceName = model.ServiceName
|
||||
});
|
||||
if (element != null && element.Id != model.Id)
|
||||
{
|
||||
throw new InvalidOperationException("Услуга с таким названием уже есть");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicDataModels.Models;
|
||||
|
||||
namespace VetClinicContracts.BindingModels
|
||||
{
|
||||
public class GuidanceBindingModel : IGuidanceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Text { get; set; } = string.Empty;
|
||||
public DateTime Date { get; set; }
|
||||
public int ServiceId { get; set; }
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicDataModels.Models;
|
||||
|
||||
namespace VetClinicContracts.BindingModels
|
||||
{
|
||||
public class MedicineBindingModel : IMedicineModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string MedicineName { get; set; } = string.Empty;
|
||||
public int Price { get; set; }
|
||||
public int PharmacistId { get; set; }
|
||||
public Dictionary<int, IAnimalModel> MedicineAnimals { get; set; } = new();
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicDataModels.Models;
|
||||
|
||||
namespace VetClinicContracts.BindingModels
|
||||
{
|
||||
public class PharmacistBindingModel : IPharmacistModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string PharmacistFIO { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
using Microsoft.Identity.Client;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicDataModels.Models;
|
||||
|
||||
namespace VetClinicContracts.BindingModels
|
||||
{
|
||||
public class ServiceBindingModel : IServiceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string ServiceName { get; set; } = string.Empty;
|
||||
public int Price { get; set; }
|
||||
public int PharmacistId { get; set; }
|
||||
public Dictionary<int, (IMedicineModel, int)> ServiceMedicines { get; set; } = new();
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicContracts.BindingModels
|
||||
{
|
||||
public class VaccinationBindingModel
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IGuidanceLogic
|
||||
{
|
||||
List<GuidanceViewModel>? ReadList(GuidanceSearchModel? model);
|
||||
GuidanceViewModel? ReadElement(GuidanceSearchModel model);
|
||||
bool Create(GuidanceBindingModel model);
|
||||
bool Update(GuidanceBindingModel model);
|
||||
bool Delete(GuidanceBindingModel model);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IMedicineLogic
|
||||
{
|
||||
List<MedicineViewModel>? ReadList(MedicineSearchModel? model);
|
||||
MedicineViewModel? ReadElement(MedicineSearchModel model);
|
||||
bool Create(MedicineBindingModel model);
|
||||
bool Update(MedicineBindingModel model);
|
||||
bool Delete(MedicineBindingModel model);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IPharmacistLogic
|
||||
{
|
||||
List<PharmacistViewModel>? ReadList(PharmacistSearchModel? model);
|
||||
PharmacistViewModel? ReadElement(PharmacistSearchModel model);
|
||||
bool Create(PharmacistBindingModel model);
|
||||
bool Update(PharmacistBindingModel model);
|
||||
bool Delete(PharmacistBindingModel model);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IServiceLogic
|
||||
{
|
||||
List<ServiceViewModel>? ReadList(ServiceSearchModel? model);
|
||||
ServiceViewModel? ReadElement(ServiceSearchModel model);
|
||||
bool Create(ServiceBindingModel model);
|
||||
bool Update(ServiceBindingModel model);
|
||||
bool Delete(ServiceBindingModel model);
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicContracts.SearchModels
|
||||
{
|
||||
public class GuidanceSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? Text { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
public int? ServiceId { get; set; }
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicContracts.SearchModels
|
||||
{
|
||||
public class MedicineSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? MedicineName { get; set; } = string.Empty;
|
||||
public int? PharmacistId { get; set; }
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicContracts.SearchModels
|
||||
{
|
||||
public class PharmacistSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? PharmacistFIO { get; set; } = string.Empty;
|
||||
public string? Email { get; set; } = string.Empty;
|
||||
public string? Password { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicContracts.SearchModels
|
||||
{
|
||||
public class ServiceSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
public string? ServiceName { get; set; } = string.Empty;
|
||||
public int? PharmacistId { get; set; }
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicContracts.StoragesContracts
|
||||
{
|
||||
public interface IGuidanceStorage
|
||||
{
|
||||
List<GuidanceViewModel> GetFullList();
|
||||
List<GuidanceViewModel> GetFilteredList(GuidanceSearchModel model);
|
||||
GuidanceViewModel? GetElement(GuidanceSearchModel model);
|
||||
GuidanceViewModel? Insert(GuidanceBindingModel model);
|
||||
GuidanceViewModel? Update(GuidanceBindingModel model);
|
||||
GuidanceViewModel? Delete(GuidanceBindingModel model);
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicContracts.StoragesContracts
|
||||
{
|
||||
public interface IMedicineStorage
|
||||
{
|
||||
List<MedicineViewModel> GetFullList();
|
||||
List<MedicineViewModel> GetFilteredList(MedicineSearchModel model);
|
||||
MedicineViewModel? GetElement(MedicineSearchModel model);
|
||||
MedicineViewModel? Insert(MedicineBindingModel model);
|
||||
MedicineViewModel? Update(MedicineBindingModel model);
|
||||
MedicineViewModel? Delete(MedicineBindingModel model);
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicContracts.StoragesContracts
|
||||
{
|
||||
public interface IPharmacistStorage
|
||||
{
|
||||
List<PharmacistViewModel> GetFullList();
|
||||
List<PharmacistViewModel> GetFilteredList(PharmacistSearchModel model);
|
||||
PharmacistViewModel? GetElement(PharmacistSearchModel model);
|
||||
PharmacistViewModel? Insert(PharmacistBindingModel model);
|
||||
PharmacistViewModel? Update(PharmacistBindingModel model);
|
||||
PharmacistViewModel? Delete(PharmacistBindingModel model);
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicContracts.BindingModels;
|
||||
using VetClinicContracts.SearchModels;
|
||||
using VetClinicContracts.ViewModels;
|
||||
|
||||
namespace VetClinicContracts.StoragesContracts
|
||||
{
|
||||
public interface IServiceStorage
|
||||
{
|
||||
List<ServiceViewModel> GetFullList();
|
||||
List<ServiceViewModel> GetFilteredList(ServiceSearchModel model);
|
||||
ServiceViewModel? GetElement(ServiceSearchModel model);
|
||||
ServiceViewModel? Insert(ServiceBindingModel model);
|
||||
ServiceViewModel? Update(ServiceBindingModel model);
|
||||
ServiceViewModel? Delete(ServiceBindingModel model);
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicDataModels.Models;
|
||||
|
||||
namespace VetClinicContracts.ViewModels
|
||||
{
|
||||
public class GuidanceViewModel : IGuidanceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Текст рекомендации")]
|
||||
public string Text { get; set; } = string.Empty;
|
||||
[DisplayName("Дата рекомендации")]
|
||||
public DateTime Date { get; set; }
|
||||
[DisplayName("Услуга")]
|
||||
public string ServiceName { get; set; } = string.Empty;
|
||||
public int ServiceId { get; set; }
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicDataModels.Models;
|
||||
|
||||
namespace VetClinicContracts.ViewModels
|
||||
{
|
||||
public class MedicineViewModel : IMedicineModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Название медикамента")]
|
||||
public string MedicineName { get; set; } = string.Empty;
|
||||
[DisplayName("Цена медикамента")]
|
||||
public int Price { get; set; }
|
||||
[DisplayName("Фармацевт")]
|
||||
public string PharmacistFIO { get; set; } = string.Empty;
|
||||
public int PharmacistId { get; set; }
|
||||
public Dictionary<int, IAnimalModel> MedicineAnimals { get; set; } = new();
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicDataModels.Models;
|
||||
|
||||
namespace VetClinicContracts.ViewModels
|
||||
{
|
||||
public class PharmacistViewModel : IPharmacistModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("ФИО кладовщика")]
|
||||
public string PharmacistFIO { get; set; } = string.Empty;
|
||||
[DisplayName("Логин (эл. почта)")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
[DisplayName("Пароль")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VetClinicDataModels.Models;
|
||||
|
||||
namespace VetClinicContracts.ViewModels
|
||||
{
|
||||
public class ServiceViewModel : IServiceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Название услуги")]
|
||||
public string ServiceName { get; set; } = string.Empty;
|
||||
[DisplayName("Цена услуги")]
|
||||
public int Price { get; set; }
|
||||
[DisplayName("Фармацевт")]
|
||||
public string PharmacistFIO { get; set; } = string.Empty;
|
||||
public int PharmacistId { get; set; }
|
||||
public Dictionary<int, (IMedicineModel, int)> ServiceMedicines { get; set; } = new();
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicDataModels.Models
|
||||
{
|
||||
public interface IGuidanceModel : IId
|
||||
{
|
||||
string Text { get; }
|
||||
DateTime Date { get; }
|
||||
int ServiceId { get; }
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicDataModels.Models
|
||||
{
|
||||
public interface IMedicineModel : IId
|
||||
{
|
||||
string MedicineName { get; }
|
||||
int Price { get; }
|
||||
int PharmacistId { get; }
|
||||
Dictionary<int, IAnimalModel> MedicineAnimals { get; }
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicDataModels.Models
|
||||
{
|
||||
public interface IPharmacistModel : IId
|
||||
{
|
||||
string PharmacistFIO { get; }
|
||||
string Email { get; }
|
||||
string Password { get; }
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicDataModels.Models
|
||||
{
|
||||
public interface IServiceModel : IId
|
||||
{
|
||||
string ServiceName { get; }
|
||||
int Price { get; }
|
||||
int PharmacistId { get; }
|
||||
Dictionary<int, (IMedicineModel, int)> ServiceMedicines { get; }
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ namespace VetClinicDataModels.Models
|
||||
{
|
||||
int AnimalId { get; }
|
||||
string NameVaccination { get; }
|
||||
|
||||
double CostVaccination { get; }
|
||||
DateTime DateStamp { get; }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user