Накидал модели и интерфейсы
This commit is contained in:
parent
cff2dbca9e
commit
3f72f33cdf
@ -0,0 +1,17 @@
|
||||
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; }
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
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();
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
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();
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
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);
|
||||
MedicineSearchModel? ReadElement(MedicineSearchModel model);
|
||||
bool Create(MedicineBindingModel model);
|
||||
bool Update(MedicineBindingModel model);
|
||||
bool Delete(MedicineBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
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; }
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
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; }
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
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; }
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VetClinicContracts.StoragesContracts
|
||||
{
|
||||
internal interface IServiceStorage
|
||||
{
|
||||
}
|
||||
}
|
22
VetClinic/VetClinicContracts/ViewModels/GuidanceViewModel.cs
Normal file
22
VetClinic/VetClinicContracts/ViewModels/GuidanceViewModel.cs
Normal file
@ -0,0 +1,22 @@
|
||||
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; }
|
||||
}
|
||||
}
|
23
VetClinic/VetClinicContracts/ViewModels/MedicineViewModel.cs
Normal file
23
VetClinic/VetClinicContracts/ViewModels/MedicineViewModel.cs
Normal file
@ -0,0 +1,23 @@
|
||||
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();
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
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;
|
||||
}
|
||||
}
|
23
VetClinic/VetClinicContracts/ViewModels/ServiceViewModel.cs
Normal file
23
VetClinic/VetClinicContracts/ViewModels/ServiceViewModel.cs
Normal file
@ -0,0 +1,23 @@
|
||||
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();
|
||||
}
|
||||
}
|
15
VetClinic/VetClinicDataModels/Models/IGuidanceModel.cs
Normal file
15
VetClinic/VetClinicDataModels/Models/IGuidanceModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
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; }
|
||||
}
|
||||
}
|
16
VetClinic/VetClinicDataModels/Models/IMedicineModel.cs
Normal file
16
VetClinic/VetClinicDataModels/Models/IMedicineModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
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; }
|
||||
}
|
||||
}
|
15
VetClinic/VetClinicDataModels/Models/IPharmacistModel.cs
Normal file
15
VetClinic/VetClinicDataModels/Models/IPharmacistModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
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; }
|
||||
}
|
||||
}
|
16
VetClinic/VetClinicDataModels/Models/IServiceModel.cs
Normal file
16
VetClinic/VetClinicDataModels/Models/IServiceModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
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; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user