示例#1
0
        public IActionResult Search(string module, int pp, int page, [FromBody] List <SearchParamModel> searchParamList)
        {
            switch (module.ToUpper())
            {
            case "COMPANY":
                var companyList = CompanyRepo.Search(searchParamList, pp, page);
                if (companyList != null)
                {
                    return(new ObjectResult(companyList));
                }
                break;

            case "CONTACT":
                var contactList = ContactRepo.Search(searchParamList, pp, page);
                if (contactList != null)
                {
                    return(new ObjectResult(contactList));
                }
                break;

            case "TRADE":
                var tradeList = TradeRepo.Search(searchParamList, pp, page);
                if (tradeList != null)
                {
                    return(new ObjectResult(tradeList));
                }
                break;

            case "PRODUCT":
                var productList = ProductRepo.Search(searchParamList, pp, page);
                if (productList != null)
                {
                    return(new ObjectResult(productList));
                }
                break;
            }
            return(StatusCode(500));
        }