Ejemplo n.º 1
0
        public ActionResult Department(int page, int limit, department t)
        {
            var bll  = new departmentBll();
            var List = bll.SelectList()
                       .Where(i => isTrue(i.departmentName, t.departmentName))
                       .Select(i => new
            {
                i.departmentId,
                i.departmentName
            });
            var ListJson = new
            {
                code  = 0,
                msg   = "",
                count = List.Count(),
                data  = List.Skip((page - 1) * limit).Take(limit).ToList()
            };

            return(Json(ListJson, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult AddDepartment(department AddData)
        {
            var Flag = new departmentBll().Add(AddData) != 0;

            return(Content(Flag.ToString()));
        }
Ejemplo n.º 3
0
        public ActionResult SelectDepartment()
        {
            var list = new departmentBll().SelectList().Select(i => new { id = i.departmentId, name = i.departmentName });

            return(Json(list, JsonRequestBehavior.AllowGet));
        }