diff --git a/src/Maps/Controllers/BusStopController.cs b/src/Maps/Controllers/BusStopController.cs index 8c547b3..11f19e4 100755 --- a/src/Maps/Controllers/BusStopController.cs +++ b/src/Maps/Controllers/BusStopController.cs @@ -39,7 +39,7 @@ namespace Maps.Controllers ListBusStopVm vm = new ListBusStopVm { - busStopListDsM = busStops.ToList() + BusStopEditDsM = busStops.ToList() }; return Json(vm); diff --git a/src/MapsDb/DataService/BusStopDs.cs b/src/MapsDb/DataService/BusStopDs.cs index 28f8710..4fd0256 100644 --- a/src/MapsDb/DataService/BusStopDs.cs +++ b/src/MapsDb/DataService/BusStopDs.cs @@ -13,19 +13,26 @@ namespace MapsDb.DataService public BusStopDs(){ _context = new PostgresDbContext(); } - public Task> GetIndexListAsync(){ + public Task> GetIndexListAsync(){ return Task.Factory.StartNew(GetAllBusStop); } - private IList GetAllBusStop() + private IList GetAllBusStop() { - return _context.BusStop.Select(x => new BusStopListDsM + return _context.BusStop.Select(busStop => new BusStopEditDsM { - Road = x.Road.Name, - Region = x.Region.Name, - Settlement = x.Settlement.Name, - LocationLeft = x.LocationLeft, - LocationRight = x.LocationRight, - StateCommon = x.StateCommon.Value + RoadId = busStop.RoadId, + RegionId = busStop.RegionId, + SettlementId = busStop.SettlementId, + LocationLeft = busStop.LocationLeft, + LocationRight = busStop.LocationRight, + SurfaceTypeId = busStop.SurfaceTypeId, + AreaStopAvailability = busStop.AreaStopAvailability, + AreaLandAvailability = busStop.AreaLandAvailability, + PocketAvailability = busStop.PocketAvailability, + ToiletAvailability = busStop.ToiletAvailability, + YearBuild = busStop.YearBuild, + YearRepair = busStop.YearRepair, + StateCommonId = busStop.StateCommonId }).ToList(); } diff --git a/src/MapsDb/Interfaces/IBusStopDs.cs b/src/MapsDb/Interfaces/IBusStopDs.cs index 44571f5..0537e2b 100644 --- a/src/MapsDb/Interfaces/IBusStopDs.cs +++ b/src/MapsDb/Interfaces/IBusStopDs.cs @@ -6,7 +6,7 @@ namespace MapsDb.Interfaces { public interface IBusStopDs { - Task> GetIndexListAsync(); + Task> GetIndexListAsync(); Task SaveAsync(BusStopEditDsM busStop, int? id = null); Task FindOneDetailsAsync(int Id); Task DeleteAsync(int? Id); diff --git a/src/MapsModels/ViewModels/ListBusStopVm.cs b/src/MapsModels/ViewModels/ListBusStopVm.cs index 6b29be1..b027f8e 100644 --- a/src/MapsModels/ViewModels/ListBusStopVm.cs +++ b/src/MapsModels/ViewModels/ListBusStopVm.cs @@ -5,6 +5,6 @@ namespace MapsModels.ViewModels { public class ListBusStopVm { - public List busStopListDsM { get; set; } + public List BusStopEditDsM { get; set; } } } -- libgit2 0.21.4