protected void ibtnSubmit_Click(object sender, EventArgs e)
        {
            if (this.IsValid)
            {
                bool flag;
                Utility.Transaction.CurrentTransactionObject.Remark = this.txtRemark.Value;
                flag = this.PHContactInfoControl1.PaddingPassengerInfo();
                flag = this.HotelOrderPassengerInfoControl1.PaddingPassengerInfo();

                if (!flag)
                {
                    return;
                }

                if (this.chkInsurance.Checked && this.divInsurance.Visible == true)
                {
                    Terms.Sales.Business.InsuranceSearchCondition Condition = new Terms.Sales.Business.InsuranceSearchCondition();

                    Condition.InsuranceType = TERMS.Common.InsuranceType.Package;

                    List<DateTime> listDateBegin = new List<DateTime>();
                    List<DateTime> listDateEnd = new List<DateTime>();

                    ///����Air��ʱ�� ֱ�Ӽ�¼����Air��CheckIn��CheckOut����

                    if (Utility.Transaction.CurrentTransactionObject.Items[0] is PackageOrderItem)
                    {
                        for (int j = 0; j < ((AirOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0].Items[0]).Merchandise.AirTrip.SubTrips.Count; j++)
                        {
                            for (int x = 0; x < ((AirOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0].Items[0]).Merchandise.AirTrip.SubTrips[j].Flights.Count; x++)
                            {
                                listDateBegin.Add(((AirOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0].Items[0]).Merchandise.AirTrip.SubTrips[j].Flights[x].DepartureTime);
                                listDateEnd.Add(((AirOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0].Items[0]).Merchandise.AirTrip.SubTrips[j].Flights[x].ArriveTime);
                            }
                        }
                    }
                    //��ʱ���������
                    listDateBegin.Sort();
                    listDateEnd.Sort();

                    Condition.DepartureDate = listDateBegin[0];
                    Condition.ReturnDate = listDateEnd[listDateEnd.Count - 1];

                    List<PackageMaterial> MVHotelList = PgMerchandise.GetPackageMaterials(1);
                    Condition.TotalTripCost = ((PackageMaterial)MVHotelList[((List<int>)PgMerchandise.DefaultIndex[1])[0]]).TotalPrice;

                    Condition.TravelerCount = ((Terms.Sales.Business.PackageSearchCondition)Utility.Transaction.CurrentSearchConditions).AirSearchCondition.GetPassengerNumber(TERMS.Common.PassengerType.Adult) + ((Terms.Sales.Business.PackageSearchCondition)Utility.Transaction.CurrentSearchConditions).AirSearchCondition.GetPassengerNumber(TERMS.Common.PassengerType.Child);

                    InsuranceMaterial insuranceMaterial = this.OnSearchInsurance(Condition);

                    InsuranceOrderItem insuranceOrderItem = new InsuranceOrderItem(null);

                    insuranceOrderItem.InsuranceOrderName = insuranceMaterial.InsuranceName;
                    insuranceOrderItem.TotalPremiumAmount = Convert.ToDecimal(insuranceMaterial.PolicyQuote.PolicyInformation.Premium.TotalPremiumAmount);

                    Utility.Transaction.CurrentTransactionObject.AddItem(insuranceOrderItem);

                    this.Response.Redirect("PackageTravelerInsurance.aspx" + "?ConditionID=" + Request.Params["ConditionID"]);
                }
                else
                {
                    //��¼����˿���Ϣ
                    //OperaterAdvice.DoAdvice(Terms.Configuration.Utility.ConfigurationConst.OperateType.EnterTravels, this);
                    this.Response.Redirect("CreditCardInformation.aspx" + "?ConditionID=" + Request.Params["ConditionID"]);
                }
            }
        }
    private InsuranceMaterial SetInsurance()
    {
        Terms.Sales.Business.InsuranceSearchCondition Condition = new Terms.Sales.Business.InsuranceSearchCondition();

        Condition.InsuranceType = TERMS.Common.InsuranceType.Tour;

        Condition.DepartureDate = ((TourOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0]).BeginDate;
        Condition.ReturnDate = ((TourOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0]).EndDate;

        Condition.TravelerCount = 1;

        Condition.TotalTripCost = 0M;

        InsuranceMaterial insuranceMaterial = this.OnSearchInsurance(Condition);

        return insuranceMaterial;
    }
        private void SetInsurance()
        {
            Terms.Sales.Business.InsuranceSearchCondition Condition = new Terms.Sales.Business.InsuranceSearchCondition();

            Condition.InsuranceType = TERMS.Common.InsuranceType.Package;

            List<DateTime> listDateBegin = new List<DateTime>();
            List<DateTime> listDateEnd = new List<DateTime>();

            ///����Air��ʱ�� ֱ�Ӽ�¼����Air��CheckIn��CheckOut����

            if (Utility.Transaction.CurrentTransactionObject.Items[0] is PackageOrderItem)
            {
                for (int j = 0; j < ((AirOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0].Items[0]).Merchandise.AirTrip.SubTrips.Count; j++)
                {
                    for (int x = 0; x < ((AirOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0].Items[0]).Merchandise.AirTrip.SubTrips[j].Flights.Count; x++)
                    {
                        listDateBegin.Add(((AirOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0].Items[0]).Merchandise.AirTrip.SubTrips[j].Flights[x].DepartureTime);
                        listDateEnd.Add(((AirOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0].Items[0]).Merchandise.AirTrip.SubTrips[j].Flights[x].ArriveTime);
                    }
                }
            }
            //��ʱ���������
            listDateBegin.Sort();
            listDateEnd.Sort();

            Condition.DepartureDate = listDateBegin[0];
            Condition.ReturnDate = listDateEnd[listDateEnd.Count - 1];

            List<PackageMaterial> MVHotelList = PgMerchandise.GetPackageMaterials(1);
            Condition.TotalTripCost = ((PackageMaterial)MVHotelList[((List<int>)PgMerchandise.DefaultIndex[1])[0]]).TotalPrice;
            Condition.TravelerCount = ((Terms.Sales.Business.PackageSearchCondition)Utility.Transaction.CurrentSearchConditions).AirSearchCondition.GetPassengerNumber(TERMS.Common.PassengerType.Adult) + ((Terms.Sales.Business.PackageSearchCondition)Utility.Transaction.CurrentSearchConditions).AirSearchCondition.GetPassengerNumber(TERMS.Common.PassengerType.Child);

            try
            {
                InsuranceMaterial insuranceMaterial = this.OnSearchInsurance(Condition);

                lblInsuranceName.Text = insuranceMaterial.InsuranceName;

                lblInsuranceTotal.Text = "$" + insuranceMaterial.PolicyQuote.PolicyInformation.Premium.TotalPremiumAmount.ToString("N0");

                if (insuranceMaterial.InsuranceUrl.IndexOf(@"http://") > -1)
                {
                    hlInsuranceDetails.NavigateUrl = insuranceMaterial.InsuranceUrl;
                }
                else
                {
                    hlInsuranceDetails.NavigateUrl = @"http://" + insuranceMaterial.InsuranceUrl;
                }
            }
            catch
            {
                return;
            }
        }
    private void AddInsurance()
    {
        Terms.Sales.Business.InsuranceSearchCondition Condition = new Terms.Sales.Business.InsuranceSearchCondition();

        Condition.InsuranceType = TERMS.Common.InsuranceType.Tour;

        if (SelectPriceType)
            Condition.DepartureDate = ((TourOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0]).BeginDate.AddDays(1);
        else
            Condition.DepartureDate = ((TourOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0]).BeginDate;

        Condition.ReturnDate = ((TourOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0]).EndDate;

        Condition.TotalTripCost = ((TourOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0]).TotalPrice;

        Condition.TravelerCount = PriceInfoControl1.AdultNumber + PriceInfoControl1.ChildNumber + PriceInfoControl1.ChildWithOutNumber;

        Condition.Adults = PriceInfoControl1.AdultNumber;

        Condition.Childs = PriceInfoControl1.ChildNumber + PriceInfoControl1.ChildWithOutNumber;

        InsuranceMaterial insuranceMaterial = this.OnSearchInsurance(Condition);

        ((TourOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0]).IsInsurance = true;

        InsuranceOrderItem insuranceOrderItem = new InsuranceOrderItem(insuranceMaterial, null);

        insuranceOrderItem.InsuranceType = TERMS.Common.InsuranceType.Tour;
        insuranceOrderItem.TotalTripCost = ((TourOrderItem)Utility.Transaction.CurrentTransactionObject.Items[0]).TotalPrice;

        insuranceOrderItem.InsuranceOrderName = insuranceMaterial.InsuranceName;
        insuranceOrderItem.InsuranceMarkUp = Convert.ToDecimal(insuranceMaterial.PolicyQuote.PolicyInformation.Premium.Markup);
        insuranceOrderItem.TotalPremiumAmount = Convert.ToDecimal(insuranceMaterial.PolicyQuote.PolicyInformation.Premium.TotalPremiumAmount);

        for (int i = 0; i < Utility.Transaction.CurrentTransactionObject.Items.Count; i++)
        {
            if (Utility.Transaction.CurrentTransactionObject.Items[i] is InsuranceOrderItem)
                Utility.Transaction.CurrentTransactionObject.Items.Remove(Utility.Transaction.CurrentTransactionObject.Items[i]);
        }

        Utility.Transaction.CurrentTransactionObject.AddItem(insuranceOrderItem);
    }