コード例 #1
0
 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);
     }
 }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
0
 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
     });
 }