12 2012 档案
单例模式
摘要:一、经典模式:publicclass Singleton { private static Singleton instance;private Singleton() { }publicstatic Singleton GetInstance() { if(instance==null) { instance=new Singleton(); } return instance; } }解析如下: 1)首先,该Singleton的构造函数必须是私有的,以保证客户程序不会通过new()操作产生一个实例,达到... 阅读全文
posted @ 2012-12-29 12:43 chay 阅读(220) 评论(0) 推荐(0)
JQuery EasyUi控件值的获取与设置
摘要:1. 值的设置 dateTimeBox $('#StartDate').val(startTime); dateBox $('#StartDate').datebox('setValue', startTime); combobox $('#dept').combobox('setValue',depment);//设值 $('#dept').combobox('setText',depment);//设置文本值 Text $('#name').val(name);2 阅读全文
posted @ 2012-12-29 12:24 chay 阅读(23983) 评论(0) 推荐(0)
js转换数据库中DateTime字段类型
摘要:在程序中,从数据库中读取到的日期时间类型数据一般是这种格式:"/Date(1355109408000+0800)/" 要经过js函数处理变为格式:'2012-12-10 11:05:21'用此js函数即可搞定:functiontimeFormatter(value) {varda =newDate(parseInt(value.replace("/Date(","").replace(")/","").split("+")[0]));returnda.getF 阅读全文
posted @ 2012-12-27 17:43 chay 阅读(12036) 评论(3) 推荐(2)
js页面跳转方法
摘要:1. 在原来的窗体中直接跳转用window.location.href="你要跳转到的页面地址";2. 在新窗体中打开页面用:window.open("你要跳转到的页面");window.open('page.html', 'newwindow', 'height=100, width=400, top=0,left=0, toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no' );参数说明:page.html将在新窗体 阅读全文
posted @ 2012-12-27 17:36 chay 阅读(16799) 评论(0) 推荐(0)
数据库之间的区别
摘要:最近在做oracle兼容,原来项目是用postgresql数据库,发现有许多区别,故就想把工作中遇到过的几种数据库整理一下。在工作中,用到过的几种数据库,ms sqlserver,postgresql,oracle,现记录下来其中区别,以备以后查阅。记录不全,只是记录遇到过的,以后遇到其他再慢慢补全。一、sql语句的差别:其中sql语句基本差不多,只是有少许差别1.查询前10条数据.sqlserverselect top 10* from T where ..condition order by 某一列名;. postgresqlselect * from T where ..conditio 阅读全文
posted @ 2012-12-27 17:30 chay 阅读(1766) 评论(0) 推荐(0)