view & binding
This commit is contained in:
parent
00f049749e
commit
585132da4a
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
26
TransportGuideContracts/ViewModels/RouteViewModel.cs
Normal file
26
TransportGuideContracts/ViewModels/RouteViewModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
18
TransportGuideContracts/ViewModels/StopViewModel.cs
Normal file
18
TransportGuideContracts/ViewModels/StopViewModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
20
TransportGuideContracts/ViewModels/TransportTypeViewModel.cs
Normal file
20
TransportGuideContracts/ViewModels/TransportTypeViewModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user