Exemplo n.º 1
0
        public JsonResult Add(Sys_Menu_In model)
        {
            ResponseModel response = new ResponseModel();

            try
            {
                if (model.PID == null)
                {
                    model.PID = 0;
                }
                int result = bll.Add(model);
                if (result == 1)
                {
                    response.Success = true;
                    response.Message = "添加成功";
                }
                else
                {
                    response.Success = false;
                    response.Message = "添加失败";
                }
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(Json(response, JsonRequestBehavior.DenyGet));
        }