Exemplo n.º 1
0
        public JsonResult GetDepartments(int page, int rows, string value = "")
        {
            var list  = new DepSv().GetDepartments(value);
            int total = list.Count();

            list = list.Skip((page - 1) * rows).Take(rows).ToList();
            return(Json(new { rows = list, total = total }));
        }
Exemplo n.º 2
0
        public JsonResult RemoveDep(int depId)
        {
            string result = new DepSv().RemoveDepartment(depId);

            if (!string.IsNullOrEmpty(result))
            {
                return(Json(new ResultModel()
                {
                    suc = false, msg = result
                }, "text/html"));
            }
            return(Json(new ResultModel()
            {
                suc = true, msg = "删除成功"
            }));
        }
Exemplo n.º 3
0
        public JsonResult SaveDepartment(FormCollection col)
        {
            string depName = col.Get("depName");
            string depType = col.Get("depType");
            string result  = new DepSv().SaveDepartment(depType, depName);

            if (!string.IsNullOrEmpty(result))
            {
                return(Json(new ResultModel()
                {
                    suc = false, msg = result
                }, "text/html"));
            }
            return(Json(new ResultModel()
            {
                suc = true
            }, "text/html"));
        }