public List <classCharter> GetAllCharterList() { List <classCharter> listCharter = null; using (DataTable table = SqlDbHelper.ExecuteSelectCommand("GetAllCharter", CommandType.StoredProcedure)) { if (table.Rows.Count > 0) { listCharter = new List <classCharter>(); foreach (DataRow row in table.Rows) { classCharter charter = new classCharter(); charter.char_Trip = Convert.ToInt32(row["CHAR_TRIP"]); charter.char_Date = DateTime.Parse(row["CHAR_DATE"].ToString()); charter.ac_Number = row["AC_NUMBER"].ToString(); charter.char_Destination = row["CHAR_DESTINATION"].ToString(); charter.char_Distance = int.Parse(row["CHAR_DISTANCE"].ToString()); charter.char_Hours_Flown = Convert.ToDouble(row["CHAR_HOURS_FLOWN"]); charter.char_Hours_Wait = Convert.ToDouble(row["CHAR_HOURS_WAIT"]); charter.char_Fuel_Gallons = Convert.ToDouble(row["CHAR_FUEL_GALLONS"]); charter.char_Oil_Qts = Convert.ToInt32(row["CHAR_OIL_QTS"]); charter.cus_Code = Convert.ToInt32(row["CUS_CODE"]); listCharter.Add(charter); } } } return(listCharter); }