Пример #1
0
        public ActionResult GetAllEntities()
        {
            OperateResult or = CompanyRegisterManager.GetAll();

            if (or.status == OperateStatus.Success &&
                or.data != null)
            {
                return(Json(or.data, JsonRequestBehavior.AllowGet));
            }


            return(Json(or, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult GetEntities(Pager pager)
        {
            OperateResult or = CompanyRegisterManager.GetByPager(new QueryParam {
                pager = pager
            });

            if (or.status == OperateStatus.Success &&
                or.data != null)
            {
                return(Json(or.data, JsonRequestBehavior.AllowGet));
            }

            return(Json(or, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(Json(
                           new OperateResult
                {
                    content = "访问错误",
                },
                           JsonRequestBehavior.AllowGet
                           ));
            }

            OperateResult or = CompanyRegisterManager.Remove(id.Value);

            return(Json(or, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(Json(
                           new OperateResult
                {
                    content = "访问错误",
                },
                           JsonRequestBehavior.AllowGet
                           ));
            }

            OperateResult or = CompanyRegisterManager.GetById(id.Value);

            return(View(or.data));
        }