контракты клиента

This commit is contained in:
frog24 2024-04-27 17:38:22 +04:00
parent e1902ba03a
commit 2a6e1b67f3
7 changed files with 100 additions and 1 deletions

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace VetclinicDataModels.Models
{
public interface IMedPurchase: IId
public interface IDrugPurchase: IId
{
int ClientId { get; }
double Cost { get; }

View File

@ -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 ClientBindingModel: IClientModel
{
public int Id { get; set; }
public string ClientName { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VetclinicContracts.BindingModels;
using VetclinicContracts.SearchModels;
namespace VetclinicContracts.BusinessLogicsContracts
{
public interface IClientLogic
{
List<ClientViewModel>? ReadList(ClientSearchModel? model);
ClientViewModel? ReadElement(ClientSearchModel model);
bool Create(ClientBindingModel model);
bool Update(ClientBindingModel model);
bool Delete(ClientBindingModel model);
}
}

View File

@ -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.SearchModels
{
public class ClientSearchModel
{
public int? Id { get; set; }
public string? ClientName { get; set; }
public string? Email { get; set; }
public string? Password { 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 IClientStorage
{
List<ClientViewModel> GetFullList();
List<ClientViewModel> GetFiltredList(ClientSearchModel model);
ClientViewModel? GetElement(ClientSearchModel model);
ClientViewModel? Insert(ClientBindingModel model);
ClientViewModel? Update(ClientBindingModel model);
ClientViewModel? Delete(ClientBindingModel model);
}
}

View File

@ -6,4 +6,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Vetclinic\VetclinicDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -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 ClientViewModel: IClientModel
{
public int Id { get; set; }
[DisplayName("ФИО клиента")]
public string ClientName { get; set; } = string.Empty;
[DisplayName("Логин (эл. почта)")]
public string Email { get; set; } = string.Empty;
[DisplayName("Пароль")]
public string Password { get; set; } = string.Empty;
}
}