/// <summary> /// This will grab all the urdf types that is known in the database /// </summary> /// <returns>A list of type of urdf in the database.</returns> public List <UrdfTypeModel> GetUrdfTypes() { List <UrdfTypeModel> list = new List <UrdfTypeModel>(); string sql = "SELECT `uid`, `name` FROM `tblUrdfType`;"; SqliteCommand cmd = _engine.conn.CreateCommand(); cmd.CommandText = sql; SqliteDataReader reader = cmd.ExecuteReader(); UrdfTypeModel item; try { while (reader.Read()) { item = new UrdfTypeModel(); item.uid = reader.GetInt32(0); item.name = reader.GetString(1); list.Add(item); } } catch (Exception ex) { Debug.WriteLine(ex.Message); } finally { reader.Close(); reader = null; cmd.Dispose(); cmd = null; } return(list); }
// TODO: Add validation code public void copy(UrdfTypeModel model) { this.uid = model.uid; this.name = model.name; }