public static Dictionary <string, int> GetAbstractionDictionary() { Logging.Log(Severity.Verbose, global::System.Reflection.MethodBase.GetCurrentMethod().Name); //TODO : Create GetAbstractionList Stored Procedure throw new NotImplementedException(); Dictionary <String, int> abstractions = new Dictionary <string, int>(); using (PLDbConnection dbConn = DataAccess.ConnectionOpen()) { using (PLDbCommand dbCmd = new PLDbCommand("GetAbstractionList", dbConn)) { using (PLDbDataReader dbDr = dbCmd.ExecuteReader()) { while (dbDr.Read()) { // TODO : Someday determine if there is a meaningful speed difference. //Globals.Attributes.Add(dbDr.GetString(1), dbDr.GetInt32(0)); abstractions.Add(dbDr["Abstraction_Name"].ToString(), (int)dbDr["Abstraction_ID"]); } } } } return(abstractions); }
public static Dictionary <string, int> GetShapeTypeDictionary() { Dictionary <String, int> shapes = new Dictionary <string, int>(); Logging.Log(Severity.Verbose, global::System.Reflection.MethodBase.GetCurrentMethod().Name); using (PLDbConnection dbConn = DataAccess.ConnectionOpen()) { using (PLDbCommand dbCmd = new PLDbCommand("GetShapeTypeList", dbConn)) { dbCmd.CommandType = CommandType.StoredProcedure; // TODO : Why do I have to pass DBNull.Value? dbCmd.AddParameter("@ABSTRACTION", SqlDbType.Int, 0).Value = DBNull.Value; using (PLDbDataReader dbDr = dbCmd.ExecuteReader()) { while (dbDr.Read()) { // TODO : Someday determine if there is a meaningful speed difference. //Globals.Attributes.Add(dbDr.GetString(1), dbDr.GetInt32(0)); shapes.Add(dbDr["ShapeType_Name"].ToString(), (int)dbDr["ShapeType_ID"]); } } } } return(shapes); }