public RestrictionController(ApiContext context) { var finishService = new FinishService(new FinishRepository(context)); var productService = new ProductService(finishService, new ProductRepository(context)); _service = new RestrictionService(productService, new RestrictionRepository(context)); }
public IActionResult Subscription([FromServices] RestrictionService restriction) { ViewData["regular-timeout"] = restriction.RegularTimeout; ViewData["super-timeout"] = restriction.SuperTimeout; ViewData["regular-size"] = restriction.RegularSize; ViewData["super-size"] = restriction.SuperSize; return(View()); }
public ApiController(AppDbContext context, RestrictionService restriction, IParseAsyncService parseAsync, IStringCompressService compress) { this.context = context; this.restriction = restriction; this.parseAsync = parseAsync; this.compress = compress; }
protected async void SetLocation(Location location) { Console.WriteLine($"Check this position: {location.Latitude} {location.Longitude}"); var areas = (await AreaService.GetAreasByPoint(location)).OrderByDescending(a => a.PriorityEnum); Console.WriteLine($"Got {areas.Count()} areas."); var area = areas.OrderByDescending(a => a.PriorityEnum).FirstOrDefault(); IntersectingArea = null; ParkingMachines = null; VisitorRestrictions = null; if (area != null) { if (areas.Count(a => a.PriorityEnum == area.PriorityEnum) > 1) { OverlappingAreas = true; } else { IntersectingArea = area; VisitorRestrictions = await RestrictionService.GetActiveVisitorRestrictions(area.Restrictions.Where(r => r as VisitorRestriction != null).Cast <VisitorRestriction>().ToList()); // draw parking machines on the map var parkingMachines = await ParkingMachineService.GetNearestParkingMachines(location); ParkingMachines = parkingMachines; await JSRuntime.InvokeAsync <object>("mapSetParkingMachines", parkingMachines[0].LocationObj, parkingMachines[1].LocationObj); } } Latitude = location.Latitude; Longitude = location.Longitude; StateHasChanged(); }