protected void Continue_Click(object sender, EventArgs e) { TripDetail tripDetail = new TripDetail(); tripDetail = (TripDetail)Session["TripDetail"]; tripDetail.LeavingFromScheduleAmount = Convert.ToInt32(hdnLeavingFromScheduleAmount.Value ); tripDetail.LeavingFromScheduleId = Convert.ToInt32(hdnLeavingFromScheduleId.Value ); tripDetail.GoingToScheduleAmount = Convert.ToInt32(hdnGoingToScheduleAmount.Value ); tripDetail.GoingToScheduleId = Convert.ToInt32(hdnGoingToScheduleId.Value ); tripDetail.LeavingFromTime = hdnLeavingFromTime.Value; if (tripDetail.TripType == 1) { tripDetail.ReturnTime = hdnReturnTime.Value; int isavilableTicket = Convert.ToInt32(hdnLeavingAvilableTrip.Value) + Convert.ToInt32(hdnGoingAvilableTrip.Value); if (isavilableTicket == 1) // in round trip case if one side ticket not avilable - round trip convert to one way trip { tripDetail.TripType = 0; if (Convert.ToInt32(hdnGoingAvilableTrip.Value) == 0) // return ticket is avilable but leaving from is not { tripDetail.LeavingFromScheduleId = tripDetail.GoingToScheduleId; tripDetail.LeavingFromScheduleAmount = tripDetail.GoingToScheduleAmount; string tempLocation = tripDetail.GoingTo; tripDetail.GoingTo = tripDetail.LeavingFrom; tripDetail.LeavingFrom = tempLocation; tripDetail.LeavingFromTime = hdnReturnTime.Value; } } } Session["TripDetail"] = tripDetail; Response.Redirect("bookingdetail.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { if (!Page.IsPostBack) { TripDetail tripDetail = new TripDetail(); tripDetail.Adult = Convert.ToInt32(Request.Form["ddAdult"]); tripDetail.Child = Convert.ToInt32(Request.Form["ddChild"]); tripDetail.Senior = Convert.ToInt32(Request.Form["ddsenior"]); tripDetail.LeavingFrom = Request.Form["txtLeavingFrom"].ToString(); tripDetail.GoingTo = Request.Form["txtGoingTo"].ToString(); tripDetail.TravelDate = Convert.ToDateTime(Request.Form["txtDepDate"]); if (Request.Form.Count > 7 ) // 1for round trip { tripDetail.ReturnDate = Convert.ToDateTime(Request.Form["txtReturnDate"]); tripDetail.TripType = 1; } else { tripDetail.TripType = 0; } Session["TripDetail"] = tripDetail; } } }
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 Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { try { if (Request.Form.Count != 0) { TripDetail tripDetail = new TripDetail(); tripDetail.Adult = Convert.ToInt32(Request.Form["ddAdult"]); tripDetail.GoingToId = Convert.ToInt32(Request.Form["hdnGoingId"]); tripDetail.LeavingFromId = Convert.ToInt32(Request.Form["hdnFromId"]); hdnFromId.Value = Request.Form["hdnFromId"].ToString(); hdnGoingId.Value = Request.Form["hdnGoingId"].ToString(); //tripDetail.Child = Convert.ToInt32(Request.Form["ddChild"]); //tripDetail.Senior = Convert.ToInt32(Request.Form["ddsenior"]); tripDetail.LeavingFrom = Request.Form["txtLeavingFrom"].ToString(); tripDetail.GoingTo = Request.Form["txtGoingTo"].ToString(); if (Request.Form.Count == 8) // 1for round trip { hdnTripType.Value = "1"; tripDetail.ReturnDate = Convert.ToDateTime(Request.Form["txtReturnDate"]); tripDetail.TravelDate = Convert.ToDateTime(Request.Form["txtrDepDate"]); divReturnTicket.Visible = true; lblReturnTo.Text = "<em>" + Request.Form["txtGoingTo"].ToString() + "</em> to <em>" + Request.Form["txtLeavingFrom"].ToString() + "</em>"; tripDetail.TripType = 1; hdnDepartureDate.Value = tripDetail.TravelDate.ToShortDateString(); hdnReturnDate.Value = tripDetail.ReturnDate.ToShortDateString(); } else { tripDetail.TravelDate = Convert.ToDateTime(Request.Form["txtDepDate"]); hdnTripType.Value = "0"; tripDetail.TripType = 0; hdnDepartureDate.Value = tripDetail.TravelDate.ToShortDateString(); } lblFromTo.Text = "<em>" + Request.Form["txtLeavingFrom"].ToString() + "</em> to <em>" + Request.Form["txtGoingTo"].ToString() + "</em>"; Session["TripDetail"] = tripDetail; } } catch(Exception) { Response.Redirect("home.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { if (Session["TripDetail"] != null) { TripDetail tripDetail = new TripDetail(); tripDetail = (TripDetail)Session["TripDetail"]; hdnAdult.Value = Convert.ToString(tripDetail.Adult); //hdnChild.Value = Convert.ToString(tripDetail.Child); //hdnSenior.Value = Convert.ToString(tripDetail.Senior); lblFromTo.Text = "<em>" + tripDetail.LeavingFrom + "</em> to <em>" + tripDetail.GoingTo + "</em>"; lblLeaving.Text = tripDetail.LeavingFrom.ToString(); lblTotalBookedTicket.Text = Convert.ToString(tripDetail.Adult); //lblTotalAdult.Text = Convert.ToString(tripDetail.Adult); //lblTotalBookedTicket.Text = Convert.ToString(tripDetail.Adult + tripDetail.Child + tripDetail.Senior); // 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 ; lblAmount.Text = "TZS " + Convert.ToString(tripDetail.Adult * (tripDetail.LeavingFromScheduleAmount + tripDetail.GoingToScheduleAmount )); lblGrandAmount.Text = "TZS " + Convert.ToString(tripDetail.Adult * (tripDetail.LeavingFromScheduleAmount + tripDetail.GoingToScheduleAmount)); } else { lblAmount.Text = "TZS " + Convert.ToString(tripDetail.Adult * tripDetail.LeavingFromScheduleAmount); lblGrandAmount.Text = "TZS " + Convert.ToString(tripDetail.Adult * tripDetail.LeavingFromScheduleAmount); } } else { Response.Redirect("home.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { if (Session["TripDetail"] != null) { TripDetail tripDetail = new TripDetail(); tripDetail = (TripDetail)Session["TripDetail"]; hdnAdult.Value = Convert.ToString(tripDetail.Adult); hdnChild.Value = Convert.ToString(tripDetail.Child); hdnSenior.Value = Convert.ToString(tripDetail.Senior); } else { Response.Redirect("default.aspx"); } } }
protected void btnGetSchedules_Click(object sender, EventArgs e) { TripDetail tripDetail = new TripDetail(); tripDetail.Adult = Convert.ToInt32(ddlAdult.SelectedItem.Value); tripDetail.Child = Convert.ToInt32(ddlChild.SelectedItem.Value); tripDetail.Senior = Convert.ToInt32(ddlSenior.SelectedItem.Value); tripDetail.LeavingFrom = txtFrom.Text; tripDetail.GoingTo = txtTo.Text; tripDetail.TravelDate = Convert.ToDateTime(txtDepartmentDate.Text); if (Convert.ToInt32(hdnTripType.Value) == 1) // 1for round trip { tripDetail.ReturnDate = Convert.ToDateTime(txtReturnDate.Text); tripDetail.TripType = 1; } else { tripDetail.TripType = 0; } Session["TripDetail"] = tripDetail; Response.Redirect("departure.aspx"); }
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"); } } }