view & binding

This commit is contained in:
VictoriaPresnyakova 2023-05-03 19:18:39 +04:00
parent 00f049749e
commit 585132da4a
6 changed files with 88 additions and 0 deletions

View File

@ -3,10 +3,18 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TransportGuideContracts.BindingModels;
using TransportGuideContracts.SearchModels;
using TransportGuideContracts.ViewModels;
namespace TransportGuideContracts.BusinessLogicsContracts
{
public interface IRouteLogic
{
List<RouteViewModel>? ReadList(RouteSearchModel? model);
RouteViewModel? ReadElement(RouteSearchModel model);
bool Create(RouteBindingModel model);
bool Update(RouteBindingModel model);
bool Delete(RouteBindingModel model);
}
}

View File

@ -3,10 +3,18 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TransportGuideContracts.BindingModels;
using TransportGuideContracts.SearchModels;
using TransportGuideContracts.ViewModels;
namespace TransportGuideContracts.BusinessLogicsContracts
{
public interface IStopLogic
{
List<StopViewModel>? ReadList(StopSearchModel? model);
StopViewModel? ReadElement(StopSearchModel model);
bool Create(StopBindingModel model);
bool Update(StopBindingModel model);
bool Delete(StopBindingModel model);
}
}

View File

@ -3,10 +3,18 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TransportGuideContracts.BindingModels;
using TransportGuideContracts.SearchModels;
using TransportGuideContracts.ViewModels;
namespace TransportGuideContracts.BusinessLogicsContracts
{
public interface ITransportTypeLogic
{
List<TransportTypeViewModel>? ReadList(TransportTypeSearchModel? model);
TransportTypeViewModel? ReadElement(TransportTypeSearchModel model);
bool Create(TransportTypeBindingModel model);
bool Update(TransportTypeBindingModel model);
bool Delete(TransportTypeBindingModel model);
}
}

View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TransportGuideDataModels.Models;
using System.ComponentModel;
namespace TransportGuideContracts.ViewModels
{
public class RouteViewModel : IRouteModel
{
[DisplayName("Rout's name")]
public string Name { get; set; } = string.Empty;
[DisplayName("Rout's IP")]
public string IP { get; set; } = string.Empty;
public int TransportTypeId { get; set; }
[DisplayName("TransportType")]
public string TransportTypeName { get; set; } = string.Empty;
public Dictionary<int, (IStopModel, int)> StopNRoute { get; set; } = new();
public int Id { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TransportGuideDataModels.Models;
using System.ComponentModel;
namespace TransportGuideContracts.ViewModels
{
public class StopViewModel : IStopModel
{
[DisplayName("Stop's name")]
public string Name { get; set; } = string.Empty;
public int Id { 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 TransportGuideDataModels.Models;
using System.ComponentModel;
namespace TransportGuideContracts.ViewModels
{
public class TransportTypeViewModel : ITransportTypeModel
{
[DisplayName("Ticket's Price")]
public double price { get; set; }
[DisplayName("Transport type name")]
public string name { get; set; } = string.Empty;
public int Id { get; set; }
}
}