protected void btnProceed_Click(object sender, EventArgs e) { if (Session_value != null) { try { string[] date = null; if (Session_value != "") { date = Session_value.Split(','); } else { Response.Redirect("Default.aspx", false); } if (date.Length < 4) { String err = "Cannot render seat layour because seat selection in Session invalid or expired. Session: " + Session_value; throw new Exception(err); } else { string filmCode = date[3].ToString(); string[] confimseats = hidtempseats.Value.Split('|'); int totalSeats = int.Parse(confimseats[0]); string strchktempseat = "", Seat_info = ""; for (int u = 0; u < totalSeats; u++) { strchktempseat += confimseats[2 + u].Split('_')[0] + ","; Seat_info += confimseats[2 + u].Split('_')[1] + ","; } string SeatNo = strchktempseat.TrimEnd(','); int status; TransactionRecord _tr = new TransactionRecord(); //assign filmCode from Session _tr.Play = filmCode; _tr.TotalSeats = totalSeats; //Generate Transaction ID _tr.SeatInfo = SeatNo; // _tr.BookingID = GTICKBOL.TransactionCounter_Max(); _tr.BookingID = Convert.ToInt64(trnsectioncounter); status = GTICKBOL.Check_Seats_BeforeProceed(_tr); if (status == 0) { KoDTicketing.GTICKV.LogEntry(_tr.BookingID.ToString(), "User Detail > " + Session_value + ", Browser Version : " + HiddenBrowser.Value, "2", ""); KoDTicketing.GTICKV.LogEntry(_tr.BookingID.ToString(), "Checking Seats Availability", "4", ""); ClientScript.RegisterStartupScript(GetType(), "myscript", "<script>alert('The seats you have selected are not available at this time, please select different seats');</script>"); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Setting up the seat layout again as the selected seats are not available. Session : " + Session_value); set_seatLayout(); return; } else { KoDTicketing.GTICKV.LogEntry(_tr.BookingID.ToString(), "Seats are available.", "5", ""); GTICKBOL.Insert_SeatInfo(Seat_info.TrimEnd(','), _tr.BookingID); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Request Contact Details for Transaction... : " + Decrypt(Request.QueryString["SessionId"])); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(trnsectioncounter); Response.Redirect("ContactDetails.aspx?SessionId=" + Encrypt(trnsectioncounter), false); } } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Seat Layout Page Error: " + ex.Message); Session.Abandon(); ClientScript.RegisterStartupScript(GetType(), "myscript", "<script>alert('Session Timeout. Please start" + " the transaction again');window.location.href='Default.aspx';</script>"); } } else { ClientScript.RegisterStartupScript(GetType(), "myscript", "<script>alert('Session Timeout. Please start" + " the transaction again');window.location.href='Default.aspx';</script>"); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// protected void btn_Submit_Click(object sender, EventArgs e) { long TransectionCounter = GTICKBOL.TransactionCounter_Max(); Session[TransectionCounter.ToString()] = TransectionCounter; //***************if routed from other website***************** if (Request.QueryString["Router"] == "" || Request.QueryString["Router"] == null) { Session["Router"] = ""; } else if (Request.QueryString["Router"] != "buzzintown" && Request.QueryString["Router"] != "airfaresau") { Session["Router"] = ""; } else { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking Through" + Request.QueryString["Router"].ToString()); Session["Router"] = Request.QueryString["Router"].ToString(); } //**************************************************************** Session["play_Val"] = ddl_Play.SelectedValue; Session["play_Val_Location"] = ddl_Location.SelectedItem; string Category_SelectedItem = ""; if (ddl_Category.SelectedItem.Text == "CHILD, Rs. 2999") { Category_SelectedItem = "COPPER, Rs. 2999"; } else if (ddl_Category.SelectedItem.Text == "SINGLE, Rs. 6999") { Category_SelectedItem = "GOLD, Rs. 6999"; } else if (ddl_Category.SelectedItem.Text == "COUPLE, Rs. 11999") { Category_SelectedItem = "PLATINUM, Rs. 11999"; } else if (ddl_Category.SelectedItem.Text == "TEEN, Rs. 3999") { Category_SelectedItem = "SILVER, Rs. 3999"; } Session_value = ddl_Location.SelectedValue + "," + ddl_Play.SelectedValue + "," + Convert.ToDateTime(dateofshow.Text.ToString()).ToString("dd/MM/yyyy") + "," + ddl_ShowTimes.SelectedValue + "," + ddl_Category.SelectedValue + "," + drp_TotalSeats.SelectedValue + "," + ddl_Location.SelectedItem.Text + "," + ddl_ShowTimes.SelectedItem.Text + "," + Category_SelectedItem + "," + "" + "," + "" + "," + TransectionCounter; Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Render Seat Layout for " + Session_value); GTICKBOL.Insert_ShowDetail(Session_value, TransectionCounter); DataTable dt_NewyearSeat = GTICKBOL.Select_NewYearSeat(ddl_ShowTimes.SelectedValue, TransectionCounter, Convert.ToInt32(drp_TotalSeats.SelectedValue)); string seatinfonewyear = ""; foreach (DataRow row in dt_NewyearSeat.Rows) { seatinfonewyear += row[0] + ","; } if (dt_NewyearSeat != null) { GTICKBOL.Insert_SeatInfo(seatinfonewyear.TrimEnd(','), TransectionCounter); } if (Request.QueryString["Router"] == "buzzintown" || Request.QueryString["Router"] == "airfaresau") { Response.Redirect("ContactDetails.aspx?SessionId=" + Encrypt(TransectionCounter.ToString()) + "&Router=" + Request.QueryString["Router"], false); } else { Response.Redirect("ContactDetails.aspx?SessionId=" + Encrypt(TransectionCounter.ToString()), false); } }