Commit 922fa7d2b3c3d2288e22bf11226c3ebf00e4071b
1 parent
f8166c74
add directory
Showing
2 changed files
with
94 additions
and
1 deletions
Show diff stats
src/Maps/Controllers/BusStopController.cs
1 | +using Microsoft.AspNetCore.Mvc; | |
2 | +using System.Linq; | |
3 | +using System.Threading.Tasks; | |
4 | +using Microsoft.AspNetCore.Mvc; | |
5 | +using Microsoft.AspNetCore.Mvc.Rendering; | |
6 | +using Microsoft.EntityFrameworkCore; | |
7 | +using MapsDb; | |
8 | +using MapsDb.Interfaces; | |
9 | +using MapsDb.DataService; | |
10 | +using MapsModels.ViewModels; | |
11 | +using MapsModels.DsModels; | |
12 | +using System; | |
13 | +namespace Maps.Controllers | |
14 | +{ | |
15 | + | |
16 | + public class DirectoryController : Controller{ | |
17 | + | |
18 | + private readonly IRoadDs _roadDs; | |
19 | + private readonly ISettlementDs _settlementDs; | |
20 | + private readonly IStateCommonDs _stateCommonDs; | |
21 | + private readonly IRegionDs _regionDs; | |
22 | + private readonly ISurfaceTypeDs _surfaceTypeDs; | |
23 | + public DirectoryController( | |
24 | + IBusStopDs BusStopDs, | |
25 | + IRoadDs RoadDs, | |
26 | + ISettlementDs SettlementDs, | |
27 | + IRegionDs RegionDs, | |
28 | + IStateCommonDs StateCommonDs, | |
29 | + ISurfaceTypeDs SurfaceTypeDs | |
30 | + ){ | |
31 | + _roadDs = RoadDs; | |
32 | + _settlementDs = SettlementDs; | |
33 | + _stateCommonDs = StateCommonDs; | |
34 | + _regionDs = RegionDs; | |
35 | + _surfaceTypeDs = SurfaceTypeDs; | |
36 | + } | |
37 | + | |
38 | + public async Task<IActionResult> SurfaceTypeDs() | |
39 | + { | |
40 | + var SurfaceType = await _surfaceTypeDs.GetSelectListAsync(); | |
41 | + | |
42 | + DirectoryVm vm = new DirectoryVm | |
43 | + { | |
44 | + SurfaceTypeSelectListDsM = SurfaceType.ToList(), | |
45 | + }; | |
46 | + return Json(vm); | |
47 | + } | |
48 | + public async Task<IActionResult> SettlementDs() | |
49 | + { | |
50 | + var Settlement = await _settlementDs.GetSelectListAsync(); | |
51 | + | |
52 | + | |
53 | + DirectoryVm vm = new DirectoryVm | |
54 | + { | |
55 | + SettlementSelectListDsM = Settlement.ToList(), | |
56 | + }; | |
57 | + return Json(vm); | |
58 | + } | |
59 | + public async Task<IActionResult> RoadDs() | |
60 | + { | |
61 | + var Road = await _roadDs.GetSelectListAsync(); | |
62 | + | |
63 | + | |
64 | + DirectoryVm vm = new DirectoryVm | |
65 | + { | |
66 | + RoadSelectListDsM = Road.ToList(), | |
67 | + }; | |
68 | + return Json(vm); | |
69 | + } | |
70 | + public async Task<IActionResult> RegionDs() | |
71 | + { | |
72 | + var Region = await _regionDs.GetSelectListAsync(); | |
73 | + | |
74 | + DirectoryVm vm = new DirectoryVm | |
75 | + { | |
76 | + RegionSelectListDsM = Region.ToList() | |
77 | + }; | |
78 | + return Json(vm); | |
79 | + } | |
80 | + public async Task<IActionResult> StateCommonDs() | |
81 | + { | |
82 | + var StateCommon = await _stateCommonDs.GetSelectListAsync(); | |
83 | + | |
84 | + | |
85 | + DirectoryVm vm = new DirectoryVm | |
86 | + { | |
87 | + StateCommonSelectListDsM = StateCommon.ToList(), | |
88 | + }; | |
89 | + return Json(vm); | |
90 | + } | |
91 | + } | |
92 | + | |
93 | +} | |
0 | 94 | \ No newline at end of file | ... | ... |