日期:2014-05-20  浏览次数:20822 次

几句代码看不懂
环境是mvc模式,linq

1: string JSEvent = "JumpToPage('{0}','{1}','{2}')"; 这句代码 是什么意思啊,JumpToPage是什么东西啊

2: using (Html.BeginForm("ExportData", "apparatus", FormMethod.Post, new { name = "SearchForm" }) 这里是声明一个form吧,那ExportData和apparatus是什么意思啊 ?

3: if ((!DateTime.TryParse(a.beginTime, out b)) || (!DateTime.TryParse(a.endTime, out b)))
  { }
这里!是什么意思啊,是不是当a.beginTime 不为空 或者 当 a.andTime 不为空的时候啊?

------解决方案--------------------
环境是mvc模式,linq

1: string JSEvent = "JumpToPage('{0}','{1}','{2}')"; 这句代码 是什么意思啊,JumpToPage是什么东西啊
JumpToPage应该是js的方法


2: using (Html.BeginForm("ExportData", "apparatus", FormMethod.Post, new { name = "SearchForm" }) 这里是声明一个form吧,那ExportData和apparatus是什么意思啊 ?
ExportData和apparatus是controler和 action的名字
看看BeginForm几个参数的含义

3: if ((!DateTime.TryParse(a.beginTime, out b)) || (!DateTime.TryParse(a.endTime, out b)))
{ }
这里!是什么意思啊,是不是当a.beginTime 不为空 或者 当 a.andTime 不为空的时候啊?
不就是转化为DateTime类型吗,避免抛异常就是用TryParse
------解决方案--------------------
探讨
1: string JSEvent = "JumpToPage('{0}','{1}','{2}')"; 这句代码 是什么意思啊,JumpToPage是什么东西啊

2: using (Html.BeginForm("ExportData", "apparatus", FormMethod.Post, new { name = "SearchForm" }) 这里是声明一个form吧,那ExportData和apparatus是什么意思啊 ?

3: if ((!DateTime.TryParse(a.beginTime, out b)) || (!DateTime.TryParse(a.endTime, out b)))
{ }
这里!是什么意思啊,是不是当a.beginTime 不为空 或者 当 a.andTime 不为空的时候啊?

------解决方案--------------------
http://msdn.microsoft.com/zh-cn/library/system.web.mvc.html.formextensions.beginform.aspx
------解决方案--------------------
1.我也不知道
2.选中BeginForm 按F12 或右键转到定义 看看几个参数代表什么意思
3. !表示取反
如!DateTime.TryParse(a.beginTime, out b) 表示a.beginTime 在转换成DateTime格式失败时

ps:lz你的几个问题好像和LINQ都木有关系啊
 
------解决方案--------------------
1、普通的字符串 ??,有啥用 根据上下文
2、BeginForm方法 上 不是有提示吗 ExportData 是 action ,apparatus 是 Controller
3、!非,取反 即 转换不成功, 不管空不空的
------解决方案--------------------

1.这不像个什么标准格式。。估计是个自定义的格式吧。。

2.第一个参数是HtmlHelper ,第二个参数是actionname

3.判断a.beginTime,a.endTime是不是有效的时间格式。。