示例#1
0
        public static JsonResult ToJson(this JsonM datas, bool suc, string msg)
        {
            datas.Success = suc;
            datas.Message = msg;
            var json = new JsonResult();

            json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            json.Data = datas;
            return(json);
        }
示例#2
0
        public static JsonResult ToJson(this JsonM datas, bool suc, string msg, object o, string id)
        {
            datas.Success = suc;
            datas.Message = msg;

            IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();

            timeFormat.DateTimeFormat = "yyyy-MM-dd";
            datas.Obj = JsonConvert.SerializeObject(o, Newtonsoft.Json.Formatting.Indented, timeFormat);
            datas.ID  = id;
            var json = new JsonResult();

            json.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
            json.Data = datas;

            return(json);
        }
示例#3
0
 public static JsonResult ToJson(this JsonM datas, bool suc, string msg, object o)
 {
     return(ToJson(datas, suc, msg, o, null));
 }
示例#4
0
 public static JsonResult ToJson(this JsonM datas, string msg)
 {
     return(ToJson(datas, datas.Success, msg));
 }
示例#5
0
 public static JsonResult ToJson(this JsonM datas)
 {
     return(ToJson(datas, datas.Success, datas.Message));
 }