public class BisController : Controller
{
//
// GET: /Bis/ protected string GetJson(object obj)
{
IsoDateTimeConverter dtConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
//http://www.cnblogs.com/litian/p/3870975.html
return JsonConvert.SerializeObject(obj, dtConverter);
} protected new JsonResult Json(object data)
{
return new HYJosnResult { Data = data };
} }
//http://www.cnblogs.com/chongsha/archive/2013/04/14/3019990.html
public class HYJosnResult : JsonResult
{
public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if ((this.JsonRequestBehavior == JsonRequestBehavior.DenyGet) && string.Equals(context.HttpContext.Request.HttpMethod, "GET", StringComparison.OrdinalIgnoreCase))
{
throw new InvalidOperationException("");
}
HttpResponseBase response = context.HttpContext.Response;
if (!string.IsNullOrEmpty(this.ContentType))
{
response.ContentType = this.ContentType;
}
else
{
response.ContentType = "application/json";
}
if (this.ContentEncoding != null)
{
response.ContentEncoding = this.ContentEncoding;
}
if (this.Data != null)
{ IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
response.Write(JsonConvert.SerializeObject(this.Data, Newtonsoft.Json.Formatting.Indented, timeFormat)); }
}
}

bisController的更多相关文章

  1. Angular权威指南学习笔记(转)

    http://www.cnblogs.com/lzhp/p/4000741.html 第一章.        初识Angular——Angular是MVW的Js框架. 第二章.        数据绑定 ...

随机推荐

  1. 如何轻松实现iOS9多任务管理器效果(iCarousel高级教程)

    前言 iOS9系统下 为了我司APP的兼容性问题 特意把手上的iOS Mac XCode都升级到了最新的beta版 然后发现iOS9的多任务管理器风格大变 变成了下面这种样子 我忽然想起来之前的文章提 ...

  2. android 显示意图

    //显示意图 public void enter(View view) { Intent intent = new Intent();//创建一个空的意图 intent.setClassName(ge ...

  3. XCode的安装包校验伪真

    校验文件方法:shasum xxx.dmgORmd5 xxx.dmg - Xcode_7.1.dmgMD5:8962e1a843a51232b92a908b6cfb180dSHA-1:d4e9b9e8 ...

  4. WPF-拖动面板移动窗口&设置窗口状态

    在需要去掉窗口边框的情景下往往需要有拖动面板直接移动窗口和自定义按钮改变窗口状态和关闭的功能 拖动面板移动窗口 为面板控件添加MouseMove事件, 面板控件指的是用来当面板的控件,可以是grid. ...

  5. 利用Windows自带的Certutil查看文件MD5

    当遇到需要对比两个文件是否一致时,可以使用下面的命令来显示文件的MD5, 然后对比两个文件的MD5码. certutil -hashfile <filename> MD5 命令的相关帮助信 ...

  6. C# 遍历枚举类

    framework 4.0 环境下 方法 定义枚举类 判断枚举类中是否存在,若存在则输出 例子: Defined.QrCode.QrCodeType type;//枚举类 if (!Enum.TryP ...

  7. Golang 实现简单的滚动读取文本更新

    这个小程序要实现的效果,简单地说,就是将目标文件的内容读取输出到终端,并且目标文件并不是静态的,而是随时会添加新的内容.我们的目标就是一旦目标文件添加了新的内容,就把它读取出来并且显示到终端上. 实现 ...

  8. ZBrush中的Clip剪切笔刷怎么快速运用

    Clip剪切笔刷可以对模型网格进行剪切操作,也可以叫做剪切笔刷.接下来看一下Clip切割笔刷在ZBrush中是如何使用的. 查看更多内容请直接前往:http://www.zbrushcn.com/ji ...

  9. 【转载】eclipse插件安装

    原文:http://blog.csdn.net/dylan619/article/details/46839941 原来的eclipse3.7安装了太多插件后,m2e怎么也安装不成功,因此今天重新下载 ...

  10. 边工作边刷题:70天一遍leetcode: day 80

    Palindrome Permutation I/II 要点: oddCount to increase/decrease count II: chars: 先统计,再得到一半的c,相同的在一起,所以 ...