Ejemplo n.º 1
0
        /// <summary>
        /// 添加子菜单或一级菜单
        /// </summary>
        /// <param name="menu"></param>
        /// <returns></returns>
        public ActionResult AddChildOrParentMenu(Menu menu)
        {
            JsonResultData <string> resultdata = new JsonResultData <string>();

            try
            {
                int result = menuservice.AddChildOrParentMenu(menu);

                if (result == 0)
                {
                    resultdata.Code = 0;
                    resultdata.Data = "添加失败!";
                }
                else
                {
                    resultdata.Code = 1;
                    resultdata.Data = "添加成功!";
                }
            }
            catch (Exception ex)
            {
                resultdata.Msg = ex.Message;
            }
            return(Json(resultdata, JsonRequestBehavior.AllowGet));
        }