Ejemplo n.º 1
0
    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>");
        }
    }