public EquipmentTypes GetDriverEquipmentTypes() { // EquipmentTypes types = new EquipmentTypes(); DataSet ds = new DataService().FillDataset(this.mConnectionID, USP_EQUIPTYPE, TBL_EQUIPTYPE, null); if (ds.Tables[TBL_EQUIPTYPE].Rows.Count > 0) { for (int i = 0; i < ds.Tables[TBL_ENTERPRISEAGENTS].Rows.Count; i++) { types.Add(new EquipmentType(int.Parse(ds.Tables[TBL_EQUIPTYPE].Rows[i]["ID"].ToString()), ds.Tables[TBL_EQUIPTYPE].Rows[i]["Description"].ToString(), int.Parse(ds.Tables[TBL_EQUIPTYPE].Rows[i]["MPG"].ToString()))); } } return(types); }
public int GetDriverEquipmentMPG(int equipmentTypeID) { //Get MPG rating for the specified driver equipment typeID int mpg = 0; EquipmentTypes types = GetDriverEquipmentTypes(); if (types.Count > 0) { for (int i = 0; i < types.Count; i++) { if (types[i].ID == equipmentTypeID) { mpg = types[i].MPG; break; } } } return(mpg); }