Beispiel #1
0
        public ResponseModel SearchItemName([FromBody] Dictionary <string, object> formData)
        {
            var response = new ResponseModel();

            try
            {
                var    page      = int.Parse(formData["page"].ToString());
                var    pageSize  = int.Parse(formData["pageSize"].ToString());
                string item_name = "";
                if (formData.Keys.Contains("item_name") && !string.IsNullOrEmpty(Convert.ToString(formData["item_name"])))
                {
                    item_name = Convert.ToString(formData["item_name"]);
                }
                long total = 0;
                var  data  = _itemBusiness.SearchItemName(page, pageSize, out total, item_name);
                response.TotalItems = total;
                response.Data       = data;
                response.Page       = page;
                response.PageSize   = pageSize;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(response);
        }