protected void hxxz_SelectedIndexChanged(object sender, EventArgs e) { IOpenClient client = new DefaultOpenClient(BMEshenghuo.serverUrl, BMEshenghuo.appKey, BMEshenghuo.appSecret); CoachLinesListRequest req = new CoachLinesListRequest(); req.From = qdz.SelectedValue; req.To = zdz.SelectedValue; //req.ItemId = mc.SelectedValue; req.Date = txtBeginTime.Text; CoachLinesListResponse response = client.Execute(req, BMEshenghuo.accessToken); if (!response.IsError) { List <Qianmi.Api.Domain.Elife.CoachLine> alist = response.CoachLines; int i = 0; foreach (Qianmi.Api.Domain.Elife.CoachLine item in alist) { if (hxxz.SelectedValue == alist[i].CoachNO.ToString()) { seatCode.Value = item.StationCode.ToString(); //站点编号 //airlineCode.Value = item.AirlineCode; parPrice.Value = item.TicketPrice.ToString(); //座位票面价 seatMsg.Value = item.DptStation.ToString(); //座位类型名称: 二等座, 一等座, 商务座等..汽车出发站 seatStatus.Value = item.ArrStation.ToString();; //座位号...汽车到达站 flightNo.Value = item.CoachNO.ToString(); //车次号 //FlightCompanyName.Value = item.TrainTypeName;//车次类型 DepTime.Value = item.DptDateTime.ToString(); //发车时间 //ArriTime.Value = item.EndTime;//到达时间 ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#yc11').show();$('#yc1').show();$('#yc22').show();$('#yc3').show();$('#yc4').show();</script>", false); } i++; } } }
protected void cyxlb_Click(object sender, EventArgs e) { IOpenClient client = new DefaultOpenClient(BMEshenghuo.serverUrl, BMEshenghuo.appKey, BMEshenghuo.appSecret); CoachLinesListRequest req = new CoachLinesListRequest(); req.From = qdz.SelectedValue; req.To = zdz.SelectedValue; //req.ItemId = mc.SelectedValue; req.Date = txtBeginTime.Text; CoachLinesListResponse response = client.Execute(req, BMEshenghuo.accessToken); if (!response.IsError) { //hxxz.DataSource = response.CoachLines; //hxxz.DataTextField = "DptStation" + "ArrStation" + "DptTime" + "TicketPrice" + "TicketLeft"; //hxxz.DataValueField = "CoachNO"; //hxxz.DataBind(); //lab.Text = parPrice.Value; if (response.CoachLines == null) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("010499", "没有查到车票请重新输入条件") + "');</script>", false); return; } List <Qianmi.Api.Domain.Elife.CoachLine> alist = response.CoachLines; foreach (Qianmi.Api.Domain.Elife.CoachLine item in alist) { hxxz.Items.Clear(); for (int j = 0; j < response.CoachLines.Count; j++) { //hxxz.Items.Add(item.Cities[j].City.Name); hxxz.Items.Insert(j, alist[j].DptStation.ToString() + alist[j].ArrStation.ToString() + GetTran("010469", ".时间:") + alist[j].DptTime.ToString() + GetTran("010470", ".票价:") + alist[j].TicketPrice.ToString() + GetTran("010489", ".余票:") + alist[j].TicketLeft.ToString()); hxxz.Items[j].Value = alist[j].CoachNO.ToString(); } ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#yc3').show();</script>", false); } } }