Пример #1
0
    protected void cwxz_SelectedIndexChanged(object sender, EventArgs e)
    {
        IOpenClient         client = new DefaultOpenClient(BMEshenghuo.serverUrl, BMEshenghuo.appKey, BMEshenghuo.appSecret);
        AirLinesListRequest req    = new AirLinesListRequest();

        req.From   = qdz.SelectedValue;
        req.To     = zdz.SelectedValue;
        req.ItemId = mc.SelectedValue;
        req.Date   = txtBeginTime.Text;
        AirLinesListResponse response = client.Execute(req, BMEshenghuo.accessToken);

        if (!response.IsError)
        {
            //hxxz.DataSource = response.Airlines;
            //hxxz.DataTextField = "FlightNo" + "SeatMsg" + "SettlePrice" + "DepTime";
            //hxxz.DataValueField = "FlightNo";
            //hxxz.DataBind();
            List <Qianmi.Api.Domain.Elife.Airline> alist = response.Airlines;

            int i = 0;

            foreach (Qianmi.Api.Domain.Elife.Airline item in alist)
            {
                List <Qianmi.Api.Domain.Elife.AirSeat> ss = item.AirSeats;

                foreach (Qianmi.Api.Domain.Elife.AirSeat item1 in ss)
                {
                    if (hxxz.SelectedValue == alist[i].FlightNo.ToString() + alist[i].DepTime.ToString())
                    {
                        for (int j = 0; j < ss.Count; j++)
                        {
                            if (cwxz.SelectedValue == alist[i].AirSeats[j].SeatCode.ToString())
                            {
                                seatCode.Value          = alist[i].AirSeats[j].SeatCode;
                                airlineCode.Value       = alist[i].AirSeats[j].AirlineCode;
                                parPrice.Value          = alist[i].AirSeats[j].ParPrice.ToString();
                                seatMsg.Value           = alist[i].AirSeats[j].SeatMsg;
                                seatStatus.Value        = alist[i].AirSeats[j].SeatStatus;
                                flightNo.Value          = alist[i].FlightNo;
                                FlightCompanyName.Value = alist[i].FlightCompanyName;
                                DepTime.Value           = alist[i].DepTime;
                                ArriTime.Value          = alist[i].ArriTime;
                            }
                        }
                    }
                }
                i++;
            }

            lab.Text = parPrice.Value;
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#yc3').show();$('#yc1').show();</script>", false);
        }
    }
Пример #2
0
    protected void cyxlb_Click(object sender, EventArgs e)
    {
        IOpenClient         client = new DefaultOpenClient(BMEshenghuo.serverUrl, BMEshenghuo.appKey, BMEshenghuo.appSecret);
        AirLinesListRequest req    = new AirLinesListRequest();

        req.From   = qdz.SelectedValue;
        req.To     = zdz.SelectedValue;
        req.ItemId = mc.SelectedValue;
        req.Date   = txtBeginTime.Text;
        AirLinesListResponse response = client.Execute(req, BMEshenghuo.accessToken);

        if (!response.IsError)
        {
            //hxxz.DataSource = response.Airlines;
            //hxxz.DataTextField = "FlightNo" + "SeatMsg" + "SettlePrice" + "DepTime";
            //hxxz.DataValueField = "FlightNo";
            //hxxz.DataBind();
            if (response.Airlines == null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("010468", "没有查到机票请重新输入条件") + "');</script>", false);
                return;
            }
            List <Qianmi.Api.Domain.Elife.Airline> alist = response.Airlines;


            foreach (Qianmi.Api.Domain.Elife.Airline item in alist)
            {
                List <Qianmi.Api.Domain.Elife.AirSeat> ss = item.AirSeats;
                foreach (Qianmi.Api.Domain.Elife.AirSeat item1 in ss)
                {
                    hxxz.Items.Clear();
                    for (int j = 0; j < response.Airlines.Count; j++)
                    {
                        //hxxz.Items.Add(item.Cities[j].City.Name);
                        hxxz.Items.Insert(j, alist[j].FlightNo.ToString() + GetTran("010469", ".时间:") + alist[j].DepTime.ToString());
                        hxxz.Items[j].Value = alist[j].FlightNo.ToString() + alist[j].DepTime.ToString();
                    }
                }
            }

            //lab.Text = parPrice.Value;

            mc.Enabled           = false;
            qdz.Enabled          = false;
            zdz.Enabled          = false;
            txtBeginTime.Enabled = true;
            cyxlb.Visible        = false;
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>$('#yc3').show();$('#yc1').show();</script>", false);
        }
    }