Beispiel #1
0
        public List <Found> GetAllFoundList()
        {
            List <Found> founds = new List <Found>();

            var dao = new FoundDao(ConfigurationManager.AppSettings["mysqlConnStr"]);

            founds = dao.GetList(string.Empty, 1, 9999);

            return(founds);
        }
Beispiel #2
0
        public ResponseEntity <string> Update(Found found)
        {
            ResponseEntity <string> response = new ResponseEntity <string>();

            var  dao     = new FoundDao(ConfigurationManager.AppSettings["mysqlConnStr"]);
            bool success = dao.Update(found);

            if (success)
            {
                response = new ResponseEntity <string>(true, "修改成功", "修改成功");
            }
            else
            {
                response = new ResponseEntity <string>(true, "修改失败", "修改失败");
            }
            return(response);
        }
Beispiel #3
0
        public FoundList GetFoundList(int pageIndex = 1, int pageSize = 10, string name = "")
        {
            List <Found>  founds = new List <Found>();
            StringBuilder sb     = new StringBuilder();

            if (!string.IsNullOrEmpty(name))
            {
                sb.Append($" and name like '%{name}%'");
            }

            var dao = new FoundDao(ConfigurationManager.AppSettings["mysqlConnStr"]);

            founds = dao.GetList(sb.ToString(), pageIndex, pageSize);
            long count = dao.GetListCount(sb.ToString());

            return(new FoundList()
            {
                count = count,
                list = founds
            });
        }