Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.currentuserid.Value = Request["currentuserid"].ToString();
            hidIsShowShare2.Value    = Request.Form["hidIsShowShare"].ToString();
            Hid_travel.Value         = Request.Form["TravelType"].ToString();
            if (Hid_travel.Value == "3")
            {
                Conntitle.Style["display"] = "block";
                ConnTxt.Style["display"]   = "block";
                spBack.InnerText           = "中转时间:";
            }

            Inits();
            TBInfo();
            string os = "";
            try
            {
                int num = 0;
                PbProject.Logic.Buy.AirQurey a = new PbProject.Logic.Buy.AirQurey();
                PbProject.Model.definitionParam.SelectCityParams selectCityParams = new PbProject.Model.definitionParam.SelectCityParams();
                selectCityParams.fcity      = hiStart.Value;
                selectCityParams.mcity      = "";
                selectCityParams.tcity      = hiTarget.Value;
                selectCityParams.time       = txtReturnTime.Value;
                selectCityParams.Totime     = txtBeginTime.Value;
                selectCityParams.cairry     = ViewState["Carryer"].ToString().Split('^')[0];
                selectCityParams.TravelType = int.Parse(Hid_travel.Value);
                selectCityParams.num        = num;
                selectCityParams.mEmployees = mUser;
                selectCityParams.mCompany   = mCompany;
                selectCityParams.IsShowGX   = bool.Parse(hidIsShowShare2.Value);
                os = a.Start(selectCityParams);
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialogmsg('查询失败!请重新查询')", true);
                return;
            }
            string outstr = "";

            if (os == "")
            {
                return;
            }
            else
            {
                outstr = "<script language=\"javascript\">getAirInfo('" + os + "');</script>";

                showDiv.InnerHtml = outstr;
            }
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 查询航班数据
    /// </summary>
    private void AirQueryStr()
    {
        string os     = "";
        string osBack = "";

        try
        {
            int num = 0;

            string fromCityCode = hidFCityCode.Value.Trim();
            string fromCity     = txtFromCityCode.Value == "" ? ViewState["FCity"].ToString() : txtFromCityCode.Value;
            string toCityCode   = hidTCityCode.Value.Trim();
            string toCity       = txtToCityCode.Value == "" ? ViewState["TCity"].ToString() : txtToCityCode.Value;
            string midCityCode  = hidMCityCode.Value.Trim();
            string midCity      = txtMidCityCode.Value.Trim();


            lblSky.Text = fromCityCode + fromCity + "-" + toCityCode + toCity;

            PbProject.Logic.Buy.AirQurey a = new PbProject.Logic.Buy.AirQurey();
            //PiaoBao.BLLLogic.Interface.AirQurey a = new PiaoBao.BLLLogic.Interface.AirQurey();

            //行程类型
            int travelType = int.Parse(Hid_travel.Value);
            if (travelType == 2)
            {
                //往返
                travelType = 3;
            }
            else if (travelType == 3)
            {
                //联程
                travelType = 4;
                //string mcode = midCityCode;
                //midCityCode = toCityCode;
                //toCityCode = mcode;
            }
            string begintime = DateTime.Now.ToString("mm:ss:fff");
            PbProject.Model.definitionParam.SelectCityParams selectCityParams = new PbProject.Model.definitionParam.SelectCityParams();
            selectCityParams.fcity      = fromCityCode;
            selectCityParams.mcity      = midCityCode;
            selectCityParams.tcity      = toCityCode;
            selectCityParams.time       = txtFromDate.Value;
            selectCityParams.Totime     = txtReturnDate.Value;
            selectCityParams.cairry     = ViewState["Carrier"].ToString();
            selectCityParams.TravelType = travelType;
            selectCityParams.num        = num;
            selectCityParams.mEmployees = mUser;
            selectCityParams.mCompany   = mCompany;
            selectCityParams.IsShowGX   = cbIsShowShare.Checked;//true 不显示,false 显示

            //PiaoBao.BLLLogic.Interface.Statistics statistics = new PiaoBao.BLLLogic.Interface.Statistics();
            //statistics.AddStatisticsData(mCompany, mUser, 1);

            //os = a.Start(fromCityCode, midCityCode, toCityCode, txtFromDate.Value, txtReturnDate.Value, ViewState["Carrier"].ToString(), 1, travelType, ref num, mUser, mCompany, cbIsShowShare.Checked);
            if (travelType == 4)
            {
                selectCityParams.fcity = fromCityCode;
                selectCityParams.tcity = midCityCode;
            }
            os = a.Start(selectCityParams);
            if (travelType == 3 || travelType == 4)//往返联成的情况需要读取两次IBE数据
            {
                if (travelType == 3)
                {
                    selectCityParams.fcity = toCityCode;
                    selectCityParams.tcity = fromCityCode;
                }
                if (travelType == 4)
                {
                    selectCityParams.fcity = midCityCode;
                    selectCityParams.tcity = toCityCode;
                }

                selectCityParams.time = txtReturnDate.Value;
                PbProject.Logic.Buy.AirQurey aa = new PbProject.Logic.Buy.AirQurey();
                osBack = aa.Start(selectCityParams);
            }
            //用于记录 处理航班查询的时间
            //OnErrorNew(0, "查询返回数据长度:" + os.Length + ",处理总共用时:" + begintime + "-" + DateTime.Now.ToString("mm:ss:fff"), "AirQueryStr 查询航班");

            //os = tif.OutString(mCompany, tra, int.Parse(ViewState["tratype"].ToString()), ref num, hiTarget.Value);
            lblnumt.Text = selectCityParams.num.ToString();
            DateBind();
            //ScriptManager.RegisterStartupScript(this, GetType(), "", "showts2(" + weeknum + ")", true);
            string script     = "";
            string scriptBack = "";
            if (os == "")
            {
                script = "<script language=\"javascript\">flyType('" + Hid_travel.Value + "');</script>";
            }
            else
            {
                if (travelType == 1)
                {
                    script = "<script language=\"javascript\">flyType('" + Hid_travel.Value + "');getAirInfo('','showAirInfo');</script>";
                }
                if ((travelType == 3 || travelType == 4) && osBack != "")
                {
                    script     = "<script language=\"javascript\">flyType('" + Hid_travel.Value + "');getAirInfoBack('','showAirInfo');</script>";
                    scriptBack = "<script language=\"javascript\">flyType('" + Hid_travel.Value + "');getAirInfoBack('','showAirInfoBack');</script>";
                }
            }
            this.h31.Style["display"] = "block";
            this.h32.Style["display"] = "none";
            oneWayJson            = os;
            connAndReturnJson     = osBack;
            showDiv.InnerHtml     = script;
            showDivBack.InnerHtml = scriptBack;
        }
        catch (Exception ex)
        {
            //OnErrorNew(0, ex.ToString(), "AirQueryStr 查询航班");
            ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), ";showdialogmsg('查询失败!请重新查询')", true);
        }
    }
Esempio n. 3
0
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        ViewState["ReturnTime"] = txtReturnTime.Value;
        CheckUrl();
        TBInfo();
        //txtBeginTime.Text = ViewState["Time"].ToString().Split('=')[0];
        if (txtStart.Value.Trim() == "" || txtStart.Value.Trim() == "中文/拼音")
        {
            ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "showdialogmsg('请输入出发城市!');", true);
            return;
        }
        if (txtTarget.Value.Trim() == "" || txtTarget.Value.Trim() == "中文/拼音")
        {
            ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "showdialogmsg('请输入抵达城市!');", true);
            return;
        }
        if (txtStart.Value.Trim() == txtTarget.Value.Trim())
        {
            ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "showdialogmsg('抵达城市不能和出发城市一致!');", true);
            return;
        }
        if (txtBeginTime.Value.Trim() == "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "showdialogmsg('请输入出发时间!');", true);
            return;
        }
        if (DateTime.Parse(txtBeginTime.Value.Trim()) < DateTime.Today)
        {
            ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "showdialogmsg('出发时间必须大于今天!');", true);
            return;
        }
        if (DateTime.Parse(txtBeginTime.Value.Trim()) <= DateTime.Parse(txtReturnTime.Value.Trim()))
        {
            ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "showdialogmsg('出发时间必须大于返回或中转时间!');", true);
            return;
        }
        //if (DateTime.Parse(ViewState["Time"].ToString().Split('=')[0]) >= DateTime.Parse(txtReturnTime.Value.Trim()))
        //{
        //    ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "showdialogmsg('往返时间必须大于出发时间!');", true);
        //    return;
        //}
        //AirQuery aq = new AirQuery();
        //PiaoBao.BLLLogic.Interface.TestInterface tif = PiaoBao.BLLLogic.Factory_Air.CreateTestInterface();
        //string tra = "";
        string os = "";

        try
        {
            int num = 0;
            PbProject.Logic.Buy.AirQurey a = new PbProject.Logic.Buy.AirQurey();
            PbProject.Model.definitionParam.SelectCityParams selectCityParams = new PbProject.Model.definitionParam.SelectCityParams();
            selectCityParams.fcity      = hiStart.Value;
            selectCityParams.mcity      = "";
            selectCityParams.tcity      = hiTarget.Value;
            selectCityParams.time       = txtReturnTime.Value;
            selectCityParams.Totime     = txtBeginTime.Value;
            selectCityParams.cairry     = ViewState["Carryer"].ToString().Split('^')[0];
            selectCityParams.TravelType = int.Parse(Hid_travel.Value);
            selectCityParams.num        = num;
            selectCityParams.mEmployees = mUser;
            selectCityParams.mCompany   = mCompany;
            selectCityParams.IsShowGX   = bool.Parse(hidIsShowShare2.Value);
            os = a.Start(selectCityParams);


            //PiaoBao.BLLLogic.Interface.AirQurey a = new PiaoBao.BLLLogic.Interface.AirQurey();
            //os = a.Start(hiStart.Value, "", hiTarget.Value, txtReturnTime.Value, txtBeginTime.Value, ViewState["Carryer"].ToString().Split('^')[0], 2, 3, ref num, mUser, mCompany, bool.Parse(hidIsShowShare2.Value));
            //tra = aq.GetQueryData(hiStart.Value, hiTarget.Value, txtReturnTime.Text, ViewState["Carryer"].ToString().Split('^')[0], mUser);
            //tra = PiaoBao.BLLLogic.Factory_Air.CreateResolve().ResolveStr(tra, txtReturnTime.Text, hiStart.Value + hiTarget.Value, 1, ViewState["Carryer"].ToString().Split('^')[0]);
            //os = tif.OutString(mCompany, tra, 3, ref num, "");
        }
        catch
        {
            ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialogmsg('查询失败!请重新查询')", true);
            return;
        }
        string outstr = "";

        if (os == "")
        {
            return;
        }
        else
        {
            outstr            = "<script language=\"javascript\">getAirInfo('" + os + "');</script>";
            showDiv.InnerHtml = outstr;
        }
    }