Пример #1
0
        //---------------------------------------------3.0 公用操作方法--------------------

        #region 3.1 生成 Json 格式的返回值 +ActionResult RedirectAjax(string statu, string msg, object data, string backurl)
        /// <summary>
        /// 生成 Json 格式的返回值
        /// </summary>
        /// <param name="statu"></param>
        /// <param name="msg"></param>
        /// <param name="data"></param>
        /// <param name="backurl"></param>
        /// <returns></returns>
        public ActionResult RedirectAjax(string statu, string msg, object data, string backurl)
        {
            Model.FormatModel.AjaxMsgModel ajax = new Model.FormatModel.AjaxMsgModel()
            {
                Statu   = statu,
                Msg     = msg,
                Data    = data,
                BackUrl = backurl
            };
            JsonResult res = new JsonResult();

            res.Data = ajax;
            return(res);
        }
Пример #2
0
        //---------------------------------------------3.0 公用操作方法--------------------

        #region 3.1 生成 Json 格式的返回值 +ActionResult RedirectAjax(string statu, string msg, object data, string backurl)
        /// <summary>
        /// 生成 Json 格式的返回值
        /// </summary>
        /// <param name="status"></param>
        /// <param name="msg"></param>
        /// <param name="data"></param>
        /// <param name="backurl"></param>
        /// <returns></returns>
        public ActionResult RedirectAjax(string status, string msg, object data, string backurl)
        {
            Model.FormatModel.AjaxMsgModel ajax = new Model.FormatModel.AjaxMsgModel()
            {
                Status  = status,
                Msg     = msg,
                Data    = data,
                BackUrl = backurl
            };
            JsonResult res = new JsonResult();

            res.Data = ajax;

            res.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            return(res);
        }