ruder

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

2009年4月29日

摘要: public static void DeleteS(T obj) { try { Delete(obj); } catch { MakeSureExistTableAndColumn... 阅读全文
posted @ 2009-04-29 17:48 徐境 阅读(136) 评论(0) 推荐(0)

摘要: public static void StoreS(T obj) { try { Store(obj); } catch { MakeSureExistTableAndColumns(); ... 阅读全文
posted @ 2009-04-29 17:47 徐境 阅读(97) 评论(0) 推荐(0)

摘要: public static List GetS(string formatStr, params object[] objs) { try { return Get(formatStr,objs); } catch ... 阅读全文
posted @ 2009-04-29 17:47 徐境 阅读(139) 评论(0) 推荐(0)

摘要: public static List GetS(string where) { try { return Get(where); } catch { MakeSureExistTableAndC... 阅读全文
posted @ 2009-04-29 17:46 徐境 阅读(121) 评论(0) 推荐(0)

摘要: #region 确定栏位存在 text.AppendLine("if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[" + CurrentType.Name + @"]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)"); ... 阅读全文
posted @ 2009-04-29 17:43 徐境 阅读(156) 评论(0) 推荐(0)

摘要: public static void MakeSureExistTableAndColumns() { StringBuilder text = new StringBuilder(); #region 如果表不存在 text.AppendLine("if not exists (selec... 阅读全文
posted @ 2009-04-29 17:43 徐境 阅读(160) 评论(0) 推荐(0)

摘要: protected static object GetValueByType(PropertyInfo info,T obj) { if (info.PropertyType.Name == "DateTime" && Convert.ToDateTime(info.GetValue(obj, null))==DateTime.MinValue) ... 阅读全文
posted @ 2009-04-29 17:41 徐境 阅读(141) 评论(0) 推荐(0)

摘要: protected static object GetValueByType(PropertyInfo info, object obj) { object newObj = null; switch (info.PropertyType.Name.ToLower()) { ... 阅读全文
posted @ 2009-04-29 17:41 徐境 阅读(199) 评论(0) 推荐(0)

摘要: protected static string GetSqlType(PropertyInfo info) { string type = String.Empty; switch (info.PropertyType.Name.ToLower()) { ... 阅读全文
posted @ 2009-04-29 17:36 徐境 阅读(173) 评论(0) 推荐(0)

摘要: private static List _needSaveAttributes = new List(new string[]{"int","int16","int32","int64", "single", "double","datetime","bool","boolean","string" }); private static List _attribu... 阅读全文
posted @ 2009-04-29 17:35 徐境 阅读(125) 评论(0) 推荐(0)

摘要: private static Dictionary _insertSql=new Dictionary(); public static string SQL_INSERT { get { if (!_insertSql.ContainsKey(CurrentType.Name)) ... 阅读全文
posted @ 2009-04-29 17:34 徐境 阅读(136) 评论(0) 推荐(0)

摘要: private static Dictionary _selectSql=new Dictionary(); public static string SQL_SELECT { get { if (!_selectSql.ContainsKey(CurrentType.N... 阅读全文
posted @ 2009-04-29 17:33 徐境 阅读(174) 评论(0) 推荐(0)