Commit d199d4fff06e5c0e9ab1ae3ec01e57da27cca830
1 parent
afdb105c
change details to Edit
Showing
4 changed files
with
19 additions
and
12 deletions
Show diff stats
src/Maps/Controllers/BusStopController.cs
@@ -39,7 +39,7 @@ namespace Maps.Controllers | @@ -39,7 +39,7 @@ namespace Maps.Controllers | ||
39 | 39 | ||
40 | ListBusStopVm vm = new ListBusStopVm | 40 | ListBusStopVm vm = new ListBusStopVm |
41 | { | 41 | { |
42 | - busStopListDsM = busStops.ToList() | 42 | + BusStopEditDsM = busStops.ToList() |
43 | }; | 43 | }; |
44 | 44 | ||
45 | return Json(vm); | 45 | return Json(vm); |
src/MapsDb/DataService/BusStopDs.cs
@@ -13,19 +13,26 @@ namespace MapsDb.DataService | @@ -13,19 +13,26 @@ namespace MapsDb.DataService | ||
13 | public BusStopDs(){ | 13 | public BusStopDs(){ |
14 | _context = new PostgresDbContext(); | 14 | _context = new PostgresDbContext(); |
15 | } | 15 | } |
16 | - public Task<IList<BusStopListDsM>> GetIndexListAsync(){ | 16 | + public Task<IList<BusStopEditDsM>> GetIndexListAsync(){ |
17 | return Task.Factory.StartNew(GetAllBusStop); | 17 | return Task.Factory.StartNew(GetAllBusStop); |
18 | } | 18 | } |
19 | - private IList<BusStopListDsM> GetAllBusStop() | 19 | + private IList<BusStopEditDsM> GetAllBusStop() |
20 | { | 20 | { |
21 | - return _context.BusStop.Select(x => new BusStopListDsM | 21 | + return _context.BusStop.Select(busStop => new BusStopEditDsM |
22 | { | 22 | { |
23 | - Road = x.Road.Name, | ||
24 | - Region = x.Region.Name, | ||
25 | - Settlement = x.Settlement.Name, | ||
26 | - LocationLeft = x.LocationLeft, | ||
27 | - LocationRight = x.LocationRight, | ||
28 | - StateCommon = x.StateCommon.Value | 23 | + RoadId = busStop.RoadId, |
24 | + RegionId = busStop.RegionId, | ||
25 | + SettlementId = busStop.SettlementId, | ||
26 | + LocationLeft = busStop.LocationLeft, | ||
27 | + LocationRight = busStop.LocationRight, | ||
28 | + SurfaceTypeId = busStop.SurfaceTypeId, | ||
29 | + AreaStopAvailability = busStop.AreaStopAvailability, | ||
30 | + AreaLandAvailability = busStop.AreaLandAvailability, | ||
31 | + PocketAvailability = busStop.PocketAvailability, | ||
32 | + ToiletAvailability = busStop.ToiletAvailability, | ||
33 | + YearBuild = busStop.YearBuild, | ||
34 | + YearRepair = busStop.YearRepair, | ||
35 | + StateCommonId = busStop.StateCommonId | ||
29 | }).ToList(); | 36 | }).ToList(); |
30 | } | 37 | } |
31 | 38 |
src/MapsDb/Interfaces/IBusStopDs.cs
@@ -6,7 +6,7 @@ namespace MapsDb.Interfaces | @@ -6,7 +6,7 @@ namespace MapsDb.Interfaces | ||
6 | { | 6 | { |
7 | public interface IBusStopDs | 7 | public interface IBusStopDs |
8 | { | 8 | { |
9 | - Task<IList<BusStopListDsM>> GetIndexListAsync(); | 9 | + Task<IList<BusStopEditDsM>> GetIndexListAsync(); |
10 | Task SaveAsync(BusStopEditDsM busStop, int? id = null); | 10 | Task SaveAsync(BusStopEditDsM busStop, int? id = null); |
11 | Task<BusStopDetailsDsM> FindOneDetailsAsync(int Id); | 11 | Task<BusStopDetailsDsM> FindOneDetailsAsync(int Id); |
12 | Task<int> DeleteAsync(int? Id); | 12 | Task<int> DeleteAsync(int? Id); |
src/MapsModels/ViewModels/ListBusStopVm.cs
@@ -5,6 +5,6 @@ namespace MapsModels.ViewModels | @@ -5,6 +5,6 @@ namespace MapsModels.ViewModels | ||
5 | { | 5 | { |
6 | public class ListBusStopVm | 6 | public class ListBusStopVm |
7 | { | 7 | { |
8 | - public List<BusStopListDsM> busStopListDsM { get; set; } | 8 | + public List<BusStopEditDsM> BusStopEditDsM { get; set; } |
9 | } | 9 | } |
10 | } | 10 | } |