Example #1
0
    /// <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;
        if (promotions == false)
        {
            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 + "," + ddl_Category.SelectedItem.Text + "," + "" + "," + "" + "," + TransectionCounter;;
            Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Render Seat Layout for " + Session_value);
        }
        else
        {
            KoDTicketingLibrary.DTO.Promotion PromoSession = (KoDTicketingLibrary.DTO.Promotion)Session["a" + Decrypt(Request.QueryString["promo"])];
            if (package == false)
            {
                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 + "," + ddl_Category.SelectedItem.Text + "," + PromoSession.PromotionCode.ToString().ToUpper() + "," + "" + "," + TransectionCounter;
            }
            else
            {
                //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 + "," + ddl_Category.SelectedItem.Text + "," + PromoSession.PromotionCode.ToString().ToUpper() + "," + Session["Package"].ToString() + "," + TransectionCounter;
                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 + "," + ddl_Category.SelectedItem.Text + "," + PromoSession.PromotionCode.ToString().ToUpper() + "," + Session["Package"].ToString() + "," + TransectionCounter;
            }
            Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Render Seat Layout for " + Session_value);
        }

        if (Session["Hotel"] == null)
        {
            Session["Hotel"] = "";
        }
        GTICKBOL.Insert_ShowDetail(Session_value, TransectionCounter);
        KoDTicketing.GTICKV.LogEntry(TransectionCounter.ToString(), "User Try to move from Default to Seat layout Page.", "1", "");
        if (Request.QueryString["Router"] == "buzzintown" || Request.QueryString["Router"] == "airfaresau")
        {
            Response.Redirect("Seat-Layout.aspx?SessionId=" + Encrypt(TransectionCounter.ToString()) + "&Router=" + Request.QueryString["Router"], false);
        }
        else
        {
            if (Request.QueryString["promo"] != null)
            {
                Session["a" + Decrypt(Request.QueryString["promo"])] = "";
            }
            Response.Redirect("Seat-Layout.aspx?SessionId=" + Encrypt(TransectionCounter.ToString()), false);
        }
    }
Example #2
0
    /// <summary>
    ///  Fill up the categories based on the Show/Play selected.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ddl_ShowTimes_SelectedIndexChanged(object sender, EventArgs e)
    {
        String filmCode = ddl_ShowTimes.SelectedValue;

        ddl_Category.Items.Clear();
        ddl_Category.Items.Add(new ListItem("Select", "0"));
        drp_TotalSeats.Items.Clear();
        drp_TotalSeats.Items.Add(new ListItem("Select", "0"));
        DataSet ds = VistaBOL.Select_Category_DS(filmCode);

        if (promotions == false)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                ddl_Category.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString() + ", Rs. " + String.Format("{0:#.##}",
                                                                                                                  decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
            }
        }
        else
        {
            KoDTicketingLibrary.DTO.Promotion PromoSession = (KoDTicketingLibrary.DTO.Promotion)Session["a" + Decrypt(Request.QueryString["promo"])];
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (ds.Tables[0].Rows[i][0].ToString() == "BZ")
                {
                    if (PromoSession.BZ == 1)
                    {
                        ddl_Category.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString() + ", Rs. " + String.Format("{0:#.##}",
                                                                                                                          decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
                    }
                }
                else if (ds.Tables[0].Rows[i][0].ToString() == "CO")
                {
                    if (PromoSession.CO == 1)
                    {
                        ddl_Category.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString() + ", Rs. " + String.Format("{0:#.##}",
                                                                                                                          decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
                    }
                }
                else if (ds.Tables[0].Rows[i][0].ToString() == "SL")
                {
                    if (PromoSession.SL == 1)
                    {
                        ddl_Category.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString() + ", Rs. " + String.Format("{0:#.##}",
                                                                                                                          decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
                    }
                }
                else if (ds.Tables[0].Rows[i][0].ToString() == "DM")
                {
                    if (PromoSession.DM == 1)
                    {
                        ddl_Category.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString() + ", Rs. " + String.Format("{0:#.##}",
                                                                                                                          decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
                    }
                }
                else if (ds.Tables[0].Rows[i][0].ToString() == "PL")
                {
                    if (PromoSession.PL == 1)
                    {
                        ddl_Category.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString() + ", Rs. " + String.Format("{0:#.##}",
                                                                                                                          decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
                    }
                }
                else if (ds.Tables[0].Rows[i][0].ToString() == "GL")
                {
                    if (PromoSession.GL == 1)
                    {
                        ddl_Category.Items.Add(new ListItem(ds.Tables[0].Rows[i][1].ToString() + ", Rs. " + String.Format("{0:#.##}",
                                                                                                                          decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
                    }
                }
            }
        }
        // UpdatePanel2.Update();
    }
Example #3
0
        public static List<Promotion> GetPromostionCode()
        {
            DataTable dt = VistaDAL.GetPromostionCode();
            List<Promotion> listPromo = new List<Promotion>();
            Promotion objPromotion;
            if (dt != null)
            {
                foreach (DataRow row in dt.Rows)
                {
                    if (!String.IsNullOrEmpty(row["Regex"].ToString()))
                    {
                        objPromotion = new Promotion();
                        if (!row.IsNull("Promotion Code"))
                        {
                            objPromotion.PromotionCode = row["Promotion Code"].ToString();
                        }
                        if (!row.IsNull("Start Date"))
                        {
                            objPromotion.StartDate = Convert.ToDateTime(row["Start Date"]);
                        }
                        if (!row.IsNull("End date"))
                        {
                            objPromotion.EndDate = Convert.ToDateTime(row["End date"]);
                        }
                        if (!row.IsNull("Discount %"))
                        {
                            objPromotion.DiscountPercentage = Convert.ToDecimal(row["Discount %"]);
                        }
                        if (!row.IsNull("RegEx"))
                        {
                            objPromotion.RegexValidator = Convert.ToString(row["RegEx"]);
                        }
                        if (!row.IsNull("CO"))
                        {
                            objPromotion.CO = Convert.ToInt16(row["CO"]);
                        }
                        if (!row.IsNull("BZ"))
                        {
                            objPromotion.BZ = Convert.ToInt16(row["BZ"]);
                        }
                        if (!row.IsNull("DM"))
                        {
                            objPromotion.DM = Convert.ToInt16(row["DM"]);
                        }
                        if (!row.IsNull("GL"))
                        {
                            objPromotion.GL = Convert.ToInt16(row["GL"]);
                        }
                        if (!row.IsNull("SL"))
                        {
                            objPromotion.SL = Convert.ToInt16(row["SL"]);
                        }
                        if (!row.IsNull("PL"))
                        {
                            objPromotion.PL = Convert.ToInt16(row["PL"]);
                        }

                        listPromo.Add(objPromotion);
                    }
                }
            }
            return listPromo;
        }
Example #4
0
 protected void btnCancel_Click(object sender, EventArgs e)
 {
     KoDTicketing.GTICKV.LogEntry(trnsectioncounter.ToString(), "User Press Cancel Button On seat Layout Page.", "3", "");
     if (sessionvalue[10] == "")
     {
         if (Request.QueryString["March"] != null)
         {
             Session.Clear();
             Response.Redirect("MarchPromotion.aspx", false);
         }
         else if (Request.QueryString["Router"] == "buzzintown")
         {
             Session.Clear();
             Response.Redirect("default.aspx?Router=buzzintown", false);
         }
         else if (Request.QueryString["Router"] == "airfaresau")
         {
             Response.Redirect("default.aspx?Router=airfaresau", false);
         }
         else
         {
             Session.Clear();
             Response.Redirect("default.aspx", false);
         }
     }
     else if (sessionvalue[10] != "")
     {
         KoDTicketingLibrary.DTO.Promotion PromoSession = (KoDTicketingLibrary.DTO.Promotion)Session[sessionvalue[10]];
         if (PromoSession.PromotionCode.ToString().ToUpper() == "MMT")
         {
             Session.Clear();
             Response.Redirect("MMTUSPromotion.aspx", false);
         }
         else if (PromoSession.PromotionCode.ToString().ToUpper() == "MMTDOMESTIC")
         {
             Session.Clear();
             Response.Redirect("MakeMyTripPromotion.aspx", false);
         }
         else if (PromoSession.PromotionCode.ToString().ToUpper() == "MANA")
         {
             Session.Clear();
             Response.Redirect("ManaPromotion.aspx", false);
         }
         else if (PromoSession.PromotionCode.ToString().ToUpper() == "YATRA")
         {
             Session.Clear();
             Response.Redirect("YatraPromotions.aspx", false);
         }
         else if (PromoSession.PromotionCode.ToString().ToUpper() == "MCWORLD")
         {
             Session.Clear();
             Response.Redirect("MasterCard-WcPromotions.aspx", false);
         }
         else if (PromoSession.PromotionCode.ToString().ToUpper() == "MCOTHERS")
         {
             Session.Clear();
             Response.Redirect("MasterCard-NwcPromotions.aspx", false);
         }
         else if (PromoSession.PromotionCode.ToString().ToUpper() == "OCTOBERFEST")
         {
             if (Request.QueryString["Router"] == "buzzintown")
             {
                 Session.Clear();
                 Response.Redirect("OctoberFest.aspx?Router=buzzintown", false);
             }
             else
             {
                 Session.Clear();
                 Response.Redirect("OctoberFest.aspx", false);
             }
         }
         else if (PromoSession.PromotionCode.ToString().ToUpper() == "JHUMROOOFFER")
         {
             Session.Clear();
             Response.Redirect("JhumrooOffer.aspx", false);
         }
         else
         {
             Session.Clear();
             Response.Redirect("HotelsPromotion.aspx", false);
         }
     }
     else
     {
         Session.Clear();
         Response.Redirect("default.aspx", false);
     }
 }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        long transid         = 0;
        TransactionRecord tr = new TransactionRecord();

        try
        {
            #region Session based
            if (Session["seat_Val"] != null && Session["Seat_TransactionID"] != null)
            {
                try
                {
                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(string.Format("Transaction [{0}]  Seats [{1}]", Session["Seat_TransactionID"].ToString(), Session["seat_Val"].ToString()));
                    tr.BookingID = long.Parse(Session["Seat_TransactionID"].ToString());
                    string[] strarr = Session["seat_Val"].ToString().Split(',');
                    if (Session["AgentCode"] != null)
                    {
                        tr.AgentCode = Session["AgentCode"].ToString();
                        tr.Source    = "MSAGENT";
                    }
                    else
                    {
                        tr.AgentCode = "WEB";
                        tr.Source    = "WEB";
                    }
                    tr.BookingType = "INDIVIDUAL";
                    //tr.VoucherType = rblVoucher.SelectedValue;
                    //tr.VoucherNo = "";
                    //tr.VoucherBookingID = 0;
                    tr.CardType       = rbl_CardType.SelectedItem.Text;
                    tr.PaymentGateway = rbl_CardType.SelectedValue;
                    tr.CardNo         = "1111222233334444";
                    tr.MobileNo       = txtContactNo.Text;
                    tr.Name           = Session["FirstName"].ToString() + Session["LastName"].ToString();
                    tr.PaymentType    = ddlPaymentMode.SelectedItem.Text;
                    tr.DateOfBooking  = DateTime.Now.Date.ToShortDateString();

                    bool istrue = emailsnd.Checked;
                    Session["Istrue"] = istrue;
                    tr.IsChecked      = istrue;
                    tr.EmailID        = txtEmailAddress.Text;

                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IsChecked" + istrue);

                    tr.PlaceOfPick           = "";
                    tr.TimeOfPick            = "";
                    Session["Complimentary"] = "false";
                    tr.WantComplimentary     = false;

                    tr.Status        = false;
                    tr.TimeOfBooking = DateTime.Now.ToShortTimeString();

                    tr.TotalSeats = int.Parse(strarr[5].ToString());
                    tr.Category   = strarr[8];
                    tr.Location   = strarr[6];
                    tr.Play       = strarr[1];
                    //replace "-"with "/"
                    //string[] datarr = strarr[2].ToString().Split('/'); // for live server
                    string[] datarr = strarr[2].ToString().Split('-'); // for dev/local
                    //replace datarr[0] to datarr[1]
                    //tr.ShowDate = datarr[1] + "/" + datarr[0] + "/" + datarr[2]; // for live server
                    tr.ShowDate = datarr[0] + "/" + datarr[1] + "/" + datarr[2];  // for dev/local

                    tr.ShowTime = strarr[7];
                    tr.Day      = Convert.ToDateTime(tr.ShowDate).DayOfWeek.ToString();
                    // for dev/local, swap month & date above after day has been calculated above
                    //comment below two lines
                    //tr.ShowDate = tr.ShowDate.Replace(datarr[1], datarr[0]);
                    //tr.ShowDate = tr.ShowDate.Replace("30", datarr[1]);
                    tr.Remark              = "";
                    tr.TotalAmount         = GTICKBOL.Get_SeatPrice_SeatKeyNoWise(tr.BookingID);
                    Session["TotalAmount"] = tr.TotalAmount;
                    tr.SeatInfo            = Session["Seat_info"].ToString();
                    tr.Address             = Session["Address"].ToString().Trim();
                    //+ Session["Address2"].ToString()
                    tr.IP = GetIP();

                    //******Promotion code related changes START*****

                    if (Session["PromotionCode"] != null)
                    {
                        KoDTicketingLibrary.DTO.Promotion PromoSession = (KoDTicketingLibrary.DTO.Promotion)Session["PromotionCode"];
                        tr.PromotionCode      = PromoSession.PromotionCode;
                        tr.DiscountPercentage = PromoSession.DiscountPercentage;
                        tr.WebPromotionId     = PromoSession.WebPromotionId;
                        tr.DiscountedAmount   = (GTICKBOL.Get_SeatPrice_SeatKeyNoWise(tr.BookingID) - (GTICKBOL.Get_SeatPrice_SeatKeyNoWise(tr.BookingID) * PromoSession.DiscountPercentage / 100));
                    }
                    //******Promotion code related changes END*****



                    //******RoyalCard related changes START*****

                    tr.RegId         = Session["Regid"].ToString();
                    tr.AvailedAmount = Convert.ToDecimal(Session["RedeemBalance"]);
                    tr.AvailedPoints = Convert.ToDecimal(Session["RedeemPoints"]);
                    tr.TopUpAmount   = tr.TotalAmount - (Convert.ToDecimal(Session["RedeemPoints"]) + Convert.ToDecimal(Session["RedeemBalance"]));
                    if (tr.TopUpAmount != 0)
                    {
                        tr.TopUpTransactionId = TransactionBOL.Card_Transaction(tr.RegId, tr.TopUpAmount, DateTime.Now, tr.RegId, 0);
                    }
                    tr.OptionalEmail   = txtEmail.Text;
                    tr.OptionalContact = txtmobileno.Text;
                    //******RoyalCard related changes END*****



                    transid = TransactionBOL.Transaction_Temp_Insert(tr);
                }
                catch (Exception ex)
                {
                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Transaction Preparation Error: " + ex.Message);
                }
                GTICKV.LogEntry(tr.BookingID.ToString(), "Category : " + tr.Category + " ,Seat Info : " + tr.SeatInfo +
                                ", Total Amt : " + tr.TotalAmount, "6", "");

                //******Promotion code send discounted AMOUNT to payment gateway changes START*****
                if (Session["PromotionCode"] != null)
                {
                    KoDTicketingLibrary.DTO.Promotion ObjPromoSession = (KoDTicketingLibrary.DTO.Promotion)Session["PromotionCode"];
                    tr.TotalAmount = 0;
                    DataTable prices = GTICKBOL.Get_AllSeatPrice_SeatKeyNoWise(tr.BookingID);
                    if (prices != null)
                    {
                        foreach (DataRow dr in prices.Rows)
                        {
                            decimal SinglePrice     = decimal.Parse(dr[0].ToString());
                            decimal DiscountedPrice = SinglePrice - (SinglePrice * ObjPromoSession.DiscountPercentage / 100);
                            DiscountedPrice = decimal.Truncate(DiscountedPrice);
                            if (DiscountedPrice == 1274)
                            {
                                DiscountedPrice = DiscountedPrice + 1;
                            }
                            else if (DiscountedPrice == 2124)
                            {
                                DiscountedPrice = DiscountedPrice + 1;
                            }
                            else if (DiscountedPrice == 2974)
                            {
                                DiscountedPrice = DiscountedPrice + 1;
                            }
                            else if (DiscountedPrice == 4249)
                            {
                                DiscountedPrice = DiscountedPrice + 1;
                            }
                            tr.TotalAmount += DiscountedPrice;
                            Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Discounted Price For a Ticket" + DiscountedPrice.ToString());
                        }
                    }
                }
                //*******Promotion code send discounted AMOUNT to payment gateway changes END here **********


                tr.TotalAmount = (tr.TotalAmount) - (tr.AvailedPoints + tr.AvailedAmount);

                if (transid > 0)
                {
                    Session["AgentCode"] = null;
                    GTICKV.LogEntry(tr.BookingID.ToString(), "Data Successfully Written to Temp Transaction Table", "7", transid.ToString());
                    if (Session["PayableAmount"].ToString() == "0")
                    {
                        Session["BookingID"] = tr.BookingID;
                        Session["ID"]        = transid.ToString();
                        Response.Redirect("Payment/Print-Receipt.aspx");
                    }
                    else
                    {
                        string URL = "";
                        //Pay Details , Sent To Loyalty Card Page --  CardType,TransID,Amt,ShowName
                        //Session["PayDetailsTemp"] = rblVoucher.SelectedValue + "|" + tr.BookingID.ToString() + "_" + transid + "~" + tr.AgentCode + "|" + tr.TotalAmount + "|" + tr.Play;
                        Session["PayDetailsTemp"] = tr.BookingID.ToString() + "_" + transid + "~" + tr.AgentCode + "|" + tr.TotalAmount + "|" + tr.Play;

                        if (ddlPaymentMode.SelectedValue == "CREDIT")
                        {
                            if (rbl_CardType.SelectedValue == "IDBI")
                            {
                                GTICKV.LogEntry(tr.BookingID.ToString(), "Sending to IDBI Payment Gateway", "8", transid.ToString());
                                URL = "../../Payment/Idbi/Default.aspx?type=idbi&transid=" + tr.BookingID.ToString() + "_" + transid + "~" + tr.AgentCode + "~royal_card_payment_idbi" + "&amt=" + tr.TotalAmount
                                      + "&show=" + tr.Play;
                            }
                            else if (rbl_CardType.SelectedValue == "AMEX")
                            {
                                GTICKV.LogEntry(tr.BookingID.ToString(), "Sending to AMEX Payment Gateway", "8", transid.ToString());
                                URL = "Payment/Web/Default.aspx?type=amex&transid=" + tr.BookingID.ToString() + "_" + transid + "~" + tr.AgentCode + "&amt=" + tr.TotalAmount
                                      + "&show=" + tr.Play;
                            }
                            else if (rbl_CardType.SelectedValue == "HDFC")
                            {
                                //string check = gb.HDFCLogCheck(transid.ToString()).Rows[0]["Amount"].ToString();
                                GTICKV.LogEntry(tr.BookingID.ToString(), "Sending to HDFC Payment Gateway", "8", transid.ToString());
                                string trackId, amount;
                                //Random Rnd = new Random();
                                //trackId = Rnd.Next().ToString();		//Merchant Track ID, this is as per merchant logic
                                trackId            = tr.BookingID.ToString() + "_" + transid + "-" + tr.AgentCode;
                                Session["trackId"] = trackId;
                                amount             = tr.TotalAmount.ToString();
                                Session["amount"]  = amount;

                                String ErrorUrl    = KoDTicketingIPAddress + "RoyalCard/Account/Payment/HDFC/Error.aspx";
                                String ResponseUrl = KoDTicketingIPAddress + "RoyalCard/Account/Payment/HDFC/ReturnReceipt.aspx";

                                //string qrystr = "id=" + HDFCTransPortalID + "&password="******"&action=1&langid=USA&currencycode=356&amt=" + Server.UrlEncode(amount)
                                //    + "&responseURL=" + Server.UrlEncode(ResponseUrl) + "&errorURL=" + Server.UrlEncode(ErrorUrl)
                                //    + "&trackid=" + trackId
                                //    + "&udf1=TicketBooking&udf2=" + Server.UrlEncode(txtEmailAddress.Text.Trim())
                                //    + "&udf3=" + Server.UrlEncode(txtISDCode.Text + txtContactNo.Text) + "&udf4=" + Server.UrlEncode(txtAddress.Text.Trim()) + "&udf5=" + tr.BookingID;

                                string qrystr = "id=" + HDFCTransPortalID + "&password="******"&action=1&langid=USA&currencycode=356&amt=" + amount
                                                + "&responseURL=" + Server.UrlEncode(ResponseUrl) + "&errorURL=" + Server.UrlEncode(ErrorUrl)
                                                + "&trackid=" + trackId
                                                + "&udf1=TicketBooking&udf2=" + txtEmailAddress.Text.Trim()
                                                + "&udf3=" + Server.UrlEncode(txtISDCode.Text.TrimStart('+') + txtContactNo.Text) + "&udf4=" + Server.UrlEncode(tr.Address.ToString()) + "&udf5=" + tr.BookingID.ToString();

                                Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Preparing for HDFC Payment..." + qrystr);

                                //Writefile_new("\n***************Initial Request********************", Server.MapPath("~"));
                                //Writefile_new("\n\nDateTime:" + DateTime.Now.ToString("dd/MM/yy HH:mm:ss") + " Reference No:" + trackId + "Request XML:" + qrystr, Server.MapPath("~"));

                                System.IO.StreamWriter requestWriter = null;
                                Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Redirecting for HDFC Payment..." + HDFCTransUrl);
                                System.Net.HttpWebRequest objRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(HDFCTransUrl);   //create a SSL connection object server-to-server
                                objRequest.Method          = "POST";
                                objRequest.ContentLength   = qrystr.Length;
                                objRequest.ContentType     = "application/x-www-form-urlencoded";
                                objRequest.CookieContainer = new System.Net.CookieContainer();
                                try
                                {
                                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Processing request for HDFC Payment...");
                                    requestWriter = new System.IO.StreamWriter(objRequest.GetRequestStream());  // here the request is sent to payment gateway
                                    requestWriter.Write(qrystr);
                                }
                                catch (Exception ex)
                                {
                                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Excetion while processing HDFC payment: " + trackId + ex.Message);
                                }

                                if (requestWriter != null)
                                {
                                    requestWriter.Close();
                                }

                                Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Review validation response from HDFC Payment Gateway...");
                                System.Net.HttpWebResponse objResponse = (System.Net.HttpWebResponse)objRequest.GetResponse();

                                //System.Net.CookieContainer responseCookiesContainer = new System.Net.CookieContainer();
                                //foreach (System.Net.Cookie cook in objResponse.Cookies)
                                //{
                                //    responseCookiesContainer.Add(cook);
                                //}

                                using (System.IO.StreamReader sr =
                                           new System.IO.StreamReader(objResponse.GetResponseStream()))
                                {
                                    String NSDLval = sr.ReadToEnd();
                                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Response: " + NSDLval);
                                    if (NSDLval.Contains("Invalid User Defined Field"))
                                    {
                                        lblMess.Text = "The information submitted contains some invalid character, please avoid using [+,-,#] etc.";
                                        return;
                                    }

                                    //Writefile_new("\n***************Initial Response********************", Server.MapPath("~"));
                                    //Writefile_new("\n\nDateTime:" + DateTime.Now.ToString("dd/MM/yy HH:mm:ss") + " Reference No:" + trackId + "Request XML:" + NSDLval, Server.MapPath("~"));
                                    if (NSDLval.IndexOf("http") == -1)
                                    {
                                        lblMess.Text = "Payment cannot be processed with information provided.";
                                        return;
                                    }

                                    // gb.HDFCLog(transid.ToString(), "", trackId, "***Initial Response*** : " + NSDLval);
                                    string strPmtId  = NSDLval.Substring(0, NSDLval.IndexOf(":http"));  // Merchant MUST map (update) the Payment ID received with the merchant Track Id in his database at this place.
                                    string strPmtUrl = NSDLval.Substring(NSDLval.IndexOf("http"));
                                    if (strPmtId != String.Empty && strPmtUrl != String.Empty)
                                    {
                                        URL = strPmtUrl.ToString() + "?PaymentID=" + strPmtId;
                                    }
                                    else
                                    {
                                        lblMess.Text = "Invalid Response!";
                                    }
                                    sr.Close();
                                }
                            }//HDFC
                        }
                        //else if (ddlPaymentMode.SelectedValue == "VOUCHER")
                        //{
                        //    Session["PayDetailsTemp"] = rblVoucher.SelectedValue + "|" + tr.BookingID.ToString() + "_" + transid + "~" + tr.AgentCode + "|" + tr.TotalSeats;
                        //    URL = "~/Payment/Voucher/Voucher.aspx";
                        //}
                        Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Payment Redirection: " + URL);
                        Response.Redirect(URL, false);
                    }
                }
                else
                {
                    lblMess.Text = "Session Timeout. Please start the transaction again by clicking \"Back\" button";
                    Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Session Timeout. Need to restart transaction");
                }
            }
            else //no Session[seat_val]
            {
                ClientScript.RegisterStartupScript(GetType(), "myscript", "<script>alert('Session Timeout. Please start the transaction again');window.location.href='TicketBooking.aspx';</script>");
            }
            #endregion
        }
        catch (Exception ex)
        {
            GTICKV.LogEntry(tr.BookingID.ToString(), "Error Occurred - " + ex.Message.Replace("'", ""), "8", transid.ToString());
        }
    }