public Expression <Func <ItemEntity, bool> > GetItemExp(BrandEnum brand, FlavorEnum flavor, PackageEnum package, ProductionType productionType, ProductionDetail productionDetailType) { Expression <Func <ItemEntity, bool> > itemWhere = c => true; if (brand != BrandEnum.Null) { var prefix = itemWhere.Compile(); itemWhere = c => prefix(c) && c.Brand == (int)brand; } if (flavor != FlavorEnum.Null) { var prefix = itemWhere.Compile(); itemWhere = c => prefix(c) && c.Flavor == (int)flavor; } if (package != PackageEnum.Null) { var prefix = itemWhere.Compile(); itemWhere = c => prefix(c) && c.Package == (int)package; } if (productionType != ProductionType.Null) { var prefix = itemWhere.Compile(); itemWhere = c => prefix(c) && c.ProductionType == (int)productionType; } if (productionDetailType != ProductionDetail.Null) { var prefix = itemWhere.Compile(); itemWhere = c => prefix(c) && c.ProductionDetailType == (int)productionDetailType; } return(itemWhere); }
/// <summary> /// Initializes a new instance of the <see cref="PrinterDefinition" /> class. /// </summary> /// <param name="Id">Id.</param> /// <param name="DisplayName">DisplayName (required).</param> /// <param name="Description">Description.</param> /// <param name="Flavor">Flavor (required).</param> /// <param name="PrinterInfo">PrinterInfo.</param> public PrinterDefinition(string Id = default(string), string DisplayName = default(string), string Description = default(string), FlavorEnum Flavor = default(FlavorEnum), PrinterDefinitionPrinterInfo PrinterInfo = default(PrinterDefinitionPrinterInfo)) { // to ensure "DisplayName" is required (not null) if (DisplayName == null) { throw new InvalidDataException("DisplayName is a required property for PrinterDefinition and cannot be null"); } else { this.DisplayName = DisplayName; } // to ensure "Flavor" is required (not null) if (Flavor == null) { throw new InvalidDataException("Flavor is a required property for PrinterDefinition and cannot be null"); } else { this.Flavor = Flavor; } this.Id = Id; this.Description = Description; this.PrinterInfo = PrinterInfo; }
/// <summary> /// 取得庫存 /// </summary> /// <returns></returns> public List <Item> GetStorage(BrandEnum brand, FlavorEnum flavor, PackageEnum package, ProductionType productionType, ProductionDetail productionDetailType) { return(_stockService.GetStorage(brand, flavor, package, productionType, productionDetailType)); }
public List <Item> GetItems(BrandEnum brand, FlavorEnum flavor, ProductionType type, ProductionDetail detail) { throw new NotImplementedException(); }