李春良

导航

2012年3月29日 #

Entity Framwork ToDataTable

摘要: publicstaticclassIQueryableExtensions{publicstaticDataTableToDataTable(thisIQueryablelist){DataTabledt=newDataTable();boolschemaIsBuild=false;PropertyInfo[]props=null;foreach(objectiteminlist){if(!schemaIsBuild){props=item.GetType().GetProperties();foreach(varpiinprops){TypepiType=pi.PropertyType;if 阅读全文

posted @ 2012-03-29 10:30 李春良 阅读(162) 评论(0) 推荐(0) 编辑

2011年6月21日 #

NHibernate中IUserType的使用

摘要: 在NHibernate的使用中有可能遇到无法自动映射的类型,这个时候就需要自己定义类型了,NHibernate提供了IUserType来自定义新的类型。这里以一个可空的时间类型为例:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingNHibernate.UserTypes;usingNHibernate.SqlTypes;usingSystem.Data.OracleClient;namespaceHHSoft.LandSupply.DataEntity.NHibernateTy 阅读全文

posted @ 2011-06-21 11:20 李春良 阅读(651) 评论(2) 推荐(0) 编辑

NHibernate one-to-many 插入

摘要: 最近刚刚接触NHibernate,遇到了one-to-many关系的实体,在更新的时候总是报 “此 OracleParameterCollection 的 Count=10 的索引 10 无效。”的错误,在网上找了好久终于找到答案,特此记录一下。两个实体类:LANDSUPPLY_PARCELLANDusingSystem;usingIesi.Collections;usingSystem.Collections.Generic;usingIesi.Collections.Generic;usingHHSoft.LandSupply.DataEntity.SystemManager;namesp 阅读全文

posted @ 2011-06-21 11:10 李春良 阅读(901) 评论(0) 推荐(0) 编辑

2010年5月31日 #

wpf中listView多列显示

摘要: 今天在项目中遇到需要分列显示数据列表,记录一下做法:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1<ListViewBorderThickness="0"Margin="10,0,0,0"Name="myNewListview"Backg... 阅读全文

posted @ 2010-05-31 13:46 李春良 阅读(3038) 评论(0) 推荐(0) 编辑

2010年5月25日 #

wpf中全局热键的实现

摘要: 在wpf中的全局键和form中有些差异,所以在这里记录一下,有用到得朋友可以试试!首先注册APi代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1[DllImport("user32.dll")]2publicstaticexternboolRe... 阅读全文

posted @ 2010-05-25 10:59 李春良 阅读(977) 评论(0) 推荐(0) 编辑

2010年2月12日 #

jquery fullcalendar

摘要: 一直想在web上实现和outlook日历一样的日历视图,最近找到了 fullcalendar,感觉挺不错的,研究了一下,把用法记录一下,以便以后查阅。基本就不说了,主要记录一下添加事件的方法的调用。Code:在这里输入 var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFu... 阅读全文

posted @ 2010-02-12 13:27 李春良 阅读(1226) 评论(1) 推荐(0) 编辑