摘要: public int GetMonthOfQuarter(int month) { int num = month % 3; if (num == 0) { return 3; } return num; }有更好的算法欢迎各位留言拍砖 转载请注明出处 阅读全文
posted @ 2012-02-28 17:55 深海大虾 阅读(833) 评论(2) 推荐(0)
摘要: public int ConvertMonthToQuarter(int month) { double f = Convert.ToDouble(month)/3f; if (f > Convert.ToInt32(f)) { return Convert.ToInt32(f) + 1; } return Convert.ToInt32(f); }欢迎路过的各位前来拍砖留言发表更简洁性能更高的算法,我会在第一... 阅读全文
posted @ 2012-02-28 17:43 深海大虾 阅读(3800) 评论(1) 推荐(0)
摘要: 直接上代码 记录一下 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="t 阅读全文
posted @ 2012-02-16 15:35 深海大虾 阅读(22923) 评论(4) 推荐(0)
摘要: 直接上代码<uc2:ProcessHyperLink ID="ProcessHyperLink3" runat="server" Text='<%#(Eval("流程编码").ToString()+"-"+Eval("流程名称").ToString())%>' Value='<%#Eval("Id")%>' /> 阅读全文
posted @ 2012-02-15 18:02 深海大虾 阅读(695) 评论(3) 推荐(0)
摘要: 今天工作遇到4.0新增语法 不解 请教 遂知:指定参数public DataTable TodayToTable(int userId) { return userId > 0 ? V_CN_TASK_VALID_SCORING_TODAY.QueryTable(condition: " WHERE 承接者Id = " + userId) : null; }其中的condition: " WHERE 承接者Id = " + userId就是指定参数 condition是QueryTable方法的参数/// <summary> //... 阅读全文
posted @ 2012-02-13 15:17 深海大虾 阅读(560) 评论(0) 推荐(0)
摘要: 今天在项目中遇到一个情况,switch的分支在其他地方需要用来作为参数,为了维护方便抽出来写了个枚举,发现不怎么好用,自己又写了个结构 静态的只读变量,蹦出来一个错误,应出入常量值!继续改代码 把结构里的内容改成常量,编译正常了。引发思考,readonly和const有什么区别?查阅资料得知C#中有两种常量类型分别为readonly(运行时常量)与const(编译时常量),工作原理readonly为运行时常量,程序运行时进行赋值,赋值完成后便无法更改,因此也有人称其为只读变量。const为编译时常量,程序编译时将对常量值进行解析,并将所有常量引用替换为相应值。下面声明两个常量:publicst 阅读全文
posted @ 2011-12-21 22:23 深海大虾 阅读(966) 评论(1) 推荐(1)
摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script src="__JS/jquery-1.6.4.min.js" t 阅读全文
posted @ 2011-12-07 02:07 深海大虾 阅读(2795) 评论(2) 推荐(1)
摘要: 在ViewStack的生命周期中仅只会加载一次view,对于某些业务来说这样的加载方式不大合适,有没有一种办法在每次切换NavigatorContent的时候都重新加载view呢?办法是有的,直接上代码 <mx:ViewStack id="viewStack1" bottom="0" right="0" top="0" left="0" change="viewStack1_changeHandler(event)"> <s:NavigatorContent 阅读全文
posted @ 2011-12-06 03:11 深海大虾 阅读(5124) 评论(0) 推荐(0)
摘要: 检查一下引用项目和web的版本是否一致,如果web版本大于引用项目就会出现类似的状况 阅读全文
posted @ 2011-12-01 22:47 深海大虾 阅读(569) 评论(0) 推荐(1)
摘要: 今天在项目中一个页面使用System.Web.UI.ScriptManager.RegisterStartupScript(this, GetType(), "js", "alert('OK');", true);的时候发现没用,检查发现脚本没用注册到页面,check页面发现了问题,<form method="post"> 没用ruanat,更详细的信息请参看MSDN关于这个方法参数的介绍 阅读全文
posted @ 2011-12-01 19:49 深海大虾 阅读(2044) 评论(0) 推荐(0)