예제 #1
0
        public void BookingSetData()
        {
            Booking.Inspection      = chkInspection.Checked;
            Booking.CancelledReason = txtCancelledReason.Text;
            Booking.AgencyCode      = txtAgencyCode.Text;
            Booking.PickupAddress   = txtPickup.Text;
            Booking.SpecialRequest  = txtSpecialRequest.Text;
            Booking.IsPaymentNeeded = chkIsPaymentNeeded.Checked;
            Booking.Note            = txtCustomerInfo.Text;
            Booking.Special         = chkSpecial.Checked;

            Booking.IsEarlyBird = chkEarlyBird.Checked;

            try
            {
                Booking.Agency = Module.AgencyGetById(Convert.ToInt32(ddlAgencies.SelectedValue));
            }
            catch { }

            if (Booking.Agency == null)
            {
                ShowErrors("Please select one agency");
            }

            try
            {
                Booking.Deadline = DateTime.ParseExact(txtDeadline.Text, "dd/MM/yyyy HH:mm",
                                                       CultureInfo.InvariantCulture);
            }
            catch { }

            try
            {
                Booking.Booker = Module.ContactGetById(Convert.ToInt32(cddlBooker.SelectedValue));
            }
            catch { }

            try
            {
                Booking.IsTotalUsd = Convert.ToBoolean(Int32.Parse(ddlCurrencies.SelectedValue));
            }
            catch { }

            try
            {
                Booking.CancelPay = Convert.ToDouble(txtPenalty.Text);
            }
            catch { }

            BookingStatusProcess();
            TripProcess();

            StartDateProcess();

            ExtraServicesProcess(); //not cleanly
            VoucherProcess();       //not cleany
            TotalPriceProcess();    //not cleany

            if (Booking.Trip.NumberOfDay == 3)
            {
                Booking.TripOption = (TripOption)ddlOptions.SelectedIndex;
            }

            var seriesCode = "";

            seriesCode = txtSeriesCode.Text;

            if (!String.IsNullOrEmpty(seriesCode))
            {
                var series = BookingViewBLL.SeriesGetBySeriesCode(seriesCode);
                if (series != null)
                {
                    Booking.Series = series;
                }
                else
                {
                    ShowErrors("Không tồn tại series này");
                }
            }
            var guideExpense = 0.0;

            try
            {
                guideExpense = Double.Parse(txtGuideExpense.Text);
            }catch (Exception) {}
            Booking.Expense_Guide = guideExpense;
            var mealExpense = 0.0;

            try
            {
                mealExpense = Double.Parse(txtMealExpense.Text);
            }
            catch (Exception) { }
            Booking.Expense_Meal = mealExpense;
            var hotelExpense = 0.0;

            try
            {
                hotelExpense = Double.Parse(txtHotelExpense.Text);
            }
            catch (Exception) { }
            Booking.Expense_Hotel = hotelExpense;
            var busExpense = 0.0;

            try
            {
                busExpense = Double.Parse(txtBusExpense.Text);
            }
            catch (Exception) { }
            Booking.Expense_Bus = busExpense;
            var ticketExpense = 0.0;

            try
            {
                ticketExpense = Double.Parse(txtTicketExpense.Text);
            }
            catch (Exception) { }
            Booking.Expense_Ticket = ticketExpense;
            var limousineExpense = 0.0;

            try
            {
                limousineExpense = Double.Parse(txtLimousineExpense.Text);
            }
            catch (Exception) { }
            Booking.Expense_Limousine = limousineExpense;
            var busHaNoiSapaExpense = 0.0;

            try
            {
                busHaNoiSapaExpense = Double.Parse(txtBusHaNoiSapaExpense.Text);
            }
            catch (Exception) { }
            Booking.Expense_Bus_HanoiSapa = busHaNoiSapaExpense;
            var commissionExpense = 0.0;

            try
            {
                commissionExpense = Double.Parse(txtCommissionExpense.Text);
            }
            catch (Exception) { }
            Booking.Expense_Commission = commissionExpense;

            Booking.Expense_Meal_CurrencyType          = ddlMealExpenseCurrencyType.SelectedValue;
            Booking.Expense_Hotel_CurrencyType         = ddlHotelExpenseCurrencyType.SelectedValue;
            Booking.Expense_Guide_CurrencyType         = ddlGuideExpenseCurrencyType.SelectedValue;
            Booking.Expense_Ticket_CurrencyType        = ddlTicketExpenseCurrencyType.SelectedValue;
            Booking.Expense_Bus_CurrencyType           = ddlBusExpenseCurrencyType.SelectedValue;
            Booking.Expense_Limousine_CurrencyType     = ddlLimousineExpenseCurrencyType.SelectedValue;
            Booking.Expense_Bus_HanoiSapa_CurrencyType = ddlBusHaNoiSapaExpenseCurrencyType.SelectedValue;
            Booking.Expense_Commission_CurrencyType    = ddlCommissionExpenseCurrencyType.SelectedValue;
        }
        public void BookingSetData()
        {
            Booking.Inspection      = chkInspection.Checked;
            Booking.CancelledReason = txtCancelledReason.Text;
            Booking.AgencyCode      = txtAgencyCode.Text;
            Booking.PickupAddress   = txtPickup.Text;
            Booking.SpecialRequest  = txtSpecialRequest.Text;
            Booking.IsPaymentNeeded = chkIsPaymentNeeded.Checked;
            Booking.Note            = txtCustomerInfo.Text;
            Booking.Special         = chkSpecial.Checked;
            Booking.IsCharter       = chkCharter.Checked;
            Booking.IsEarlyBird     = chkEarlyBird.Checked;

            try
            {
                Booking.Agency = Module.AgencyGetById(Convert.ToInt32(ddlAgencies.SelectedValue));
            }
            catch { }

            if (Booking.Agency == null)
            {
                ShowErrors("Please select one agency");
            }

            try
            {
                Booking.Deadline = DateTime.ParseExact(txtDeadline.Text, "dd/MM/yyyy HH:mm",
                                                       CultureInfo.InvariantCulture);
            }
            catch { }

            try
            {
                Booking.Booker = Module.ContactGetById(Convert.ToInt32(cddlBooker.SelectedValue));
            }
            catch { }

            try
            {
                Booking.IsTotalUsd = Convert.ToBoolean(Int32.Parse(ddlCurrencies.SelectedValue));
            }
            catch { }

            try
            {
                Booking.CancelPay = Convert.ToDouble(txtPenalty.Text);
            }
            catch { }

            BookingStatusProcess();
            TripProcess();
            CruiseProcess();
            StartDateProcess();
            CharterProcess();       //not cleanly
            ExtraServicesProcess(); //not cleanly
            VoucherProcess();       //not cleany
            TotalPriceProcess();    //not cleany
            BookingRoomProcess();

            if (Booking.Trip.NumberOfDay == 3)
            {
                Booking.TripOption = (TripOption)ddlOptions.SelectedIndex;
            }

            var seriesCode = "";

            seriesCode = txtSeriesCode.Text;

            if (!String.IsNullOrEmpty(seriesCode))
            {
                var series = BookingViewBLL.SeriesGetBySeriesCode(seriesCode);
                if (series != null)
                {
                    Booking.Series = series;
                }
                else
                {
                    ShowErrors("Không tồn tại series này");
                }
            }
        }