private void getDistance() { if (add_origin_comboBox.SelectedItem == null || add_dest_comboBox.SelectedItem == null) { // error code here } else { String origin = add_origin_comboBox.SelectedItem.ToString(); String dest = add_dest_comboBox.SelectedItem.ToString(); String distance = String.Format("{0:0.00}", FormDatabaseHelper.getDistance(origin, dest).ToString("0.00")); add_distanceValue_label.Text = distance; } }
public void createFlight(string origin, string dest, DateTime deptTime, DateTime arrivalTime, string planeType, double cost, int maxCapacity, int currCapacity) { this.origin = origin; this.dest = dest; this.deptTime = deptTime; this.arrivalTime = arrivalTime; this.planeType = planeType; this.cost = cost; this.maxCapacity = maxCapacity; this.currCapacity = currCapacity; this.maxCapacity = FormDatabaseHelper.getPlaneCapacity(planeType); this.distance = FormDatabaseHelper.getDistance(origin, dest); }