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); }
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); }
public static JsonResult ToJson(this JsonM datas, bool suc, string msg, object o) { return(ToJson(datas, suc, msg, o, null)); }
public static JsonResult ToJson(this JsonM datas, string msg) { return(ToJson(datas, datas.Success, msg)); }
public static JsonResult ToJson(this JsonM datas) { return(ToJson(datas, datas.Success, datas.Message)); }