示例#1
0
        public ActionResult GetApproval(int id)
        {
            try
            {
                if (id < 1)
                {
                    return(Json(new Approval(), JsonRequestBehavior.AllowGet));
                }

                var querries = _approvalService.Query(b => b.TableId == id).Select().ToList();
                if (!querries.Any())
                {
                    return(Json(new Approval(), JsonRequestBehavior.AllowGet));
                }

                var query = querries[0];

                return(Json(query, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(new Approval(), JsonRequestBehavior.AllowGet));
            }
        }