public async Task UpdateResellerPrice(int companyId, ResellerProductItemModel currentModel, UpdateProductItemViewModel newModel, int catalogId) { if (currentModel.ResellerPrice != newModel.ResellerPrice) { await _catalogProductItemService.ChangeResellerPrice(companyId, newModel.ProductItemId, catalogId, newModel.ResellerPrice); } }
public async Task UpdateRetailPrice(int userId, int companyId, ResellerProductItemModel currentModel, UpdateProductItemViewModel newModel, int catalogId) { var permissions = _permissionService.GetUserPermissions(userId).ToList(); if (currentModel.RetailPrice != newModel.RetailPrice) { if (permissions.Any(p => p.Name == "SetMsrpFixed") || !currentModel.FixedRetailPrice) { await _catalogProductItemService.ChangeRetailPrice(companyId, newModel.ProductItemId, catalogId, newModel.RetailPrice); } } }
public static ProductItemViewModel ToResellerCatalogProductItemViewModel( this ResellerProductItemModel resellerCatalogProductItem) { return(new ProductItemViewModel { ProductItemId = resellerCatalogProductItem.ProductItemId, Name = resellerCatalogProductItem.ProductName, FixedRetailPrice = resellerCatalogProductItem.FixedRetailPrice, RetailPrice = resellerCatalogProductItem.RetailPrice, ResellerPrice = resellerCatalogProductItem.ResellerPrice, Cost = resellerCatalogProductItem.Cost, IsAddon = resellerCatalogProductItem.IsAddon, Available = resellerCatalogProductItem.Available }); }