public List <ProductViewModel> ShowProductsByCompanyandCategoryId(int companyId, int categoryId) { List <ProductViewModel> productList = new List <ProductViewModel>(); if (!companyId.Equals(null) && companyId != 0) { if (!categoryId.Equals(null) && categoryId != 0) { productList = productGateway.GetProductsByCompanyandCategoryId(companyId, categoryId); } else { productList = productGateway.GetProductsByCompany(companyId); } } else { if (!categoryId.Equals(null) && categoryId != 0) { productList = productGateway.GetProductsByCategoryId(categoryId); } else { productList.Clear(); } } return(productList); }