public ZonesController(IZoneAppService zoneAppService, IGenericAppService genericAppService, ITenantSettingsAppService tenantsettingsAppService, ITaxAppService taxAppService) { this._zoneAppService = zoneAppService; this._genericAppService = genericAppService; this._tenantsettingsAppService = tenantsettingsAppService; this._taxAppService = taxAppService; }
public StationsController( IStationAppService stationAppService, IRegionAppService regionAppService, IZoneAppService zoneAppService) { _stationAppService = stationAppService; _regionAppService = regionAppService; _zoneAppService = zoneAppService; }
public async Task <ActionResult> Zones(string zoneIds) { int? impersonatorTenantId; object value; object obj; List <ZoneListDto> zoneListDtos = new List <ZoneListDto>(); string[] strArrays = zoneIds.Split(new char[] { ',' }); for (int i = 0; i < (int)strArrays.Length; i++) { string str = strArrays[i]; IZoneAppService zoneAppService = this._zoneAppService; long num = long.Parse(str.ToString()); if (this.AbpSession.ImpersonatorTenantId.HasValue) { impersonatorTenantId = this.AbpSession.ImpersonatorTenantId; value = impersonatorTenantId.Value; } else { impersonatorTenantId = this.AbpSession.TenantId; value = impersonatorTenantId.Value; } ZoneListDto zone = await zoneAppService.GetZone(num, (long)value); if (zone != null && zone.Id.ToString().Length > 0) { zoneListDtos.Add(zone); } } strArrays = null; ITenantSettingsAppService tenantSettingsAppService = this._tenantsettingsAppService; if (this.AbpSession.ImpersonatorTenantId.HasValue) { impersonatorTenantId = this.AbpSession.ImpersonatorTenantId; obj = impersonatorTenantId.Value; } else { impersonatorTenantId = this.AbpSession.TenantId; obj = impersonatorTenantId.Value; } string tenantCoordinates = await tenantSettingsAppService.GetTenantCoordinates((long)obj); ZonesMapView zonesMapView = new ZonesMapView() { Zones = zoneListDtos, TenantCoordinates = tenantCoordinates }; return(this.View(zonesMapView)); }
public async Task <PartialViewResult> MapViewModal() { int? impersonatorTenantId; int value; object obj; IZoneAppService zoneAppService = this._zoneAppService; if (this.AbpSession.ImpersonatorTenantId.HasValue) { impersonatorTenantId = this.AbpSession.ImpersonatorTenantId; value = impersonatorTenantId.Value; } else { impersonatorTenantId = this.AbpSession.TenantId; value = impersonatorTenantId.Value; } List <ZoneListDto> zonesByTenantId = await zoneAppService.GetZonesByTenantId(value, true); if (zonesByTenantId == null || zonesByTenantId != null && zonesByTenantId.Count == 0) { zonesByTenantId = new List <ZoneListDto>(); } ITenantSettingsAppService tenantSettingsAppService = this._tenantsettingsAppService; if (this.AbpSession.ImpersonatorTenantId.HasValue) { impersonatorTenantId = this.AbpSession.ImpersonatorTenantId; obj = impersonatorTenantId.Value; } else { impersonatorTenantId = this.AbpSession.TenantId; obj = impersonatorTenantId.Value; } string tenantCoordinates = await tenantSettingsAppService.GetTenantCoordinates((long)obj); ZonesMapView zonesMapView = new ZonesMapView() { Zones = zonesByTenantId, TenantCoordinates = tenantCoordinates }; return(this.PartialView("_MapViewModal", zonesMapView)); }
public async Task <PartialViewResult> CreateOrUpdateModal(long?id = null) { int? impersonatorTenantId; object value; IZoneAppService zoneAppService = this._zoneAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = id }; CreateOrUpdateZoneModalViewModel createOrUpdateZoneModalViewModel = new CreateOrUpdateZoneModalViewModel(await zoneAppService.GetZoneForEdit(nullableIdInput)); CreateOrUpdateZoneModalViewModel tenantCoordinates = createOrUpdateZoneModalViewModel; ITenantSettingsAppService tenantSettingsAppService = this._tenantsettingsAppService; if (this.AbpSession.ImpersonatorTenantId.HasValue) { impersonatorTenantId = this.AbpSession.ImpersonatorTenantId; value = impersonatorTenantId.Value; } else { impersonatorTenantId = this.AbpSession.TenantId; value = impersonatorTenantId.Value; } tenantCoordinates.TenantCoordinates = await tenantSettingsAppService.GetTenantCoordinates((long)value); tenantCoordinates = null; List <SelectListItem> selectListItems = new List <SelectListItem>(); foreach (Tax taxesForTaxRule in await this._taxAppService.GetTaxesForTaxRules()) { List <SelectListItem> selectListItems1 = selectListItems; SelectListItem selectListItem = new SelectListItem() { Text = string.Format("{0} - {1}%", taxesForTaxRule.Name, taxesForTaxRule.Rate), Value = taxesForTaxRule.Id.ToString(), Disabled = false, Selected = false }; selectListItems1.Add(selectListItem); } this.ViewData["Taxes"] = selectListItems.AsEnumerable <SelectListItem>(); return(this.PartialView("_CreateOrUpdateModal", createOrUpdateZoneModalViewModel)); }
public async Task <PartialViewResult> CreateOrUpdateModal(long?id = null) { IEmergencyDeliveryFeeAppService emergencyDeliveryFeeAppService = this._emergencyDeliveryFeeAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = id }; CreateOrUpdateEmergencyDeliveryFeeModalViewModel createOrUpdateEmergencyDeliveryFeeModalViewModel = new CreateOrUpdateEmergencyDeliveryFeeModalViewModel(await emergencyDeliveryFeeAppService.GetEmergencyDeliveryFeeForEdit(nullableIdInput)); List <SelectListItem> selectListItems = new List <SelectListItem>(); IZoneAppService zoneAppService = this._zoneAppService; int?tenantId = this.AbpSession.TenantId; List <ZoneListDto> zonesByTenantId = await zoneAppService.GetZonesByTenantId(tenantId.Value, true); if (zonesByTenantId.Count <= 0) { this.ViewData["Zones"] = null; } else { foreach (ZoneListDto zoneListDto in zonesByTenantId) { List <SelectListItem> selectListItems1 = selectListItems; SelectListItem selectListItem = new SelectListItem() { Text = zoneListDto.Name, Value = zoneListDto.Id.ToString(), Selected = false }; selectListItems1.Add(selectListItem); } List <SelectListItem> selectListItems2 = selectListItems; SelectListItem selectListItem1 = new SelectListItem() { Text = "", Value = "", Disabled = false }; selectListItems2.Insert(0, selectListItem1); this.ViewData["Zones"] = selectListItems.AsEnumerable <SelectListItem>(); } return(this.PartialView("_CreateOrUpdateModal", createOrUpdateEmergencyDeliveryFeeModalViewModel)); }
public ZonesController(IZoneAppService zoneAppService) { _zoneAppService = zoneAppService; }
public EmergencyDeliveryFeesController(IEmergencyDeliveryFeeAppService emergencyDeliveryFeeAppService, IZoneAppService zoneAppService) { this._emergencyDeliveryFeeAppService = emergencyDeliveryFeeAppService; this._zoneAppService = zoneAppService; }
public MapController(IZoneAppService zoneAppService, ITenantSettingsAppService tenantsettingsAppService) { this._zoneAppService = zoneAppService; this._tenantsettingsAppService = tenantsettingsAppService; }