Exemplo n.º 1
0
    protected void btnVarify_Click(object sender, EventArgs e)
    {
        //varify the vaoucher Nos from databse and execute this routine
        if (Session["seat_Val"] != null)
        {
            if (Session["PayDetailsTemp"] != null)
            {
                TransactionRecord tr = new TransactionRecord();
                PayDetailsTemp = Session["PayDetailsTemp"].ToString().Split('|');
                string[] Straa     = Session["seat_Val"].ToString().Split(',');
                string   BookingID = PayDetailsTemp[1].Split('_')[1].Split('~')[0];
                tr.BookingID  = long.Parse(BookingID);
                tr.TotalSeats = int.Parse(PayDetailsTemp[2]);
                tr.Category   = Straa[4];
                string[] datarr = Straa[2].Split('/');
                tr.ShowDate = datarr[1] + "/" + datarr[0] + "/" + datarr[2];
                tr.Day      = Convert.ToDateTime(tr.ShowDate).DayOfWeek.ToString();
                switch (tr.Day.ToLower())
                {
                case "monday":
                case "tuesday":
                case "wednesday":
                case "thursday":
                case "friday":
                    tr.Day = "1";
                    break;

                case "saturday":
                case "sunday":
                    tr.Day = "2";
                    break;
                }
                string VoucherNo = "";
                for (int U = 0; U < rep_Vouchers.Items.Count; U++)
                {
                    VoucherNo += ((TextBox)rep_Vouchers.Items[U].FindControl("txtSerials")).Text + "-" + ((TextBox)rep_Vouchers.Items[U].FindControl("txtvasls")).Text + "|";
                }
                tr.VoucherType      = PayDetailsTemp[0];
                tr.VoucherNo        = VoucherNo.TrimEnd('|');
                tr.VoucherBookingID = long.Parse("65" + BookingID.Remove(0, 2));
                if (TransactionBOL._Voucher_Varification_Update(tr) > 0)
                {
                    IAsyncResult ar = DoSomethingAsync("abc");
                    Session["result"] = ar;
                    Server.Transfer("~/Payment/Please-Wait.aspx", false);
                }
                else
                {
                    lblMess.Text = "Voucher No(s). Provided above are not valid!";
                }
            }
            else
            {
                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>");
        }
    }