diff --git a/Vetclinic/Vetclinic/Enums/MedPurchase.cs b/Vetclinic/Vetclinic/Enums/DoctorVisitStatus.cs similarity index 71% rename from Vetclinic/Vetclinic/Enums/MedPurchase.cs rename to Vetclinic/Vetclinic/Enums/DoctorVisitStatus.cs index 409a57e..9fdd858 100644 --- a/Vetclinic/Vetclinic/Enums/MedPurchase.cs +++ b/Vetclinic/Vetclinic/Enums/DoctorVisitStatus.cs @@ -6,12 +6,11 @@ using System.Threading.Tasks; namespace VetclinicDataModels.Enums { - public enum MedPurchase + public enum DoctorVisitStatus { Неизвестен = -1, - Принят = 0, + Забронировано = 0, Выполняется = 1, - Готов = 2, - Выдан = 3 + Закончен = 2, } } diff --git a/Vetclinic/Vetclinic/Models/IDoctorVisit.cs b/Vetclinic/Vetclinic/Models/IDoctorVisitModel.cs similarity index 50% rename from Vetclinic/Vetclinic/Models/IDoctorVisit.cs rename to Vetclinic/Vetclinic/Models/IDoctorVisitModel.cs index aff0190..38cd2b1 100644 --- a/Vetclinic/Vetclinic/Models/IDoctorVisit.cs +++ b/Vetclinic/Vetclinic/Models/IDoctorVisitModel.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using VetclinicDataModels.Enums; namespace VetclinicDataModels.Models { - public interface IDoctorVisit: IId + public interface IDoctorVisitModel: IId { - int ClientID { get; } - int Duration { get; } - DateTime DateAdmition { get; } + int ClientId { get; } + DoctorVisitStatus Status { get; } + DateTime DateVisit { get; } } } diff --git a/Vetclinic/Vetclinic/Models/IDrugPurchase.cs b/Vetclinic/Vetclinic/Models/IDrugPurchaseModel.cs similarity index 85% rename from Vetclinic/Vetclinic/Models/IDrugPurchase.cs rename to Vetclinic/Vetclinic/Models/IDrugPurchaseModel.cs index 420a32d..4b73035 100644 --- a/Vetclinic/Vetclinic/Models/IDrugPurchase.cs +++ b/Vetclinic/Vetclinic/Models/IDrugPurchaseModel.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace VetclinicDataModels.Models { - public interface IDrugPurchase: IId + public interface IDrugPurchaseModel: IId { int ClientId { get; } double Cost { get; } diff --git a/Vetclinic/VetclinicContracts/BindingModels/DoctorVisitBindingModel.cs b/Vetclinic/VetclinicContracts/BindingModels/DoctorVisitBindingModel.cs new file mode 100644 index 0000000..9498f70 --- /dev/null +++ b/Vetclinic/VetclinicContracts/BindingModels/DoctorVisitBindingModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetclinicDataModels.Enums; +using VetclinicDataModels.Models; + +namespace VetclinicContracts.BindingModels +{ + public class DoctorVisitBindingModel: IDoctorVisitModel + { + public int Id { get; set; } + public int ClientId { get; set; } + public DoctorVisitStatus Status { get; set; } + public DateTime DateVisit { get; set; } + } +} diff --git a/Vetclinic/VetclinicContracts/BusinessLogicsContracts/IDoctorVisitLogic.cs b/Vetclinic/VetclinicContracts/BusinessLogicsContracts/IDoctorVisitLogic.cs new file mode 100644 index 0000000..c85912d --- /dev/null +++ b/Vetclinic/VetclinicContracts/BusinessLogicsContracts/IDoctorVisitLogic.cs @@ -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 IDoctorVisitLogic + { + List? ReadList(DoctorVisitSearchModel? model); + DoctorVisitViewModel? ReadElement(DoctorVisitSearchModel model); + bool CreateDoctorVisit(DoctorBindingModel model); + bool BeginDoctorVisit(DoctorBindingModel model); + bool FinishDoctorVisit(DoctorBindingModel model); + } +} diff --git a/Vetclinic/VetclinicContracts/SearchModels/DoctorVisitSearchModel.cs b/Vetclinic/VetclinicContracts/SearchModels/DoctorVisitSearchModel.cs new file mode 100644 index 0000000..1859556 --- /dev/null +++ b/Vetclinic/VetclinicContracts/SearchModels/DoctorVisitSearchModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VetclinicDataModels.Enums; + +namespace VetclinicContracts.SearchModels +{ + public class DoctorVisitSearchModel + { + public int? Id { get; set; } + public int? ClientId { get; set; } + public DoctorVisitStatus? Status { get; set; } + public DateTime? DateVisit { get; set; } + } +} diff --git a/Vetclinic/VetclinicContracts/StoragesContracts/IDoctorVisitStorage.cs b/Vetclinic/VetclinicContracts/StoragesContracts/IDoctorVisitStorage.cs new file mode 100644 index 0000000..2ce89fd --- /dev/null +++ b/Vetclinic/VetclinicContracts/StoragesContracts/IDoctorVisitStorage.cs @@ -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 IDoctorVisitStorage + { + List GetFullList(); + List GetFiltredList(DoctorVisitSearchModel model); + DoctorVisitViewModel? GetElement(DoctorVisitSearchModel model); + DoctorVisitViewModel? Insert(DoctorVisitBindingModel model); + DoctorVisitViewModel? Update(DoctorVisitBindingModel model); + DoctorVisitViewModel? Delete(DoctorVisitBindingModel model); + } +} diff --git a/Vetclinic/VetclinicContracts/ViewModels/DoctorViewModel.cs b/Vetclinic/VetclinicContracts/ViewModels/DoctorViewModel.cs index 5be22e0..5a85d5e 100644 --- a/Vetclinic/VetclinicContracts/ViewModels/DoctorViewModel.cs +++ b/Vetclinic/VetclinicContracts/ViewModels/DoctorViewModel.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using VetclinicDataModels.Models; +using System.ComponentModel; namespace VetclinicContracts.ViewModels { diff --git a/Vetclinic/VetclinicContracts/ViewModels/DoctorVisitViewModel.cs b/Vetclinic/VetclinicContracts/ViewModels/DoctorVisitViewModel.cs new file mode 100644 index 0000000..6d53ef5 --- /dev/null +++ b/Vetclinic/VetclinicContracts/ViewModels/DoctorVisitViewModel.cs @@ -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.Enums; +using VetclinicDataModels.Models; + +namespace VetclinicContracts.ViewModels +{ + public class DoctorVisitViewModel: IDoctorVisitModel + { + public int Id { get; set; } + public int ClientId { get; set; } + [DisplayName("Длительность приема")] + public DoctorVisitStatus Status { get; set; } + [DisplayName("Дата приема")] + public DateTime DateVisit { get; set; } + } +}