public void FastestRoute(FlightServiceReference.Airport airportFrom, FlightServiceReference.Airport airportTo, string date) { var fFast = fservice.RunDijkstraFastest(airportFrom, airportTo, date.Substring(0, 10)).ToList(); fListFast = fFast; var fTotalCost = (from f in fListFast select f.price).Sum(); lblFTotalCost.Text = fTotalCost.ToString(); var fTotalTime = (from f in fListFast select f.traveltime).Sum(); lblFTotalTime.Text = fTotalTime.ToString(); repFastest.DataSource = fListFast; repFastest.DataBind(); }
public void CheapestRoute(FlightServiceReference.Airport airportFrom, FlightServiceReference.Airport airportTo, string date) { var fPrice = fservice.RunDijkstraCheapest(airportFrom, airportTo, date.Substring(0, 10)).ToList(); fListPrice = fPrice; var cTotalCost = (from f in fListPrice select f.price).Sum(); lblCTotalCost.Text = cTotalCost.ToString(); var cTotalTime = (from f in fListPrice select f.traveltime).Sum(); lblCTotalTime.Text = cTotalTime.ToString(); repCheapest.DataSource = fListPrice; repCheapest.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TableRoute(); h2RestPass.Visible = false; var app = AppSession.BHelper; if (AppSession.BHelper.fromA != null && AppSession.BHelper.toA != null && AppSession.BHelper.date != null && AppSession.BHelper.route.Count != 0) { _fromA = AppSession.BHelper.fromA; _toA = AppSession.BHelper.toA; _date = AppSession.BHelper.date; //_noOfPass = AppSession.BHelper.noOfPass; _route = AppSession.BHelper.route; _fromA1.InnerText = AppSession.BHelper.fromA.name; _toA1.InnerText = AppSession.BHelper.toA.name; _date1.InnerText = AppSession.BHelper.date; _noOfPass1.InnerText = AppSession.BHelper.noOfPass.ToString(); //if (_noOfPass != 0) //{ // h2RestPass.Visible = true; // initializePassengers(_noOfPass); //} } else { Response.Redirect("~/Default.aspx"); } } }