Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false)
            {
                if (Session["TripDetail"] != null)
                {
                    TripDetail tripDetail = new TripDetail();
                    tripDetail = (TripDetail)Session["TripDetail"];
                    PersonDetail personDetail = new PersonDetail();
                    personDetail = (PersonDetail)Session["PersonDetail"];
                    lblFromTo.Text = "<em>" + tripDetail.LeavingFrom + "</em> to <em>" + tripDetail.GoingTo + "</em>";
                        hdnEmailId.Value = personDetail.EmailId;
                        hdnMobileNumber.Value = personDetail.MobileNumber;
                        hdnPersonName.Value = personDetail.Name[0].Name;
                        txtPhoneNumber.Text = personDetail.MobileNumber;
                    if (tripDetail.TripType == 1)
                    {
                        lblAmount.Text = "TZS " + Convert.ToString(tripDetail.Adult * (tripDetail.LeavingFromScheduleAmount + tripDetail.GoingToScheduleAmount));

                    }
                    else
                    {
                        lblAmount.Text = "TZS " + Convert.ToString(tripDetail.Adult * tripDetail.LeavingFromScheduleAmount);
                    }

                }
                else
                {
                    Response.Redirect("home.aspx");

                }

            }
        }
        protected void Continue_Click(object sender, EventArgs e)
        {
            List<PersonName> listPersonName = new List<PersonName>();
            PersonDetail personDetail = new PersonDetail();
               personDetail.EmailId = txtEmail.Text;
            personDetail.MobileNumber = txtPhoneNumber.Text;
            personDetail.PaymentType = Convert.ToInt32(ddlPaymentTYpe.SelectedValue);
            for (int i = 1; i <= Convert.ToInt32(lblTotalBookedTicket.Text); i++)
            {
            PersonName personName = new PersonName();
            personName.Name = Request.Form["txtAdult"+i.ToString()];
            personName.PersonType = 1;
            listPersonName.Add(personName);
            }
            // for(int i = 1 ; i <= Convert.ToInt32(lblTotalSenior.Text) ; i++)
            //{
            //PersonName personName = new PersonName();
            //personName.Name = Request.Form["txtSenior"+i.ToString()];
            //personName.PersonType = 3;
            //listPersonName.Add(personName);

            //}
            // for(int i = 1 ; i <= Convert.ToInt32(lblTotalChild.Text) ; i++)
            //{
            //PersonName personName = new PersonName();
            //personName.Name = Request.Form["txtChild"+i.ToString()];
            //personName.PersonType = 2;
            //listPersonName.Add(personName);
            //}
             personDetail.Name = listPersonName;
             Session["PersonDetail"] = personDetail;
             Response.Redirect("payment.aspx");
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false)
            {

                if (Session["PersonDetail"] != null)
                {
                    TripDetail tripDetail = new TripDetail();
                    tripDetail = (TripDetail)Session["TripDetail"];
                    PersonDetail personDetail = new PersonDetail();
                    personDetail = (PersonDetail)Session["PersonDetail"];

                    lblFromTo.Text = "<em>" + tripDetail.LeavingFrom + "</em> to <em>" + tripDetail.GoingTo + "</em>";

                   // lblNumber.Text = personDetail.MobileNumber ;
                    lblLeaving.Text = tripDetail.LeavingFrom.ToString();
                    lblTotalAdult.Text = Convert.ToString(tripDetail.Adult);
                    lblTotalChild.Text = Convert.ToString(tripDetail.Child);
                    lblTotalSenior.Text = Convert.ToString(tripDetail.Senior);
                    lblGoingTo.Text = tripDetail.GoingTo.ToString();
                    lblTravelDate.Text = tripDetail.TravelDate.ToShortDateString() + " " + tripDetail.LeavingFromTime ;
                    if (tripDetail.TripType == 1)
                    {
                        divReturn.Visible = true;
                        lblReturnDate.Text = tripDetail.ReturnDate.ToShortDateString() + " " + tripDetail.ReturnTime;
                        lblFairType.Text = "RoundTrip";
                        lblReturnAdult.Text = Convert.ToString(tripDetail.Adult);
                            lblReturnChild.Text = Convert.ToString(tripDetail.Child);
                            lblReturnGoingTo.Text = tripDetail.LeavingFrom.ToString();
                            lblReturnLeavingFrom.Text = tripDetail.GoingTo.ToString();
                            lblReturnSenior.Text = Convert.ToString(tripDetail.Senior);
                            if (tripDetail.Adult > 0)
                                divReturnAdult.Visible = true;
                            if (tripDetail.Child > 0)
                                divReturnChild.Visible = true;
                            if (tripDetail.Senior > 0)
                                divReturnSenior.Visible = true;

                            hdnScheduleid.Value = tripDetail.LeavingFromScheduleId.ToString();
                            hdnGoingScheduleid.Value = tripDetail.GoingToScheduleId.ToString();
                            hdnMobileNumber.Value = personDetail.MobileNumber;
                            hdnPassengerid.Value = personDetail.PassengerId.ToString() ;
                            hdnTripType.Value = "1";
                    }
                    else
                    {
                        lblFairType.Text = "One Way";

                        hdnTripType.Value = "0";
                        hdnScheduleid.Value = tripDetail.LeavingFromScheduleId.ToString();
                        hdnMobileNumber.Value = personDetail.MobileNumber;
                        hdnPassengerid.Value = personDetail.PassengerId.ToString();
                    }

                    if (tripDetail.Adult > 0)
                        divAdult.Visible = true;
                    if (tripDetail.Child  > 0)
                        divChild.Visible = true;
                    if (tripDetail.Senior > 0)
                        divSenior.Visible = true;

                }
                else
                {

                    Response.Redirect("home.aspx");
                }
            }
        }