public IndoorPriceCommandHandler(IPriceAppService priceAppService, ICacheManager cacheManager, ILogger logger, IBatchAskPriceViolationAgentRepository violationAgentRepository, IBatchCarRepository batchCarRepository, ICarViolationDivisionRepository carViolationDivisionRepository, IUserSysSettingRepository settingRepository) { _priceAppService = priceAppService; _cacheManager = cacheManager; _logger = logger; _violationAgentRepository = violationAgentRepository; _batchCarRepository = batchCarRepository; _carViolationDivisionRepository = carViolationDivisionRepository; _settingRepository = settingRepository; }
public async Task <PartialViewResult> CreateOrUpdateModal(long?id = null) { IProductAppService productAppService = this._productAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = id }; CreateOrUpdateProductModalViewModel createOrUpdateProductModalViewModel = new CreateOrUpdateProductModalViewModel(await productAppService.GetProductForEdit(nullableIdInput)); if (!id.HasValue) { createOrUpdateProductModalViewModel.CanMakeActive = new bool?(false); } else { IPriceAppService priceAppService = this._priceAppService; GetProductPricesInput getProductPricesInput = new GetProductPricesInput() { ProductId = id.Value }; PagedResultOutput <ProductPriceListDto> prices = await priceAppService.GetPrices(getProductPricesInput); CreateOrUpdateProductModalViewModel nullable = createOrUpdateProductModalViewModel; IReadOnlyList <ProductPriceListDto> items = prices.Items; nullable.CanMakeActive = new bool?(( from x in items where x.IsActive select x).Any <ProductPriceListDto>()); } List <SelectListItem> selectListItems = new List <SelectListItem>(); foreach (Lookup lookupItem in (new LookupFill("QuantityTypes", -1)).LookupItems) { SelectListItem selectListItem = new SelectListItem() { Text = lookupItem.Text, Value = lookupItem.Value, Disabled = lookupItem.Disabled, Selected = lookupItem.Selected }; selectListItems.Add(selectListItem); } SelectListItem selectListItem1 = new SelectListItem() { Text = "", Value = "", Disabled = false }; selectListItems.Insert(0, selectListItem1); this.ViewData["QuantitySoldInTypes"] = selectListItems; return(this.PartialView("_CreateOrUpdateModal", createOrUpdateProductModalViewModel)); }
public ProductsController(IProductAppService productAppService, IPriceAppService priceAppService, ICustomerAppService customerAppService, ISpecificPriceAppService specificPriceAppService, ITaxRuleAppService taxRuleAppService, ISupplierAppService supplierAppService, IBinaryObjectManager binaryObjectManager, IOrganizationUnitAppService organizationUnitAppService, IRepository <ProductOption, long> productOptionRepository) { this._productAppService = productAppService; this._priceAppService = priceAppService; this._customerAppService = customerAppService; this._specificPriceAppService = specificPriceAppService; this._taxRuleAppService = taxRuleAppService; this._supplierAppService = supplierAppService; this._binaryObjectManager = binaryObjectManager; this._organizationUnitAppService = organizationUnitAppService; this._productOptionRepository = productOptionRepository; }
public async Task <PartialViewResult> CreateOrUpdatePriceModal(long productId, long?id = null) { IPriceAppService priceAppService = this._priceAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = id }; CreateOrUpdatePriceModalViewModel createOrUpdatePriceModalViewModel = new CreateOrUpdatePriceModalViewModel(await priceAppService.GetProductPriceForEdit(nullableIdInput)); Product product = await this._productAppService.GetProduct(productId); createOrUpdatePriceModalViewModel.ProductIsCurrentlyActive = product.IsActive; List <SelectListItem> selectListItems = new List <SelectListItem>(); ITaxRuleAppService taxRuleAppService = this._taxRuleAppService; int?tenantId = this.AbpSession.TenantId; ListResultDto <TaxRuleListDto> taxRulesByTenantId = await taxRuleAppService.GetTaxRulesByTenantId(tenantId.Value, true); if (!taxRulesByTenantId.Items.Any <TaxRuleListDto>()) { this.ViewData["TaxRules"] = null; } else { foreach (TaxRuleListDto item in taxRulesByTenantId.Items) { List <SelectListItem> selectListItems1 = selectListItems; SelectListItem selectListItem = new SelectListItem() { Text = item.Name, Value = item.Id.ToString(), Selected = false }; selectListItems1.Add(selectListItem); } this.ViewData["TaxRules"] = selectListItems.AsEnumerable <SelectListItem>(); } return(this.PartialView("_CreateOrUpdatePriceModal", createOrUpdatePriceModalViewModel)); }
public PriceAppServiceTest(CJSTestBase testBase) { _service = testBase.Ioc.Resolve <IPriceAppService>(); }