Ejemplo n.º 1
0
        public ResponseModel get_san_pham_search([FromBody] Dictionary <string, object> formData)
        {
            var    response = new ResponseModel();
            var    page     = int.Parse(formData["page"].ToString());
            var    pageSize = int.Parse(formData["pageSize"].ToString());
            string search   = "";

            if (formData.Keys.Contains("search") && !string.IsNullOrEmpty(Convert.ToString(formData["search"])))
            {
                search = formData["search"].ToString();
                long total = 0;
                var  data  = _itemBusiness.get_san_pham_search(page, pageSize, out total, search);
                response.TotalItems = total;
                response.Data       = data;
                response.Page       = page;
                response.PageSize   = pageSize;
            }
            return(response);
        }