private InventoryValuationModel ContractCategoryThenLabelIVM(InventoryValuationModel iv) { return(new InventoryValuationModel() { Brand = iv.Brand, Category = iv.Category, ContractCategory = iv.ContractCategory, Each = iv.Each, ExtPrice = iv.ExtPrice, ItemId = iv.ItemId, Label = iv.Label, Name = iv.Name, Pack = iv.Pack, PackSize = iv.PackSize, Price = iv.Price, Quantity = iv.Quantity, Size = iv.Size, Grouping = (iv.ContractCategory != null) ? iv.ContractCategory : (iv.Label != null) ? iv.Label : Constants.REPORT_NULL_Placeholder // Grouping is ContractCategory if there is one, else Label if there is one, else the placeholder }); }
private InventoryValuationModel NullFieldToPlaceholder(InventoryValuationModel iv) { return(new InventoryValuationModel() { Brand = iv.Brand, Category = (iv.Category != null && iv.Category.Trim().Length > 0) ? iv.Category : Constants.REPORT_NULL_Placeholder, ContractCategory = (iv.ContractCategory != null && iv.ContractCategory.Trim().Length > 0) ? iv.ContractCategory : Constants.REPORT_NULL_Placeholder, Each = iv.Each, ExtPrice = iv.ExtPrice, ItemId = iv.ItemId, Label = (iv.Label != null && iv.Label.Trim().Length > 0) ? iv.Label : Constants.REPORT_NULL_Placeholder, Name = iv.Name, Pack = iv.Pack, PackSize = iv.PackSize, Price = iv.Price, Quantity = iv.Quantity, Size = iv.Size }); }