public static bool GetConfig(string fieldName, object fieldValue, out ConfChapterAssetManifest config) { DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_ChapterAssetManifest", fieldName, fieldValue); if (sqReader != null) { try { sqReader.Read(); if (sqReader.HasRows) { config = GetConfByDic(sqReader); } else { config = null; return(false); } return(true); } catch (Exception ex) { SqliteDriver.SQLiteHelper.OnError(string.Format("ChapterAssetManifest 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex)); } config = null; return(false); } config = null; return(false); }
private static ConfChapterAssetManifest GetConfByDic(DataTable reader) { int id = reader.GetInt32(0); int chapterID = reader.GetInt32(1); string AssetsName = reader.GetString(2); ConfChapterAssetManifest new_obj_ConfChapterAssetManifest = new ConfChapterAssetManifest(id, chapterID, AssetsName ); return(new_obj_ConfChapterAssetManifest); }
private static void GetArrrayList() { if (cacheArray.Count <= 0) { DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_ChapterAssetManifest"); if (sqReader != null) { while (sqReader.Read()) { ConfChapterAssetManifest _conf = GetConfByDic(sqReader); cacheArray.Add(_conf); dic[_conf.id] = _conf; } resLoaded = true; } } }
public static bool GetConfig(int id, out ConfChapterAssetManifest config) { if (dic.TryGetValue(id, out config)) { return(config != null); } if (cacheLoaded) { config = null; return(false); } DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_ChapterAssetManifest", id); if (sqReader != null) { try { sqReader.Read(); if (sqReader.HasRows) { config = GetConfByDic(sqReader); } else { dic[id] = null; config = null; return(false); } dic[id] = config; return(true); } catch (Exception ex) { SqliteDriver.SQLiteHelper.OnError(string.Format("ChapterAssetManifest 表找不到SN={0} 的数据\n{1}", id, ex)); } config = null; return(false); } else { config = null; return(false); } }