public EntityBuildOfMaterial GetMaterialBySparePart(string SparePart, int ProductID) { var data = base.DataContext.BuildOfMaterials.Where(p => p.SparePartsID == SparePart && p.FK_ProductID == ProductID).Take(1); if (data.Count() == 1) { return(FactoryBuildOfMaterial.Get(data.Single())); } else { return(null); } }
public EntityBuildOfMaterial GetByBOMID(int PK_BuildOfMaterialsID) { var data = base.DataContext.BuildOfMaterials.Where(p => p.PK_BuildOfMaterialsID == PK_BuildOfMaterialsID); if (data.Count() == 1) { return(FactoryBuildOfMaterial.Get(data.Single())); } else { return(null); } }
public EntityBuildOfMaterial GetMaterialByModel(string Model) { var data = base.DataContext.BuildOfMaterials.Where(p => p.Model == Model); if (data.Count() == 1) { return(FactoryBuildOfMaterial.Get(data.Single())); } else { return(null); } }