Exemplo n.º 1
0
        protected void buttonSubmit_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Request.Params[txtPickup.UniqueID]))
            {
                ShowWarning("Pick up address is required.");
            }

            //ScreenCaptureSave();
            BookingSetData();
            BookingViewBLL.BookingSaveOrUpdate(Booking);
            ShowSuccess("Booking updated. Please fix errors if exists and submit again");

            bool   needEmail = !Booking.Special && chkSpecial.Checked;
            string email     = string.Empty;

            if (needEmail)
            {
                email = "&confirm=1";
            }
            foreach (RepeaterItem extraService in rptExtraServices.Items)
            {
                var chkService = (HtmlInputCheckBox)extraService.FindControl("chkService");
                if (chkService.Checked)
                {
                    SaveExtraService();
                }
                else
                {
                    DeleteExtraService();
                }
            }
            foreach (RepeaterItem item in rptCustomers.Items)
            {
                CustomerInfoRowInput customerInfo1 = item.FindControl("customerData") as CustomerInfoRowInput;
                if (customerInfo1 != null)
                {
                    Customer customer1 = customerInfo1.NewCustomer(Module);
                    customer1.Booking = this.Booking;
                    Module.SaveOrUpdate(customer1);

                    Repeater rptService1 = item.FindControl("rptServices1") as Repeater;
                    if (rptService1 != null)
                    {
                        if (DetailService)
                        {
                            CustomerServiceRepeaterHandler.Save(rptService1, Module, customer1);
                        }
                    }
                }
            }
            Booking.EndDate     = Booking.StartDate.AddDays(Booking.Trip.NumberOfDay - 1);
            Session["Redirect"] = true;
            PageRedirect(string.Format("BookingView.aspx?NodeId={0}&SectionId={1}&bi={2}{3}", Node.Id, Section.Id, Booking.Id, email));
        }
Exemplo n.º 2
0
        public void SaveExtraService()
        {
            var busTypeId = -1;

            try
            {
                busTypeId = Int32.Parse(Request.Form["radBusType"]);
            }
            catch { }
            Booking.Transfer_BusType = BookingViewBLL.BusTypeGetById(busTypeId);
            if (rbtTransferService_OneWay.Checked)
            {
                Booking.Transfer_Service = "One Way";
            }
            if (rbtTransferService_TwoWay.Checked)
            {
                Booking.Transfer_Service = "Two Way";
            }
            var transfer_DateTo = Booking.StartDate;

            try
            {
                transfer_DateTo = DateTime.ParseExact(txtTransfer_Dateto.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            catch { }
            var transfer_DateBack = Booking.EndDate;

            try
            {
                transfer_DateBack = DateTime.ParseExact(txtTransfer_Dateback.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            catch { }
            if (Booking.Transfer_Service == "One Way")
            {
                if (!String.IsNullOrEmpty(txtTransfer_Dateto.Text))
                {
                    Booking.Transfer_DateTo   = transfer_DateTo;
                    Booking.Transfer_DateBack = null;
                }
                else
                if (!String.IsNullOrEmpty(txtTransfer_Dateback.Text))
                {
                    Booking.Transfer_DateTo   = null;
                    Booking.Transfer_DateBack = transfer_DateBack;
                }
            }
            if (Booking.Transfer_Service == "Two Way")
            {
                Booking.Transfer_DateBack = transfer_DateBack;
                Booking.Transfer_DateTo   = transfer_DateTo;
            }
            Booking.Transfer_Note = txtTransfer_Note.Text;
            BookingViewBLL.BookingSaveOrUpdate(Booking);
        }
Exemplo n.º 3
0
 protected void btnUnlockIncome_Click(object sender, EventArgs e)
 {
     if (!PermissionUtil.UserCheckPermission(CurrentUser.Id, (int)PermissionEnum.LOCK_INCOME))
     {
         ShowErrors("You don't have permission to perform this action");
         return;
     }
     Booking.LockDate = null;
     Booking.LockBy   = null;
     BookingViewBLL.BookingSaveOrUpdate(Booking);
     Response.Redirect(Request.RawUrl);
 }
Exemplo n.º 4
0
        protected void buttonSubmit_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Request.Params[txtPickup.UniqueID]))
            {
                ShowWarning("Pick up address is required.");
            }

            //ScreenCaptureSave();
            BookingSetData();
            BookingViewBLL.BookingSaveOrUpdate(Booking);
            ShowSuccess("Booking updated. Please fix errors if exists and submit again");

            bool   needEmail = !Booking.Special && chkSpecial.Checked;
            string email     = string.Empty;

            if (needEmail)
            {
                email = "&confirm=1";
            }
            PageRedirect(string.Format("BookingView.aspx?NodeId={0}&SectionId={1}&bi={2}{3}", Node.Id, Section.Id, Booking.Id, email));
        }