Beispiel #1
0
        public ResponseModel Search([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 staffid  = "";
                if (formData.Keys.Contains("staffid") && !string.IsNullOrEmpty(Convert.ToString(formData["staffid"])))
                {
                    staffid = Convert.ToString(formData["staffid"]);
                }
                long total = 0;
                var  data  = _itemBusiness.Search(page, pageSize, out total, staffid);
                response.TotalItems = total;
                response.Data       = data;
                response.Page       = page;
                response.PageSize   = pageSize;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(response);
        }