This commit is contained in:
goblinrf 2024-04-24 16:35:40 +04:00
parent a56127ae4f
commit d57881546b
11 changed files with 126 additions and 6 deletions

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VetClinicDataModels.Models;
namespace VetClinicContracts.BindingModels
{
public class VisitBindingModel
{
public int Id { get; set; }
public int AdminId { get; set; }
public Dictionary<int, IAnimalModel> VisitAnimals { get; set; } = new();
public Dictionary<int, IServiceModel> ServiceVisits { get; set; } = new ();
public string NameVisit { get; set; } = string.Empty;
public DateTime DateVisit { get; set; }
}
}

View File

@ -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 IVisitLogic
{
List<VisitViewModel>? ReadList(VisitSearchModel? model);
VisitViewModel? ReadElement(VisitSearchModel model);
bool Create(VisitBindingModel model);
bool Update(VisitBindingModel model);
bool Delete(VisitBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VetClinicContracts.SearchModels
{
public class VisitSearchModel
{
public int? Id { get; set; }
public int? AdminId { get; set; }
public string? NameVisit { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
}

View File

@ -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 IVisitStorage
{
List<VisitViewModel> GetFullList();
List<VisitViewModel> GetFilteredList(VisitSearchModel model);
VisitViewModel? GetElement(VisitSearchModel model);
VisitViewModel? Insert(VisitBindingModel model);
VisitViewModel? Update(VaccinationBindingModel model);
VisitViewModel? Delete(VisitBindingModel model);
}
}

View File

@ -14,18 +14,22 @@ namespace VetClinicContracts.ViewModels
public int Id { get; set; }
public int ServiceId { get; set; }
public int AdminId { get; set; }
public int AnimalId { get; set; }
[DisplayName("Животное")]
public string AnimalName { get; set; } = string.Empty;
[DisplayName("Название")]
[DisplayName("Название визита")]
public string NameVisit { get; set; } = string.Empty;
[DisplayName("Админ")]
public string AdminFIO { get; set; } = string.Empty;
[DisplayName("Дата визита")]
[DisplayName("Название услуг")]
public string ServiceName { get; set; } = string.Empty;
[DisplayName("Дата визита")]
public DateTime DateVisit { get; set; }
public List<IAnimalModel> VisitAnimals { get; set; } = new();
public Dictionary<int, IAnimalModel> VisitAnimals { get; set; } = new();
public Dictionary<int, IServiceModel> ServiceVisits { get; set; } = new();
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VetClinicDataBaseImplement.Models
{
public class ServiceVisit :
{
public int Id { get; set; }
[Required]
public int ServicelId { get; set; }
[Required]
public int VisitId { get; set; }
public virtual Service Service { get; set; } = new();
public virtual Visit Visit { get; set; } = new();
}
}

View File

@ -8,10 +8,11 @@ using static System.Net.Mime.MediaTypeNames;
using static System.Runtime.InteropServices.JavaScript.JSType;
using VetClinicContracts.BindingModels;
using VetClinicContracts.ViewModels;
using VetClinicDataModels.Models;
namespace VetClinicDataBaseImplement.Models
{
public class Vaccination
public class Vaccination : IVaccinationModel
{
public int Id { get; private set; }
[Required]

View File

@ -16,5 +16,17 @@ namespace VetClinicDataBaseImplement.Models
public class Visit : IVisitModel
{
public int Id { get; private set; }
[Required]
public int AnimalId { get; private set; }
public virtual Animal Animal { get; private set; }
public virtual Service Service { get; private set; }
[Required]
public string NameVisit { get; private set; } = string.Empty;
[Required]
public double CostVaccination { get; private set; }
[Required]
public DateTime? DateStamp { get; private set; }
}
}

View File

@ -11,6 +11,6 @@ namespace VetClinicDataModels.Models
int AnimalId { get; }
string NameVaccination { get; }
double CostVaccination { get; }
DateTime DateStamp { get; }
DateTime? DateStamp { get; }
}
}

View File

@ -14,5 +14,7 @@ namespace VetClinicDataModels.Models
string NameVisit { get;}
DateTime DateVisit { get; }
Dictionary<int,IAnimalModel> VisitAnimals { get; }
Dictionary<int, IServiceModel> ServiceVisits { get; }
}
}

View File

@ -19,6 +19,7 @@
<ProjectReference Include="..\DinerDataBaseImplement\VetClinicDataBaseImplement.csproj" />
<ProjectReference Include="..\VetClinicBusinessLogic\VetClinicBusinessLogic.csproj" />
<ProjectReference Include="..\VetClinicContracts\VetClinicContracts.csproj" />
<ProjectReference Include="..\VetClinicDataBaseImplement\VetClinicDataBaseImplement.csproj" />
</ItemGroup>
</Project>