public IEnumerable <ProductTypeView> FindByName(string name) { return(_unitOfWork.ProductTypeRepository .GetAll() .Where(type => type.Name.Contains(name)) .Select(obj => ProductTypeMapper.ToViewEntity(obj))); }
public EditArticleTypeWindow(ProductType productType) { InitializeComponent(); this.productTypeMapper = new ProductTypeMapper(Utils.GetSqlSession()); this.productType = productType; this.productTypes = this.productTypeMapper.Select(out _); parentTypeComboBox.ItemsSource = this.productTypes; this.setProductType(this.productType); deleteButton.IsEnabled = productType != null?true: false; }
public EditProductWindow(Product product) { InitializeComponent(); this.productMapper = new ProductMapper(Utils.GetSqlSession()); this.productTypeMapper = new ProductTypeMapper(Utils.GetSqlSession()); this.productTypes = this.productTypeMapper.Select(out _); productTypeComboBox.ItemsSource = this.productTypes; this.product = product; setProduct(product); deleteButton.IsEnabled = product != null ? true : false; }
public static List <ProductType> getProductTypesTree() { List <ProductType> ptL = new ProductTypeMapper(GetSqlSession()).Select(out _); foreach (ProductType pt in ptL) { pt.subTypes = ptL.Where(child => child.id_parent_product_type == pt.id) .ToList(); } return(ptL.Where(child => child.id_parent_product_type == null).ToList());; }
public ProductTypeView GetProductTypeByID(int productTypeId) { return(ProductTypeMapper.ToViewEntity(_unitOfWork.ProductTypeRepository.GetById(productTypeId))); }
public IEnumerable <ProductTypeView> GetAllProductTypes() { return(_unitOfWork.ProductTypeRepository .GetAll() .Select(obj => ProductTypeMapper.ToViewEntity(obj))); }
public async Task <ProductType> GetByIdAsync(Guid id) { var productType = await _dbContext.ProductTypes.FindAsync(id); return(productType.IsNull() ? null : ProductTypeMapper.MapFrom(productType)); }