private bool GetNormalValue(string type)
        {
            VoyageType voyage = VoyageType.OneWay;
            LimitType  DerpartrueFilghtType = LimitType.None;

            if (radYiXia.Checked)
            {
                DerpartrueFilghtType = LimitType.Include;
            }
            if (radBuXian.Checked)
            {
                DerpartrueFilghtType = LimitType.None;
            }
            if (radBuYiXia.Checked)
            {
                DerpartrueFilghtType = LimitType.Exclude;
            }

            LimitType RetrurnFilghtType = LimitType.None;

            if (radReturnYiXia.Checked)
            {
                RetrurnFilghtType = LimitType.Include;
            }
            if (radReturnBuXian.Checked)
            {
                RetrurnFilghtType = LimitType.None;
            }
            if (radReturnBuYiXia.Checked)
            {
                RetrurnFilghtType = LimitType.Exclude;
            }
            string RetrurnFilght = txtReturnFilght.Text;

            string weekStr = "";

            if (mon.Checked)
            {
                weekStr += "1,";
            }
            if (tue.Checked)
            {
                weekStr += "2,";
            }
            if (wed.Checked)
            {
                weekStr += "3,";
            }
            if (thur.Checked)
            {
                weekStr += "4,";
            }
            if (fri.Checked)
            {
                weekStr += "5,";
            }
            if (sat.Checked)
            {
                weekStr += "6,";
            }
            if (sun.Checked)
            {
                weekStr += "7,";
            }
            if (weekStr != "")
            {
                weekStr = weekStr.Substring(0, weekStr.Length - 1);
            }

            try
            {
                if (type == "Update")
                {
                    var bargains = PolicyManageService.GetBargainPolicy(Guid.Parse(Request.QueryString["Id"]));
                    var bargain  = new BargainPolicy
                    {
                        OfficeCode    = dropOffice.SelectedItem == null ? "" : hidOfficeNo.Value,
                        ImpowerOffice = dropOffice.SelectedItem == null ? false : Convert.ToBoolean(dropOffice.SelectedValue),
                        IsInternal    = neibuTh.Visible,
                        IsPeer        = tong.Visible,
                        CustomCode    = ddlCustomCode.Visible ? ddlCustomCode.SelectedValue.Trim() : lblCustomerCode.Text,
                        Airline       = lblAirline.Text,
                        Transit       = "",
                        //DepartureDatesFilter = "",
                        //DepartureDatesFilterType = DateMode.Date,
                        Arrival                    = txtArrivalAirports.AirportsCode.Join("/"),
                        AutoAudit                  = chkAuto.Checked,
                        ChangePNR                  = chkChangePNR.Checked,
                        Departure                  = txtDepartureAirports.AirportsCode.Join("/"),
                        DepartureDateEnd           = DateTime.Parse(txtDepartrueEnd.Text),
                        DepartureWeekFilter        = weekStr,
                        DepartureDateFilter        = txtPaiChu.Text,
                        DepartureDateStart         = DateTime.Parse(txtDepartrueStart.Text),
                        DepartureFlightsFilter     = DerpartrueFilghtType == LimitType.None ? "" : txtDepartrueFilght.Text,
                        DepartureFlightsFilterType = DerpartrueFilghtType,
                        ReturnFlightsFilterType    = RetrurnFilghtType,
                        ReturnFlightsFilter        = RetrurnFilghtType == LimitType.None ? "" : RetrurnFilght,
                        Remark                = txtRemark.Text.Replace("\r", "").Replace("\n", ""),
                        ExceptAirways         = txtOutWithFilght.Text,
                        DrawerCondition       = txtDrawerCondition.Text.Replace("\r", "").Replace("\n", ""),
                        StartPrintDate        = DateTime.Parse(txtProvideDate.Text),
                        SubordinateCommission = decimal.Parse(txtSubordinateCommission.Text) / 100,
                        ProfessionCommission  = tong.Visible ? decimal.Parse(txtProfessionCommission.Text) / 100 : -1M,
                        InternalCommission    = neibuTh.Visible ? decimal.Parse(txtInternalCommission.Text) / 100 : -1M,
                        ChangeRegulation      = selChangeRegulation.Text,
                        EndorseRegulation     = selEndorseRegulation.Text,
                        RefundRegulation      = selRefundRegulation.Text,
                        InvalidRegulation     = selInvalidRegulation.Text,
                        TicketType            = chkTicket.Text == "B2B" ? TicketType.B2B : TicketType.BSP,
                        Berths                = hidBunks.Value,
                        //Price = discount.Visible ? (
                        //    selPrice.SelectedIndex == 0
                        //        ? decimal.Parse(txtPrice.Text == "" ? "-1" : txtPrice.Text)
                        //        : decimal.Parse(txtDiscount.Text == "" ? "-1" : txtDiscount.Text) / 100) : -1,
                        PriceType          = discount.Visible && selPrice.Visible ? (PriceType)(int.Parse(selPrice.Value)) : PriceType.Price,
                        BeforehandDays     = txtTiQianDays.Text == "" ? (short)0 : short.Parse(txtTiQianDays.Text),
                        MostBeforehandDays = txtMostTiQianDays.Text == "" ? (short)-1 : short.Parse(txtMostTiQianDays.Text),
                        Creator            = this.CurrentUser.UserName,
                        CreateTime         = bargains.CreateTime,
                        Suspended          = bargains.Suspended,
                        AuditTime          = bargains.AuditTime,
                        Audited            = bargains.Audited,
                        Freezed            = bargains.Freezed,
                        Owner               = bargains.Owner,
                        MultiSuitReduce     = chkddlc.Checked,
                        PrintBeforeTwoHours = chkPrintBeforeTwoHours.Checked,
                        Id = Guid.Parse(Request.QueryString["Id"])
                    };
                    if (titlePolicy.InnerText.Trim() == "单程")
                    {
                        bargain.Departure  = txtDepartureAirports.AirportsCode.Join("/");
                        bargain.Arrival    = txtArrivalAirports.AirportsCode.Join("/");
                        bargain.VoyageType = VoyageType.OneWay;
                        bargain.TravelDays = 0;
                        bargain.Price      = selPrice.SelectedIndex == 0 ? decimal.Parse(txtPrice.Text == "" ? "-1" : txtPrice.Text) : (selPrice.SelectedIndex == 1 ? decimal.Parse(txtDiscount.Text == "" ? "-100" : txtDiscount.Text) / 100 : -1);
                    }
                    else if (titlePolicy.InnerText.Trim() == "往返")
                    {
                        if (hidShifa.Value == "" || hidShifa.Value == "2")
                        {
                            bargain.Departure = txtShifaAirports.Code;
                            bargain.Arrival   = txtZhongzhuanAirports.AirportsCode.Join("/");
                        }
                        else
                        {
                            bargain.Departure = txtZhongzhuanAirports.AirportsCode.Join("/");
                            bargain.Arrival   = txtShifaAirports.Code;
                        }
                        bargain.VoyageType = VoyageType.RoundTrip;
                        bargain.TravelDays = short.Parse(txtChuxing.Text == "" ? "0" : txtChuxing.Text);
                        bargain.Price      = selPrice.SelectedIndex == 0 ? decimal.Parse(txtPrice.Text == "" ? "-1" : txtPrice.Text) : -1;
                    }
                    else if (titlePolicy.InnerText.Trim() == "中转联程")
                    {
                        bargain.Departure  = txtDepartureAirports.AirportsCode.Join("/");
                        bargain.Transit    = txtArrivalAirports.AirportsCode.Join("/");
                        bargain.Arrival    = txtZhongzhuanAirports.AirportsCode.Join("/");
                        bargain.VoyageType = VoyageType.TransitWay;
                        bargain.TravelDays = 0;
                        bargain.Price      = -1;
                        bargain.PriceType  = PriceType.Commission;
                    }
                    if (bargain.Departure.Trim() == "")
                    {
                        RegisterScript("alert('出发地不能为空,请选择至少一个城市作为出发地!');");
                        return(false);
                    }
                    if (bargain.VoyageType == VoyageType.TransitWay && bargain.Transit.Trim() == "")
                    {
                        RegisterScript("alert('中转地不能为空,请选择至少一个城市作为出发地!');");
                        return(false);
                    }
                    if (bargain.Arrival.Trim() == "")
                    {
                        RegisterScript("alert('到达地不能为空,请选择至少一个城市作为出发地!');");
                        return(false);
                    }
                    PolicyManageService.UpdateBargainPolicy(bargain, this.CurrentUser.UserName);
                }
                if (type == "Copy")
                {
                    var bargainInfo = new BargainPolicyReleaseInfo
                    {
                        BasicInfo = new BargainPolicyBasicInfo
                        {
                            OfficeCode    = dropOffice.SelectedItem == null ? "" : hidOfficeNo.Value,
                            ImpowerOffice = dropOffice.SelectedItem == null ? false : Convert.ToBoolean(dropOffice.SelectedValue),
                            IsInternal    = neibuTh.Visible,
                            IsPeer        = tong.Visible,
                            CustomCode    = ddlCustomCode.Visible ? ddlCustomCode.SelectedValue.Trim() : lblCustomerCode.Text,
                            Airline       = ddlAirline.SelectedValue,
                            Arrival       = txtArrivalAirports.AirportsCode.Join("/"),
                            Departure     = txtDepartureAirports.AirportsCode.Join("/"),
                            //DepartureDatesFilter = "",
                            Transit = "",
                            //DepartureDatesFilterType = DateMode.Date,
                            DepartureFlightsFilter     = DerpartrueFilghtType == LimitType.None ? "" : txtDepartrueFilght.Text,
                            DepartureFlightsFilterType = DerpartrueFilghtType,
                            ReturnFlightsFilter        = RetrurnFilghtType == LimitType.None ? "" : RetrurnFilght,
                            ReturnFlightsFilterType    = RetrurnFilghtType,
                            Remark            = txtRemark.Text.Replace("\r", "").Replace("\n", ""),
                            ExceptAirways     = txtOutWithFilght.Text,
                            DrawerCondition   = txtDrawerCondition.Text.Replace("\r", "").Replace("\n", ""),
                            ChangeRegulation  = selChangeRegulation.Text,
                            EndorseRegulation = selEndorseRegulation.Text,
                            RefundRegulation  = selRefundRegulation.Text,
                            InvalidRegulation = selInvalidRegulation.Text,
                            VoyageType        = voyage,
                            Owner             = this.CurrentUser.Owner
                        }
                    };
                    if (titlePolicy.InnerText.Trim() == "单程")
                    {
                        bargainInfo.BasicInfo.Departure  = txtDepartureAirports.AirportsCode.Join("/");
                        bargainInfo.BasicInfo.Arrival    = txtArrivalAirports.AirportsCode.Join("/");
                        bargainInfo.BasicInfo.VoyageType = VoyageType.OneWay;
                    }
                    else if (titlePolicy.InnerText.Trim() == "往返")
                    {
                        if (hidShifa.Value == "" || hidShifa.Value == "2")
                        {
                            bargainInfo.BasicInfo.Departure = txtShifaAirports.Code;
                            bargainInfo.BasicInfo.Arrival   = txtZhongzhuanAirports.AirportsCode.Join("/");
                        }
                        else
                        {
                            bargainInfo.BasicInfo.Departure = txtZhongzhuanAirports.AirportsCode.Join("/");
                            bargainInfo.BasicInfo.Arrival   = txtShifaAirports.Code;
                        }
                        bargainInfo.BasicInfo.VoyageType = VoyageType.RoundTrip;
                    }
                    else if (titlePolicy.InnerText.Trim() == "中转联程")
                    {
                        bargainInfo.BasicInfo.Departure  = txtDepartureAirports.AirportsCode.Join("/");
                        bargainInfo.BasicInfo.Transit    = txtArrivalAirports.AirportsCode.Join("/");
                        bargainInfo.BasicInfo.Arrival    = txtZhongzhuanAirports.AirportsCode.Join("/");
                        bargainInfo.BasicInfo.VoyageType = VoyageType.TransitWay;
                    }
                    var list = new List <BargainPolicyRebateInfo>
                    {
                        new BargainPolicyRebateInfo
                        {
                            BeforehandDays        = txtTiQianDays.Text == "" ? (short)0 : short.Parse(txtTiQianDays.Text),
                            TravelDays            = txtChuxing.Text == "" ? (short)0 : short.Parse(txtChuxing.Text),
                            AutoAudit             = chkAuto.Checked,
                            ChangePNR             = chkChangePNR.Checked,
                            DepartureDateEnd      = DateTime.Parse(txtDepartrueEnd.Text),
                            DepartureDateStart    = DateTime.Parse(txtDepartrueStart.Text),
                            StartPrintDate        = DateTime.Parse(txtProvideDate.Text),
                            SubordinateCommission = decimal.Parse(txtSubordinateCommission.Text),
                            ProfessionCommission  = tong.Visible ?  decimal.Parse(txtProfessionCommission.Text):-1M,
                            InternalCommission    = neibuTh.Visible ? decimal.Parse(txtInternalCommission.Text): -1M,
                            TicketType            = chkTicket.Text == "B2B" ? TicketType.B2B : TicketType.BSP,
                            Berths = hidBunks.Value,
                            DepartureDateFilter = txtPaiChu.Text,
                            DepartureWeekFilter = weekStr,
                            MultiSuitReduce     = chkddlc.Checked,
                            PrintBeforeTwoHours = chkPrintBeforeTwoHours.Checked,
                            MostBeforehandDays  = txtMostTiQianDays.Text == "" ? (short)-1 : short.Parse(txtMostTiQianDays.Text),
                            PriceType           = discount.Visible && selPrice.Visible ? (PriceType)(int.Parse(selPrice.Value)) : PriceType.Price,
                            Price = discount.Visible ? (selPrice.SelectedIndex == 0 ? decimal.Parse(txtPrice.Text == "" ? "-1" : txtPrice.Text) : (selPrice.SelectedIndex == 1 ? decimal.Parse(txtDiscount.Text == "" ? "-100" : txtDiscount.Text): -1)) : -1
                        }
                    };
                    bargainInfo.Rebates = list;
                    if (titlePolicy.InnerText.Trim() == "中转联程")
                    {
                        bargainInfo.Rebates[0].TravelDays = 0;
                        bargainInfo.Rebates[0].Price      = -1;
                        bargainInfo.Rebates[0].PriceType  = PriceType.Commission;
                    }
                    if (bargainInfo.BasicInfo.Departure.Trim() == "")
                    {
                        RegisterScript("alert('出发地不能为空,请选择至少一个城市作为出发地!');");
                        return(false);
                    }
                    if (bargainInfo.BasicInfo.VoyageType == VoyageType.TransitWay && bargainInfo.BasicInfo.Transit.Trim() == "")
                    {
                        RegisterScript("alert('中转地不能为空,请选择至少一个城市作为出发地!');");
                        return(false);
                    }
                    if (bargainInfo.BasicInfo.Arrival.Trim() == "")
                    {
                        RegisterScript("alert('到达地不能为空,请选择至少一个城市作为出发地!');");
                        return(false);
                    }
                    PolicyManageService.ReleaseBargainPolicies(bargainInfo, this.CurrentUser.UserName);
                }
                if (Request.QueryString["Check"] == "view")
                {
                    RegisterScript(
                        type == "Update"
                            ? "alert('修改成功');window.location.href='./low_price_policy_view.aspx'"
                            : "alert('复制成功');window.location.href='./low_price_policy_view.aspx'", true);
                }

                else
                {
                    RegisterScript(
                        type == "Update"
                            ? "alert('修改成功');window.location.href='./low_price_policy_manage.aspx'"
                            : "alert('复制成功');window.location.href='./low_price_policy_manage.aspx'", true);
                }
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex, type == "Update" ? "修改特价政策" : "复制特价政策");
            }
            return(true);
        }
Example #2
0
        private void InitlblData()
        {
            BargainPolicy Bargain = PolicyManageService.GetBargainPolicy(Guid.Parse(Request.QueryString["id"].ToString()));

            if (Bargain != null)
            {
                hidIds.Value                = Request.QueryString["id"];
                lblAirline.Text             = Bargain.Airline;
                lblArrival.Text             = Bargain.Arrival;
                lblVoyage.Text              = Bargain.VoyageType.GetDescription();
                lblOffice.Text              = Bargain.OfficeCode;
                lblCutomerCode.Text         = Bargain.CustomCode;
                lblExceptDay.Text           = Bargain.DepartureDateFilter;
                lblTicket.Text              = Bargain.TicketType.GetDescription();
                lblDeparture.Text           = Bargain.Departure;
                lblDepartureDate.Text       = (Bargain.DepartureDateStart.ToString("yyyy-MM-dd")) + "至" + (Bargain.DepartureDateEnd.ToString("yyyy-MM-dd"));
                lblCreateTime.Text          = Bargain.StartPrintDate.ToString("yyyy-MM-dd");
                lblBunks.Text               = Bargain.Berths;
                lblDepartureFilght.Text     = Bargain.DepartureFlightsFilterType == LimitType.None ? "不限" : (Bargain.DepartureFlightsFilterType == LimitType.Include ? "适用以下航班:" + Bargain.DepartureFlightsFilter : "不适用以下航班:" + Bargain.DepartureFlightsFilter);
                lblDepartureDateFilght.Text = PublicClass.StringOperation.TransferToChinese(Bargain.DepartureWeekFilter);
                lblRetreat.Text             = "作废规定:" + Bargain.InvalidRegulation + "<br />"
                                              + "改签规定:" + Bargain.ChangeRegulation + "<br />"
                                              + "签转规定:" + Bargain.EndorseRegulation + "<br />"
                                              + "退票规定:" + Bargain.RefundRegulation + "<br />";
                if (Bargain.IsInternal)
                {
                    lblNeiBu.Text = (Bargain.InternalCommission * 100).TrimInvaidZero() + "%";
                }
                else
                {
                    this.internalTitle.Visible = false;
                    this.internalValue.Visible = false;
                }
                lblXiaJi.Text = (Bargain.SubordinateCommission * 100).TrimInvaidZero() == "-1" ? "" : (Bargain.SubordinateCommission * 100).TrimInvaidZero() + "%";
                if (Bargain.IsPeer)
                {
                    lblTongHang.Text = (Bargain.ProfessionCommission * 100).TrimInvaidZero() + "%";
                }
                else
                {
                    professionTitle.Visible = false;
                    professionValue.Visible = false;
                }
                lblLock.Text   = Bargain.Freezed == true ? "锁定" : "未锁定";
                lblRemaek.Text = Bargain.Remark;
                lblChang.Text  = Bargain.ChangePNR ? "需要" : "不需要";
                lblDays.Text   = "最少提前天数:" + (Bargain.BeforehandDays > -1 ? Bargain.BeforehandDays + "天" : "");
                lblDays.Text  += "最多提前天数:" + (Bargain.MostBeforehandDays > -1 ? Bargain.MostBeforehandDays + "天" : "无");
                lblPrintBeforeTwoHours.Text = Bargain.PrintBeforeTwoHours ? "可以" : "不可以";
                lblDrawerCondition.Text     = Bargain.DrawerCondition;
                if (Bargain.Freezed)
                {
                    this.btnunlock.Visible = true;
                    this.btnlock.Visible   = false;
                    this.unlock.Visible    = true;
                    [email protected]     = false;
                }
                else
                {
                    this.btnunlock.Visible = false;
                    this.btnlock.Visible   = true;
                    this.unlock.Visible    = false;
                    [email protected]     = true;
                }
                if (Bargain.VoyageType == VoyageType.OneWay)
                {
                    lblDepartuerShowOrHide.Visible = false;
                    returnFilght.Visible           = false;
                }
                else
                {
                    this.lblRetnrnFilght.Text = Bargain.ReturnFlightsFilterType == LimitType.None ? "所有" : (Bargain.ReturnFlightsFilterType == LimitType.Include ? "适用:" + Bargain.ReturnFlightsFilter : "不适用:" + Bargain.ReturnFlightsFilter);
                }

                if (Bargain.VoyageType == VoyageType.RoundTrip)
                {
                    exceptAirlinesTitle.Visible = false;
                    this.travelDayTitle.Visible = true;
                    this.travelDayValue.Visible = true;
                    this.lblTravelDays.Text     = Bargain.TravelDays.ToString();
                }
                else
                {
                    this.lblExceptAirlines.Text = Bargain.ExceptAirways;
                }
                if (Bargain.VoyageType == VoyageType.TransitWay)
                {
                    priceTitle.Visible          = false;
                    priceValue.Visible          = false;
                    transit.Visible             = true;
                    lblTransit.Text             = Bargain.Transit;
                    lblDepartuerShowOrHide.Text = "第一程";
                    lblArrivalShowOrHide.Text   = "第二程";
                    lblMultiSuitReduce.Text     = Bargain.MultiSuitReduce ? "适用" : "不适用";
                }
                else
                {
                    lblPice.Text         = Bargain.PriceType == PriceType.Discount ? (Bargain.Price * 100).TrimInvaidZero() + "折" : (Bargain.PriceType == PriceType.Commission ? "按返佣" : (Bargain.Price > 0 ? (Bargain.Price.TrimInvaidZero() + "元") : ""));
                    duoduanTitle.Visible = false;
                    duoduanValue.Visible = false;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            RegisterOEMSkins("form.css");
            RegisterOEMSkins("page.css");
            if (!IsPostBack)
            {
                SettingPolicy setting = CompanyService.GetPolicySetting(this.CurrentCompany.CompanyId);

                var company = CompanyService.GetCompanySettingsInfo(CurrentCompany.CompanyId);
                if (company != null && company.Parameter.CanHaveSubordinate)
                {
                    neibuTh.Visible      = true;
                    neibufanyong.Visible = true;
                }
                else
                {
                    neibuTh.Visible      = false;
                    neibufanyong.Visible = false;
                }
                cutomeTh.Visible      = company != null && company.WorkingSetting != null && company.WorkingSetting.IsImpower;
                ddlCustomCode.Visible = company != null && company.WorkingSetting != null && company.WorkingSetting.IsImpower;

                if (setting == null)
                {
                    RegisterScript("alert('还未有任何政策设置信息,不能访问本页面!');window.location.href='/Index.aspx';", true);
                    return;
                }
                if (setting.Airlines == "")
                {
                    RegisterScript("alert('还没有设置航空公司,请先设置航空公司!');window.location.href='/Index.aspx';", true);
                    return;
                }

                bool allowBrotherPurchases = false;
                if (company != null)
                {
                    allowBrotherPurchases = company.Parameter.AllowBrotherPurchase;
                }

                dropOffice.DataSource     = CompanyService.QueryOfficeNumbers(this.CurrentCompany.CompanyId);
                dropOffice.DataTextField  = "Number";
                dropOffice.DataValueField = "Impower";
                dropOffice.DataBind();

                ddlCustomCode.DataSource     = CompanyService.GetCustomNumberByEmployee(CurrentUser.Id);
                ddlCustomCode.DataTextField  = "Number";
                ddlCustomCode.DataValueField = "Number";
                ddlCustomCode.DataBind();

                tongTh.Visible = allowBrotherPurchases;
                tong.Visible   = allowBrotherPurchases;
                var queryList = FoundationService.Airports;
                this.txtDepartureAirports.InitData(true, queryList.Where(item => setting.Departure.Split('/').Contains(item.Code.Value)));
                //this.txtArrivalAirports.InitData(true, queryList.Where(item => setting.Departure.Split('/').Contains(item.Code.Value)));
                //this.txtZhongzhuanAirports.InitData(true, queryList.Where(item => setting.Departure.Split('/').Contains(item.Code.Value)));
                this.txtShifaAirports.InitData(queryList.Where(item => setting.Departure.Split('/').Contains(item.Code.Value)));


                if (Request.QueryString["Id"] != null && Request.QueryString["Type"] != null)
                {
                    BargainPolicy bargain = PolicyManageService.GetBargainPolicy(Guid.Parse(Request.QueryString["Id"]));
                    if (bargain.VoyageType == VoyageType.OneWay)
                    {
                        selEndorseRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainOneWayEndorseRegulation);
                        selEndorseRegulation.DataTextField  = "Name";
                        selEndorseRegulation.DataValueField = "Name";
                        selEndorseRegulation.DataBind();

                        selInvalidRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainOneWayInvalidRegulation);
                        selInvalidRegulation.DataTextField  = "Name";
                        selInvalidRegulation.DataValueField = "Name";
                        selInvalidRegulation.DataBind();

                        selRefundRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainOneWayRefundRegulation);
                        selRefundRegulation.DataTextField  = "Name";
                        selRefundRegulation.DataValueField = "Name";
                        selRefundRegulation.DataBind();

                        selChangeRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainOneWayChangeRegulation);
                        selChangeRegulation.DataTextField  = "Name";
                        selChangeRegulation.DataValueField = "Name";
                        selChangeRegulation.DataBind();
                    }
                    else if (bargain.VoyageType == VoyageType.RoundTrip)
                    {
                        selEndorseRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainRoundTripEndorseRegulation);
                        selEndorseRegulation.DataTextField  = "Name";
                        selEndorseRegulation.DataValueField = "Name";
                        selEndorseRegulation.DataBind();

                        selInvalidRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainRoundTripInvalidRegulation);
                        selInvalidRegulation.DataTextField  = "Name";
                        selInvalidRegulation.DataValueField = "Name";
                        selInvalidRegulation.DataBind();

                        selRefundRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainRoundTripRefundRegulation);
                        selRefundRegulation.DataTextField  = "Name";
                        selRefundRegulation.DataValueField = "Name";
                        selRefundRegulation.DataBind();

                        selChangeRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainRoundTripChangeRegulation);
                        selChangeRegulation.DataTextField  = "Name";
                        selChangeRegulation.DataValueField = "Name";
                        selChangeRegulation.DataBind();
                    }
                    else if (bargain.VoyageType == VoyageType.TransitWay)
                    {
                        selEndorseRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainTransitWayEndorseRegulation);
                        selEndorseRegulation.DataTextField  = "Name";
                        selEndorseRegulation.DataValueField = "Name";
                        selEndorseRegulation.DataBind();

                        selInvalidRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainTransitWayInvalidRegulation);
                        selInvalidRegulation.DataTextField  = "Name";
                        selInvalidRegulation.DataValueField = "Name";
                        selInvalidRegulation.DataBind();

                        selRefundRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainTransitWayRefundRegulation);
                        selRefundRegulation.DataTextField  = "Name";
                        selRefundRegulation.DataValueField = "Name";
                        selRefundRegulation.DataBind();

                        selChangeRegulation.DataSource     = SystemDictionaryService.Query(SystemDictionaryType.BargainTransitWayChangeRegulation);
                        selChangeRegulation.DataTextField  = "Name";
                        selChangeRegulation.DataValueField = "Name";
                        selChangeRegulation.DataBind();
                    }



                    if (Request.QueryString["Type"].Trim() == "Update")
                    {
                        tip.InnerText      = "修改特价政策";
                        chkAuto.Visible    = false;
                        btnCopy.Visible    = false;
                        btnModify.Visible  = true;
                        lblAirline.Visible = true;
                        ddlAirline.Visible = false;
                    }
                    if (Request.QueryString["Type"].Trim() == "Copy")
                    {
                        tip.InnerText      = "复制特价政策";
                        lblAirline.Visible = false;
                        ddlAirline.Visible = true;
                        chkAuto.Visible    = true;
                        btnCopy.Visible    = true;
                        btnModify.Visible  = false;
                        string[] strIds = setting.Airlines.Split('/');
                        ddlAirline.DataSource = from item in FoundationService.Airlines
                                                where item.Valid && strIds.Contains(item.Code.Value)
                                                select new
                        {
                            Code = item.Code,
                            Name = item.Code + "-" + item.ShortName
                        };
                        ddlAirline.DataTextField  = "Name";
                        ddlAirline.DataValueField = "Code";
                        ddlAirline.DataBind();
                    }
                    //ddlBunks.DataSource = QueryBunks(Bargain.Airline, Bargain.DepartureDateStart, Bargain.DepartureDateEnd);
                    //ddlBunks.DataBind();
                    InitDataValue(bargain);
                }
            }
        }