public List <ValueType> DecodeListByDb(DataTable dt, itable tableClass) { List <ValueType> infoList = new List <ValueType>(); foreach (DataRow dr in dt.Rows) { infoList.Add(tableClass.DecodeOneItemByDb(dr)); } return(infoList); }
private itable GetTableHandlerByType(enumProductType itemType) { itable result = null; switch (itemType) { case enumProductType.Adapter: case enumProductType.Extend: case enumProductType.Focus: result = dbRingMedium; break; case enumProductType.Interface: result = dbConnector; break; case enumProductType.CamLens: result = dbCamlens; break; default: break; } return(result); }
private itable GetTableHandlerByType(Type itemType) { itable result = null; if (itemType == typeof(CameraLens)) { result = dbCamlens; } else if (itemType == typeof(Connectors)) { result = dbConnector; } else if (itemType == typeof(RingMedium)) { result = dbRingMedium; } return(result); }
public bool InsertItem(ValueType info) { itable handler = this.GetTableHandlerByType(info.GetType()); return(handler.InsertOneItem(info)); }
private List <ValueType> GetDataList(string strSql, itable table) { DataSet dsConnector = SQLiteHelper.ExecuteDataSet(STR_CONNECTION, strSql, null); return(code.DecodeListByDb(dsConnector.Tables[0], table)); }
public List <ValueType> GetAllDevices(enumProductType type) { itable handler = this.GetTableHandlerByType(type); return(handler.GetAllData()); }