protected void Page_Load(object sender, EventArgs e) { if (Session["shownaudit_detail"].ToString() != "") { Session_value = Session["shownaudit_detail"].ToString(); sessionvalue = Session_value.Split(','); } if (!IsPostBack) { DataTable dtdelete = TransactionBOL.Delete_Iscomplete(); DataTable dt = TransactionBOL.Check_AuditDetails(sessionvalue[3].ToString(), sessionvalue[0].ToString(), DateTime.Now.ToString("dd/MM/yyyy"), sessionvalue[2].ToString()); if (dt.Rows.Count == 0) { Session["AuditNo"] = 1; SessionAuditno = Session["AuditNo"].ToString(); } else { Session["AuditNo"] = 2; SessionAuditno = Session["AuditNo"].ToString(); } } set_seatLayout(); //booked(); }
protected void btnvalidation_Click(object sender, EventArgs e) { // DataTable dtroyalinfo = VistaBOL.Select_Newyear_RoyalInfo(textroyalinfo.Text); DataTable dtroyalinfo = TransactionBOL.selectifo_royal(textroyalinfo.Text); if (textroyalinfo.Text == "") { ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Please enter Royal Card No. or Mobile No.');", true); pricecouple.Text = "11999"; pricesingle.Text = "6999"; priceteen.Text = "3999"; pricekids.Text = "2999"; } else if (dtroyalinfo.Rows.Count > 0) { pricecouple.Text = "9999"; pricesingle.Text = "5999"; priceteen.Text = "3999"; pricekids.Text = "2999"; } else { ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Royal Card No. or Mobile No. not matched.');", true); pricecouple.Text = "11999"; pricesingle.Text = "6999"; priceteen.Text = "3999"; pricekids.Text = "2999"; textroyalinfo.Text = ""; } }
protected void btnGo_Click(object sender, EventArgs e) { long BookingID = txt_BookingID.Text.Length > 0 ? long.Parse(txt_BookingID.Text) : 0; string ReceiptNo = txt_ReceiptNo.Text.Length > 0 ? txt_ReceiptNo.Text : "0"; string DateOfBooking = txt_BookingDate.Text.Length > 0 ? txt_BookingDate.Text : "0"; string Location = txt_bookingDateTo.Text.Length > 0 ? txt_bookingDateTo.Text : "0"; string ShowDate = txt_ShowDate.Text.Length > 0 ? txt_ShowDate.Text : "0"; string MobileNo = txt_ShowDateTo.Text.Length > 0 ? txt_ShowDateTo.Text : "0"; string Name = txt_Name.Text.Length > 0 ? txt_Name.Text : "0"; string PaymentType = dlStatus.SelectedValue; string AgentCode = ddlAgent.SelectedValue; DataSet ds = TransactionBOL.get_ALL_LogDetails(BookingID, ReceiptNo, DateOfBooking, Location, ShowDate, MobileNo, Name, AgentCode, PaymentType); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { btnPrint.Disabled = false; Btn_Excel.Enabled = true; gv_Report.DataSource = ds; if (dlStatus.SelectedValue != "0") { lblMess12.Text = ds.Tables[0].Rows.Count + " Records found for <u>" + dlStatus.SelectedItem.Text + "</u>"; } } else { btnPrint.Disabled = true; Btn_Excel.Enabled = false; lblMess12.Text = "No records Found!"; } gv_Report.DataBind(); }
protected void btnCreateAudit_Click(object sender, EventArgs e) { Btn_ShowAuditNo1.Enabled = false; lblValidation.Visible = false; try { btnPrint.Disabled = false; Btn_Excel.Enabled = true; string ShowName = ddl_Play.SelectedValue; string ShowLocation = ddl_Location.SelectedValue; string ShowDate = dateofshow.Text.Length > 0 ? dateofshow.Text : "0"; string ShowTime = ddl_ShowTimes.SelectedValue; string ShowTime1 = ddl_ShowTimes.SelectedItem.Text; string ShowDate1 = Convert.ToDateTime(dateofshow.Text.ToString()).ToString("dd/MM/yyyy"); DataTable dtauditno1report = TransactionBOL.AuditNumber1Report(ShowTime1, ShowDate1, ShowName, ShowLocation); if (dtauditno1report != null && dtauditno1report.Rows.Count > 0) { gv_Report.DataSource = dtauditno1report; gv_Report.DataBind(); } else { btnPrint.Disabled = true; Btn_Excel.Enabled = false; lblMess.Text = "No Records Found!"; } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("MasterCard-NwcDetail.Aspx page."); if (!IsPostBack) { url = Request.UrlReferrer.ToString(); divshow.Visible = false; div2.Visible = false; DataTable dtbankname = TransactionBOL.Select_BankNamenonwc(); if (dtbankname != null && dtbankname.Rows.Count > 0) { foreach (DataRow dr in dtbankname.Rows) { ddlbankname.Items.Add(new ListItem(dr[0].ToString(), dr[0].ToString())); } } } if (url == "http://localhost/KOD.Web_1/MasterCard-NwcPromotions.aspx") { Session["PROMOTIONMCOTHERS"] = "MCOTHERS"; } else { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Redirect from other source."); Session["PROMOTIONMCOTHERS"] = null; } lblMsgPromotionCode.Visible = false; }
protected void btnGo_Click(object sender, EventArgs e) { try { if (Page.IsPostBack) { lblMess.Text = "No Records Found!"; gv_Report.Dispose(); gv_Report.DataBind(); } string DateFrom = txt_Date.Text.Length > 0 ? txt_Date.Text : "0"; string DateTo = txt_DateTo.Text.Length > 0 ? txt_DateTo.Text : "0"; DataSet ds = TransactionBOL.Select_Report_tbl_Digitalkasos(DateFrom, DateTo); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { Btn_Excel.Enabled = true; btnPrint.Disabled = false; gv_Report.DataSource = ds; lblMess.Text = ""; } else { btnPrint.Disabled = true; Btn_Excel.Enabled = false; lblMess.Text = "No Records Found!"; } gv_Report.DataBind(); } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(ex.Message); } }
public string FinalStatus(string id) { DataTable dt = TransactionBOL.Select_EventTransaction(id); DataRow dr = dt.Rows[0]; return(dr["PGIsPaymentSuccess"].ToString() + "," + dr["BookingID"].ToString() + "," + dr["PGReceiptId"].ToString()); }
protected void HandleFailure(TransactionRecord tr) { #region handlefailure String _refNo = tr.ReferenceNo.ToString(); KoDTicketing.GTICKV.LogEntry(tr.ReferenceNo.ToString(), "IDBI Error Occured -- Payment Not Successful", "27", tr.ReferenceNo.ToString()); long BookingID = long.Parse(tr.ReferenceNo.ToString()); try { DataTable dt = TransactionBOL.Select_Temptransaction_REFIDWISE(BookingID); if (dt.Rows.Count == 0) { ReceiptUtils.FailurePaymentResponse(); } else { ReceiptUtils.FailurePaymentResponse(dt.Rows[0]); } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Error occurred processing unsuccessful payment through IDBI..." + ex.Message); } #endregion handlefailure }
public TransactionRecord GetPromotionDetails(TransactionRecord tr) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID Response from PG " + tr.BookingID.ToString()); if (tr.BookingID.ToString().Substring(0, 2) == "31") { DataTable chkID = TransactionBOL.Select_MarchPromotionTransactionCounter_CounterIDWise(tr.BookingID); if (chkID.Rows.Count > 0) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID and Conter from March Promotion Table " + chkID.Rows[0][1].ToString() + "," + chkID.Rows[0][0].ToString()); if (chkID.Rows[0][0].ToString().Substring(0, 2) == "31") { tr.BookingID = long.Parse(chkID.Rows[0][1].ToString()); } } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID after Switch " + tr.BookingID.ToString()); } DataTable dttransaction = TransactionBOL.Select_Temptransaction_transactionIDWise(tr.BookingID); if (dttransaction.Rows.Count > 0) { DataRow dr = dttransaction.Rows[0]; decimal DiscountPercentage = decimal.Parse(dr["DiscountPercentage"].ToString()); tr.PromotionCode = dr["PromotionCode"].ToString(); tr.DiscountPercentage = DiscountPercentage; tr.WebPromotionId = dr["WebPromotionId"].ToString(); } return(tr); }
protected void btnSubmit_Click(object sender, EventArgs e) { v(); if (v()) { DataTable err = TransactionBOL.insertdetail(RdGender.SelectedItem.ToString(), txtFirstName.Text, txtLastName.Text, txtAddress.Text, txtCity.Text, DdlCountry.Text, txtEmailId.Text, txtpin.Text, txtMobileNo.Text, ddlday.SelectedItem + "-" + ddlmonth.SelectedValue + "-" + ddlyear.SelectedValue, RdMartialStatus.SelectedItem.ToString(), DateTime.Now, CardNo, BankName, CardType, DropDownList1.SelectedItem + "-" + DropDownList2.SelectedValue + "-" + DropDownList3.SelectedValue); if (err != null && err.Rows.Count > 0) { foreach (DataRow dr in err.Rows) { msg = dr[0].ToString(); } if (msg != "Sorry, You are already enrolled for Membership") { DataTable dt = TransactionBOL.Select_RoyalCardMcDetail_REFIDWISE(txtEmailId.Text, txtMobileNo.Text); ReceiptUtils.RoyalCardMcResponse(dt.Rows[0]); ReceiptUtils.RoyalCardMcResponseloyality(dt.Rows[0], ConfigurationManager.AppSettings.Get("royal")); } } lblmsg.Text = msg; grayBG.Visible = true; showcontainer.Visible = true; Container.Visible = true; clear(); Session.Abandon(); } }
protected void btnGo_Click(object sender, EventArgs e) { decimal discountamt = 0; TransactionRecord tr = new TransactionRecord(); tr.BookingID = txt_BookingID.Text.Length > 0 ? long.Parse(txt_BookingID.Text) : 0; tr.ReceiptNo = txt_ReceiptNo.Text.Length > 0 ? txt_ReceiptNo.Text : "0"; tr.DateOfBooking = txt_BookingDate.Text.Length > 0 ? txt_BookingDate.Text : "0"; tr.Location = txt_bookingDateTo.Text.Length > 0 ? txt_bookingDateTo.Text : "0"; tr.ShowDate = txt_ShowDate.Text.Length > 0 ? txt_ShowDate.Text : "0"; tr.MobileNo = txt_ShowDateTo.Text.Length > 0 ? txt_ShowDateTo.Text : "0"; tr.Name = txt_Name.Text.Length > 0 ? txt_Name.Text : "0"; tr.AgentCode = ddlAgent.SelectedValue; DataSet ds = TransactionBOL.Select_Report_FromTransactionTable(tr); if (ds.Tables[0].Rows.Count > 0) { Btn_Excel.Enabled = true; btnPrint.Disabled = false; //for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //{ // if (ds.Tables[0].Rows[i][10].ToString() == "") // { // discountamt = discountamt + decimal.Parse(dr[2].ToString()); // } //} gv_Report.DataSource = ds.Tables[0]; lblMess.Text = ""; gv_Report.DataBind(); if (ds.Tables[1].Rows.Count > 0) { string card = ""; foreach (DataRow dr in ds.Tables[1].Rows) { Seats = Seats + int.Parse(dr[0].ToString()); totamt = totamt + decimal.Parse(dr[1].ToString()); if (dr[2].ToString() !="") { discountamt = discountamt + decimal.Parse(dr[2].ToString()); card += "<br/>Amount Received Using " + dr[3] + " : " + dr[2]; } //card += "<br/>Amount Received Using " + dr[3] + " : " + dr[2]; } lblTotSeats.Text = card; } gv_Report.FooterRow.Cells[0].Text = "Total"; gv_Report.FooterRow.Cells[1].Text = Seats.ToString(); gv_Report.FooterRow.Cells[2].Text = totamt.ToString(); gv_Report.FooterRow.Cells[3].Text = discountamt.ToString(); } else { btnPrint.Disabled = true; Btn_Excel.Enabled = false; lblMess.Text = "No Records Found!"; } }
protected void btnGo_Click(object sender, EventArgs e) { try { if (Page.IsPostBack) { lblMess.Text = "No Records Found!"; gv_Failed.Dispose(); gv_Report.Dispose(); gv_Report.DataBind(); gv_Failed.DataBind(); } long BookingID = txt_BookingID.Text.Length > 0 ? long.Parse(txt_BookingID.Text) : 0; string ReceiptNo = txt_ReceiptNo.Text.Length > 0 ? txt_ReceiptNo.Text : "0"; string Name = txt_Name.Text.Length > 0 ? txt_Name.Text : "0"; string today = DateTime.Today.ToShortDateString(); string daysfromtoday = DateTime.Today.Subtract(TimeSpan.FromDays(30)).ToShortDateString(); DataSet ds = TransactionBOL.Select_Report_SearchFromTransactions_DS(BookingID, ReceiptNo, daysfromtoday, today, "0", "0", Name, "0"); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { gv_Report.DataSource = ds; lblMess.Text = "BOOKINGS IN LAST 30 DAYS"; gv_Report.DataBind(); } else { lblMess.Text = "NO BOOKINGS IN LAST 30 DAYS"; } TransactionRecord tr = new TransactionRecord(); tr.BookingID = txt_BookingID.Text.Length > 0 ? long.Parse(txt_BookingID.Text) : 0; tr.ReceiptNo = txt_ReceiptNo.Text.Length > 0 ? txt_ReceiptNo.Text : "0"; tr.DateOfBooking = daysfromtoday; //location is bookingDate to tr.Location = today; tr.ShowDate = "0"; // ShowDateFrom tr.MobileNo = "0"; //used as ShowDateTo tr.Name = txt_Name.Text.Length > 0 ? txt_Name.Text : "0"; ds = TransactionBOL.Select_Report_SearchFromTransactionsTemp_DS(tr); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { gv_Failed.DataSource = ds; lblMess2.Text = "FAILED TRANSACTIONS IN LAST 30 DAYS"; gv_Failed.DataBind(); } else { lblMess2.Text = "NO FAILED TRANSACTION IN LAST 30 DAYS"; } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(ex.Message); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (Txtcardno.Text == "") { lblmsg.Visible = true; lblmsg.Text = "Please Enter Six Digits of Your World Card-Master Card."; Txtcardno.Focus(); return; } if (Txtcardno.Text.Length < 6) { lblmsg.Visible = true; lblmsg.Text = "Please Enter Six Digits of Your World Card-Master Card."; Txtcardno.Focus(); return; } if (ddlbankname.SelectedItem.ToString() == "Select Bank Name") { lblmsg.Visible = true; lblmsg.Text = "Please select Bank Name"; ddlbankname.Focus(); return; } else { DataTable dtvalidation = TransactionBOL.Validation(int.Parse(Txtcardno.Text)); if (dtvalidation != null && dtvalidation.Rows.Count > 0) { foreach (DataRow dr in dtvalidation.Rows) { if (dr[0].ToString() == ddlbankname.SelectedItem.ToString()) { Session["cardno"] = Txtcardno.Text; Session["BankName"] = ddlbankname.SelectedItem; Session["CardType"] = "Platinum"; Response.Redirect("Details.aspx"); } else { lblmsg.Visible = true; lblmsg.Text = "Either Card Number or Bank name is incorrect."; Txtcardno.Focus(); return; } } } else { grayBG.Visible = true; showcontainer.Visible = true; Container.Visible = true; } } }
public TransactionRecord GetRoyalCardDetails(TransactionRecord tr) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID Response from PG " + tr.BookingID.ToString()); if (tr.BookingID.ToString().Substring(0, 2) == "31") { DataTable chkID = TransactionBOL.Select_MarchPromotionTransactionCounter_CounterIDWise(tr.BookingID); if (chkID.Rows.Count > 0) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID and Conter from March Promotion Table " + chkID.Rows[0][1].ToString() + "," + chkID.Rows[0][0].ToString()); if (chkID.Rows[0][0].ToString().Substring(0, 2) == "31") { tr.BookingID = long.Parse(chkID.Rows[0][1].ToString()); } } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Booking ID after Switch " + tr.BookingID.ToString()); } DataTable dttransaction = TransactionBOL.Select_Temptransaction_transactionIDWise(tr.BookingID); if (dttransaction.Rows.Count > 0) { DataRow dr = dttransaction.Rows[0]; string RegId = dr["RegId"].ToString(); if (!string.IsNullOrEmpty(RegId)) { tr.RegId = dr["RegId"].ToString(); if (dr["TopUpTransactionId"] != null) { tr.TopUpTransactionId = dr["TopUpTransactionId"].ToString(); } tr.AvailedAmount = Convert.ToDecimal(dr["AvailedAmount"]); tr.AvailedPoints = Convert.ToDecimal(dr["AvailedPoints"]); tr.TopUpAmount = Convert.ToDecimal(dr["TopUpAmount"]); tr.TotalAmount = Convert.ToDecimal(dr["TotalAmount"]); if (dr["Play"] != null) { tr.Play = Convert.ToString(dr["Play"]); } if (dr["MobileNo"] != null) { tr.MobileNo = Convert.ToString(dr["MobileNo"]); } tr.TotalSeats = Convert.ToInt32(dr["TotalSeats"]); } else { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Reg Id is null"); } } return(tr); }
protected void gv_Report_RowCommand(object sender, GridViewCommandEventArgs e) { long BookingID = long.Parse(e.CommandArgument.ToString()); DataTable dt = TransactionBOL.get_LogDetails_From_Booking_Status(BookingID); if (dt.Rows.Count > 0) { rep_Details.DataSource = dt; } else { lblMess.Text = "No Records Found!"; } rep_Details.DataBind(); mo12.Show(); }
protected void Page_Load(object sender, EventArgs e) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Master card promotion(non world card start.)"); if (!IsPostBack) { lblMsgPromotionCode.Visible = false; DataTable dtbankname = TransactionBOL.Select_BankNamenonwc(); if (dtbankname != null && dtbankname.Rows.Count > 0) { foreach (DataRow dr in dtbankname.Rows) { ddlbankname.Items.Add(new ListItem(dr[0].ToString(), dr[0].ToString())); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Session[Decrypt(Request.QueryString["SessionId"])].ToString() != "") { if (Request.QueryString["SessionId"] != null) { DataTable dt = TransactionBOL.Select_ShowDetails(Convert.ToInt64(Decrypt(Request.QueryString["SessionId"].ToString()))); Session_value = dt.Rows[0]["Seat_Val"].ToString(); sessionvalue = Session_value.Split(','); trnsectioncounter = sessionvalue[12]; } } if (!IsPostBack) { set_seatLayout(); } }
protected string UpdateResponseByTranId() { try { TransactionRecord tr = new TransactionRecord(); tr.BookingID = tr.VoucherBookingID; tr.ReceiptNo = "''"; tr.ReferenceNo = long.Parse(PayDetailsTemp[1].Split('_')[0]); tr.AgentCode = PayDetailsTemp[1].Split('_')[1].Split('~')[1]; //****** Promo code usecase start here ************ KODHelper objKODHelper = new KODHelper(); tr = objKODHelper.GetPromotionDetails(tr); //****** Promo code usecase END here ************ DataTable dt = TransactionBOL.Get_Transaction_Detail(tr); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; bool seatsBooked = (dt.Rows[0]["SeatBooked"].ToString() == "1"); bool alreadyProcessed = (dt.Rows[0]["AlreadyProcessed"].ToString() == "1"); if (seatsBooked) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Voucher Transaction : Seats Booked for " + tr.BookingID.ToString()); } if (!alreadyProcessed) { ReceiptUtils.SuccessPaymentResponse(seatsBooked, dt.Rows[0], tr.ReferenceNo.ToString(), tr.BookingID.ToString(), tr.ReceiptNo, ""); } } } catch (Exception ex) { if (qstring == "") { qstring += "?err=seat"; } else { qstring += "&err=seat"; } GTICKV.LogEntry(merchantReferenceNo, "Error Occured --" + ex.Message.Replace("'", ""), "19", MainBookingID); } Session["bookid"] = qstring; return(qstring); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { grayBG.Visible = false; showcontainer.Visible = false; Container.Visible = false; lblmsg.Visible = false; DataTable dtbankname = TransactionBOL.Select_BankName(); if (dtbankname != null && dtbankname.Rows.Count > 0) { foreach (DataRow dr in dtbankname.Rows) { ddlbankname.Items.Add(new ListItem(dr[0].ToString(), dr[0].ToString())); } } } }
protected void btnSettle_Click(object sender, CommandEventArgs e) { //Defining the Values to the Object TransactionRecord tr = new TransactionRecord(); tr.BookingID = txt_BookingID.Text.Length > 0 ? long.Parse(txt_BookingID.Text) : 0; tr.ReceiptNo = txt_ReceiptNo.Text.Length > 0 ? txt_ReceiptNo.Text : "0"; tr.DateOfBooking = txt_BookingDate.Text.Length > 0 ? txt_BookingDate.Text : "0"; tr.Location = txt_bookingDateTo.Text.Length > 0 ? txt_bookingDateTo.Text : "0"; tr.ShowDate = txt_ShowDate.Text.Length > 0 ? txt_ShowDate.Text : "0"; tr.MobileNo = txt_ShowDateTo.Text.Length > 0 ? txt_ShowDateTo.Text : "0"; tr.Name = txt_Name.Text.Length > 0 ? txt_Name.Text : "0"; tr.AgentCode = ddlAgent.SelectedValue; tr.ID = int.Parse(lblBookingID.Text); tr.SeatInfo = lblCurrentseats.Text + " (" + textRemarks.Text + ")"; DataSet ds = TransactionBOL.Settle_Transaction_Details(tr); gv_Report.DataSource = ds.Tables[0].DefaultView; gv_Report.DataBind(); }
protected void btnGo_Click(object sender, EventArgs e) { int Seats = 0; decimal totamt = 0; decimal discountamt = 0; TransactionRecord tr = new TransactionRecord(); tr.DateOfBooking = txt_BookingDate.Text.Length > 0 ? txt_BookingDate.Text : "0"; tr.Location = txt_bookingDateTo.Text.Length > 0 ? txt_bookingDateTo.Text : "0"; tr.AgentCode = ddlAgent.SelectedValue; DataSet ds = TransactionBOL.Hotel_Report(tr.DateOfBooking, tr.Location, tr.AgentCode); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { Btn_Excel.Enabled = true; btnPrint.Disabled = false; gv_Report.DataSource = ds.Tables[0]; lblMess.Text = ""; } else { btnPrint.Disabled = true; Btn_Excel.Enabled = false; lblMess.Text = "No Records Found!"; } gv_Report.DataBind(); if (gv_Report.Rows.Count > 0) { foreach (GridViewRow Gr in gv_Report.Rows) { Seats = Seats + int.Parse(Gr.Cells[7].Text); totamt = totamt + decimal.Parse(Gr.Cells[8].Text); discountamt = discountamt + decimal.Parse(Gr.Cells[10].Text); } gv_Report.FooterRow.Cells[6].Text = "Total"; gv_Report.FooterRow.Cells[7].Text = Seats.ToString(); gv_Report.FooterRow.Cells[8].Text = totamt.ToString(); gv_Report.FooterRow.Cells[10].Text = discountamt.ToString(); } }
// //List<AuditReport> ls = new List<AuditReport>() // //{ // //new AuditReport{ShowName=ar.ShowName.ToString(),LoctionText=ar.LoctionText.ToString(),Date=ar.Date,Time1=ar.Time1} // //}; protected void GridViewShowDetail_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "NewAudit") { Session["shownaudit_detail"] = e.CommandArgument.ToString(); String Session_value; string[] sessionvalue; Session_value = Session["shownaudit_detail"].ToString(); sessionvalue = Session_value.Split(','); DataTable dt = TransactionBOL.Check_AuditCount(sessionvalue[3].ToString(), sessionvalue[0].ToString(), DateTime.Now.ToString("dd/MM/yyyy"), sessionvalue[2].ToString()); if (dt.Rows.Count == 2) { Page.ClientScript.RegisterStartupScript(typeof(Page), "Query", "alert('Already have 2 audit' !);", true); Label1.Visible = true; Label1.Text = "This show already have 2 audit"; } else { Response.Redirect("AuditLayout.aspx", false); } } }
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>"); } }
protected void HandleSuccess(ref TransactionRecord tr, ref System.Text.StringBuilder qstring) { qstring.Clear(); #region handlesuccess GTICKV.LogEntry(tr.ReferenceNo.ToString(), "IDBI Payment successful...", "16", tr.BookingID.ToString(), tr.ReceiptNo.ToString()); #region parsereceipt if (Request.QueryString["rec"] != null) { try { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Receipt: " + Request.QueryString["rec"]); tr.ReceiptNo = Request.QueryString["rec"].ToString(); } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Response: Error parsing receipt."); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(ex.Message); } } #endregion parsereceipt try { //****** Promo code usecase start here ************ KODHelper objKODHelper = new KODHelper(); tr = objKODHelper.GetPromotionDetails(tr); tr.PaymentGateway = "IDBI"; //****** Promo code usecase END here ************ TransactionBOL.Update_PaymentStatus(tr); //Update payment status in temp transection table DataTable dt = TransactionBOL.Get_Transaction_Detail(tr); if (dt != null && dt.Rows.Count > 0) { bool seatsBooked = (dt.Rows[0]["SeatBooked"].ToString() == "1"); bool alreadyProcessed = (dt.Rows[0]["AlreadyProcessed"].ToString() == "1"); if (seatsBooked) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Transaction : Seats Booked for " + tr.BookingID.ToString()); } if (!alreadyProcessed) { if (dt.Rows[0]["PromotionCode"].ToString() == "MMT") { DataTable dt1 = TransactionBOL.Select_MMTTransaction_REFIDWISE(tr.BookingID.ToString()); ReceiptUtils.MMTPaymentResponse(dt.Rows[0], dt1.Rows[0], tr.ReceiptNo.ToString(), tr.BookingID.ToString(), ConfigurationManager.AppSettings.Get("ConcertRefMailId2"), ConfigurationManager.AppSettings.Get("ConcertRefMailId3"), dt.Rows[0]["ShowTime"].ToString(), dt.Rows[0]["ShowDate"].ToString()); } else if (dt.Rows[0]["PromotionCode"].ToString() == "MANA") { DataTable dt2 = TransactionBOL.Select_MANATransaction_REFIDWISE(tr.BookingID.ToString()); ReceiptUtils.MANAPaymentResponse(dt.Rows[0], dt2.Rows[0], tr.ReceiptNo.ToString(), tr.BookingID.ToString(), ConfigurationManager.AppSettings.Get("ConcertRefMailId2"), ConfigurationManager.AppSettings.Get("ConcertRefMailId3"), dt.Rows[0]["ShowTime"].ToString(), dt.Rows[0]["ShowDate"].ToString()); } else if (dt.Rows[0]["PromotionCode"].ToString() == "MCOTHERS" || dt.Rows[0]["PromotionCode"].ToString() == "MCWORLD") { DataTable dt3 = TransactionBOL.Select_MCTransaction_REFIDWISE(tr.ReferenceNo.ToString()); ReceiptUtils.MCPaymentResponse(dt.Rows[0], dt3.Rows[0], tr.ReceiptNo.ToString(), tr.BookingID.ToString(), ConfigurationManager.AppSettings.Get("ConcertRefMailId2"), ConfigurationManager.AppSettings.Get("ConcertRefMailId3"), dt.Rows[0]["ShowTime"].ToString(), dt.Rows[0]["ShowDate"].ToString()); } else if (dt.Rows[0]["PromotionCode"].ToString() == "JHUMROOOFFER") { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Enter into jhumroo offer mail content"); ReceiptUtils.JHUMROOOFFERPaymentResponse(seatsBooked, dt.Rows[0], tr.ReferenceNo.ToString(), tr.BookingID.ToString(), tr.ReceiptNo, ""); } else { ReceiptUtils.SuccessPaymentResponse(seatsBooked, dt.Rows[0], tr.ReferenceNo.ToString(), tr.BookingID.ToString(), tr.ReceiptNo, ""); } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Mail send through normal flow"); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Values are " + dt.Rows[0] + " , " + tr.ReferenceNo.ToString() + "," + tr.BookingID.ToString() + "," + tr.PromotionCode.ToString()); SendNotificationMailForHotels(seatsBooked, dt.Rows[0], tr.ReferenceNo.ToString(), tr.BookingID.ToString(), tr.ReceiptNo, tr.PromotionCode.ToString()); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Mail send through Hotel flow"); } qstring.Clear(); qstring.Append("?b="); qstring.Append((seatsBooked) ? dt.Rows[0]["BookingID"].ToString() : dt.Rows[0]["ID"].ToString()); } else { long BookingID1 = long.Parse(tr.ReferenceNo.ToString()); DataTable dt2 = TransactionBOL.Select_Temptransaction_REFIDWISE(BookingID1); if (dt2 != null && dt2.Rows.Count > 0 && (Convert.ToDateTime(dt2.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.ToShortDateString()) || Convert.ToDateTime(dt2.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.AddDays(-1).ToShortDateString()))) { ReceiptUtils.SuccessPaymentResponse(tr.ReceiptNo.ToString(), dt2.Rows[0], ""); } //ReceiptUtils.SuccessPaymentResponse(tr.BookingID.ToString(), tr.ReceiptNo); qstring.Append("?err=seat"); } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Receipt: error getting transaction details - " + ex.Message); HandleFailure(tr); long BookingID1 = long.Parse(tr.ReferenceNo.ToString()); DataTable dt1 = TransactionBOL.Select_Temptransaction_REFIDWISE(BookingID1); if (dt1 != null && dt1.Rows.Count > 0 && (Convert.ToDateTime(dt1.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.ToShortDateString()) || Convert.ToDateTime(dt1.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.AddDays(-1).ToShortDateString()))) { ReceiptUtils.SuccessPaymentResponse(tr.ReceiptNo.ToString(), dt1.Rows[0], ""); } qstring.Append("?err=seat"); } #endregion handlesuccess }
protected void Page_Load(object sender, EventArgs e) { System.Text.StringBuilder qstring = new System.Text.StringBuilder(); int qsCount = Request.QueryString.Count; #region processreceipt if (qsCount > 0 && Request.QueryString["sta"] != null && Request.QueryString["tid"] != null) { TransactionRecord tr = new TransactionRecord(); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(string.Format("IDBI Web payment transaction response [{0}]", Request.QueryString["sta"])); tr.Status = Request.QueryString["sta"].ToString().Equals("50020"); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Web payment transaction complete. Status: " + (tr.Status ? "Success" : "Failure")); string IpAddress = System.Configuration.ConfigurationManager.AppSettings["KoDTicketingIPAddress"]; #region parsereference String refNo = Request.QueryString["tid"].ToString(); string[] refTokens = refNo.Split('_'); KoDTicketing.GTICKV.LogEntry(refTokens[0], "Payment Getaway Response: " + (tr.Status ? "Success" : "Failure"), "14", ""); if (refTokens.Length < 2) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Payment Response: Tokenization of reference string did not result in enough tokens. --> " + refNo); return; } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Transaction reference: " + refTokens[0].ToString()); tr.ReferenceNo = long.Parse(refTokens[0].ToString()); string[] refSubTokens = refTokens[1].Split('~'); if (refSubTokens.Length < 2) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Payment Response: Tokenization of reference substring did not result in enough sub tokens. --> " + refTokens[1].ToString()); return; } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Booking ID: " + refSubTokens[0]); tr.BookingID = long.Parse(refSubTokens[0]); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Agent Code: " + refSubTokens[1]); tr.AgentCode = refSubTokens[1]; #endregion parsereference Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Amount: " + Request.QueryString["amt"].ToString()); tr.TotalAmount = decimal.Parse(Request.QueryString["amt"].ToString()); try { if (true == tr.Status) { HandleSuccess(ref tr, ref qstring); } else //failure { GTICKV.LogEntry(tr.ReferenceNo.ToString(), "Payment Not Successful", "25", tr.BookingID.ToString()); GTICKBOL.ON_Session_out(tr.ReferenceNo.ToString()); GTICKV.LogEntry(tr.ReferenceNo.ToString(), "Seats Unlocked", "26", tr.BookingID.ToString()); long BookingID = long.Parse(tr.ReferenceNo.ToString()); GTICKV.LogEntry(tr.ReferenceNo.ToString(), "User Press Cancel Button", "15", tr.BookingID.ToString()); DataTable dt = TransactionBOL.Select_Temptransaction_REFIDWISE(BookingID); if (dt != null && dt.Rows.Count > 0 && (Convert.ToDateTime(dt.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.ToShortDateString()) || Convert.ToDateTime(dt.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.AddDays(-1).ToShortDateString()))) { ReceiptUtils.PaymentNotCaptureResponse(tr.ReceiptNo.ToString(), dt.Rows[0], ""); } qstring.Append("?err=pay"); } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(ex.Message); HandleFailure(tr); qstring.Append("?err=seat"); } } #endregion processreceipt Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("IDBI Transaction Complete. " + Request.QueryString["rec"]); Response.Redirect("../Print-Receipt.aspx" + qstring.ToString(), false); }
protected void Page_Load(object sender, EventArgs e) { try { if (Request.UrlReferrer != null) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Request.UrlReferrer.ToString()); } if (!IsPostBack) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Printing Receipt Parameters: " + Request.QueryString.Count.ToString()); if (Session["bookid"] != null) //Voucher { string bookid = Session["bookid"].ToString(); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Printing Receipt for purchase by voucher. Booking Id: " + bookid); Session["bookid"] = null; Session.Abandon(); Server.Transfer("Print-Receipt.aspx" + bookid); } else { if (Request.QueryString["b"] != null) { #region paramB Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("[B] Printing Receipt For " + Request.QueryString["b"].ToString()); long BookingID = long.Parse(Request.QueryString["b"].ToString()); DataTable dt = TransactionBOL.Select_Temptransaction_transactionIDWise(BookingID); if (dt.Rows.Count > 0) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("[B] Printing Receipt with transaction details for " + Request.QueryString["b"].ToString()); dvDetails.Visible = true; dvErrorDetail.Visible = false; DataRow dr = dt.Rows[0]; int chkstatus = int.Parse(dr["SeatBooked"].ToString()); lblVenue.Text = "Kingdom of Dreams, Gurgaon"; lblshowname.Text = dr["play"].ToString(); lblSeatInfo.Text = dr["Category"] + " - " + dr["SeatInfo"].ToString(); lblPayMode.Text = dr["PaymentType"].ToString(); //lbltranamt.Text = dr["TotalAmount"].ToString() + " INR"; decimal DiscountPercentage = decimal.Parse(dr["DiscountPercentage"].ToString()); decimal tktAmount = decimal.Parse(dr["TotalAmount"].ToString()); int numberOfSeats = int.Parse(dr["TotalSeats"].ToString()); if (DiscountPercentage > 0) { decimal amtAfterDeduction = 0; decimal SingleTicketPrice = tktAmount / numberOfSeats; decimal DiscountedPrice = SingleTicketPrice - (SingleTicketPrice * 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; } amtAfterDeduction = DiscountedPrice * numberOfSeats; Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Total Amount Price For a Ticket" + amtAfterDeduction.ToString()); lbltranamt.Text = Convert.ToString(amtAfterDeduction) + " INR"; } else { lbltranamt.Text = dr["TotalAmount"].ToString() + " INR"; } if (dr["PromotionCode"].ToString() == "VIVANTABYTAJ" || dr["PromotionCode"].ToString() == "OBEROI" || dr["PromotionCode"].ToString() == "TRIDENT" || dr["PromotionCode"].ToString() == "OBEROIDELHI" || dr["PromotionCode"].ToString() == "OCTOBERFEST") { lbltranamt.Text = dr["PayableAmount"].ToString() + "INR"; } if (dr["PromotionCode"].ToString() == "OCTOBERFEST") { jhumroooffer.Visible = true; lblpromo.Text = "OCTOBER FEST (Buy one get one free)"; } if (dr["PromotionCode"].ToString() == "MMT") { DataTable dt1 = TransactionBOL.Select_MMTTransaction_REFIDWISE(BookingID.ToString()); DataRow dr1 = dt1.Rows[0]; lbltranamt.Text = decimal.Truncate(Convert.ToDecimal(dr1["PayableAmount"].ToString())) + " INR"; } if (dr["PromotionCode"].ToString() == "MANA") { notes.Visible = false; ManaNotes.Visible = true; DataTable dt1 = TransactionBOL.Select_MANATransaction_REFIDWISE(BookingID.ToString()); DataRow dr1 = dt1.Rows[0]; lbltranamt.Text = decimal.Truncate(Convert.ToDecimal(dr1["PayableAmount"].ToString())) + " INR"; } if (dr["PromotionCode"].ToString() == "MCOTHERS" || dr["PromotionCode"].ToString() == "MCWORLD") { DataTable dt1 = TransactionBOL.Select_McTransaction_REFIDWISE(dr["ReferenceNo"].ToString()); DataRow dr1 = dt1.Rows[0]; if (dr1["Type"].ToString() == "PACKAGE") { notes.Visible = false; McNotes.Visible = true; lbltranamt.Text = decimal.Truncate(Convert.ToDecimal(dr1["PayableAmount"].ToString())) + " INR"; } } if (chkstatus > 0) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("[B] Printing Receipt with seats booked for " + Request.QueryString["b"].ToString()); lblBookingID.Text = dr["BookingID"].ToString(); lblIdbiReceiptno.Text = dr["ReceiptNo"].ToString(); lbltransid.Text = dr["ReferenceNo"].ToString(); } else { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("[B] Printing Receipt with NO seats booked for " + Request.QueryString["b"].ToString()); dvErrorDetail.Visible = true; lblIdbiReceiptno.Text = dr["ReferenceNo"].ToString(); lbltransid.Text = dr["BookingID"].ToString(); lblFinalMess.Text = "Your Transaction was successful, but your seats were not booked for some technical reason, please contact 0124 - 4528000 for Seat Confirmation"; } lbltrnsresponse.Text = "Transaction Successful"; lblBookTime.Text = Convert.ToDateTime(dr["DateOfBooking"]).ToLongDateString() + " at " + Convert.ToDateTime(dr["TimeOfBooking"]).ToShortTimeString(); lblShowDaTE.Text = Convert.ToDateTime(dr["ShowDate"]).ToLongDateString() + " at " + Convert.ToDateTime(dr["ShowTime"]).ToShortTimeString(); //printing bar code here //toBarCode(BookingID.ToString()); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("[B] Printing Receipt Done for " + Request.QueryString["b"].ToString()); } #endregion } else if (Request.QueryString["err"] != null) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Received Print Receipt with err value..." + Request.QueryString["err"].ToString()); string err = Request.QueryString["err"].ToString(); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("err value : " + err); if (err == "pay") { lblFinalMess.Text = "Your transaction was not successful. Please try later."; if (Request["ErrorText"] != null) { lblFinalMess.Text += Environment.NewLine + "Transaction failed because" + Request["ErrorText"].ToString(); } } else if (err == "seat") { lblFinalMess.Text = "Your payment transaction was successful, but your seats were not booked due to technical glitch, please contact (0124)4528000 for Seat Confirmation. Sorry for inconvenience."; } dvDetails.Visible = false; dvErrorDetail.Visible = true; lblDate.Text = System.DateTime.Now.ToString(); } else { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Received Print Receipt without parameter..."); dvErrorDetail.Visible = true; dvDetails.Visible = false; lblFinalMess.Text = "Sorry your payment transaction was not successful, please try again after some time."; } } lblDate.Text = "Date : " + System.DateTime.Now.ToString(); } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Error Printing Receipt For " + ex.Message); } Session.Clear(); }
protected void Page_Load(object sender, EventArgs e) { lblPackage1.Visible = false; lblPackage1Qnty.Visible = false; //lblPackage2.Visible = false; //lblPackage2Qnty.Visible = false; //lblPackage3.Visible = false; //lblPackage3Qnty.Visible = false; try { if (Request.QueryString["b"] != null) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("[B] Printing Receipt For " + Request.QueryString["b"].ToString()); dvDetails.Visible = true; dvErrorDetail.Visible = false; string VLBookingID = Request.QueryString["b"].ToString(); DataTable dt = TransactionBOL.Select_DandiyaTransaction(VLBookingID); if (dt.Rows.Count > 0) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("[B] Printing Receipt with transaction details for " + Request.QueryString["b"].ToString()); DataRow dr = dt.Rows[0]; lblBookingID.Text = dr["BookingId"].ToString(); lblReceiptNo.Text = dr["PGReceiptId"].ToString(); lblquantity.Text = dr["Quantity"].ToString(); lbltotalamount.Text = dr["TotalAmount"].ToString(); lblPayMode.Text = "Credit/Debit Card"; lblDOB.Text = dr["DateOfBooking"].ToString(); lblemailid.Text = dr["EmailId"].ToString(); lbldoe.Text = dr["Event Date"].ToString() + " ," + "7:00 pm"; if (Convert.ToInt16(dr["Package"]) > 0) { lblPackage1.Visible = true; lblPackage1Qnty.Visible = true; lblPackage1Qnty.Text = (dr["Package Type"]).ToString(); } // if (Convert.ToInt16(dr["Couple_3999"]) > 0) //{ // lblPackage2.Visible = true; // lblPackage2Qnty.Visible = true; // lblPackage2Qnty.Text = Convert.ToInt16(dr["Couple_3999"]).ToString(); //} // if (Convert.ToInt16(dr["Couple_3499"]) > 0) //{ // lblPackage3.Visible = true; // lblPackage3Qnty.Visible = true; // lblPackage3Qnty.Text = Convert.ToInt16(dr["Couple_3499"]).ToString(); //} lblcontactNo.Text = dr["ContactNumber"].ToString(); lnlname.Text = dr["Name"].ToString(); bool isSuccessfull = Convert.ToBoolean(dr["PGIsPaymentSuccess"]); if (isSuccessfull) { lbltrnsresponse.Text = "Transaction Successful"; } else { lbltrnsresponse.Text = "Transaction Not Successful"; } } } else if (Request.QueryString["err"] != null) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Received Print Receipt with err value..." + Request.QueryString["err"].ToString()); string err = Request.QueryString["err"].ToString(); if (err == "pay") { lblFinalMess.Text = "Your transaction was not successful. Please try later."; if (Request["ErrorText"] != null) { lblFinalMess.Text += Environment.NewLine + "Transaction failed because" + Request["ErrorText"].ToString(); } } else if (err == "seat") { lblFinalMess.Text = "Your payment transaction was successful, but your seats were not booked due to technical glitch, please contact (0124)4528000 for Seat Confirmation. Sorry for inconvenience."; } dvDetails.Visible = false; dvErrorDetail.Visible = true; lblDate.Text = System.DateTime.Now.ToString(); } else { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Received Print Receipt without parameter..."); dvErrorDetail.Visible = true; dvDetails.Visible = false; lblFinalMess.Text = "Sorry your payment transaction was not successful, please try again after some time."; } lblDate.Text = "Date : " + System.DateTime.Now.ToString(); } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Error Printing Receipt For " + ex.Message); } Session.Clear(); }
protected String UpdateResponse(String trackid, String reference, String result, String postdate, String auth) { System.Text.StringBuilder qstring = new System.Text.StringBuilder(); try { TransactionRecord tr = new TransactionRecord(); string IpAddress = System.Configuration.ConfigurationManager.AppSettings["KoDTicketingIPAddress"]; #region parsereference Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Transaction reference: " + trackid); string refNo = trackid; if (refNo.Length < 1) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Payment Response: Tokenization of reference string did not result in enough sub tokens. --> " + refNo); return("?err=pay"); } tr.EvtBookingID = refNo; Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(string.Format("HDFC Payment Response: Reference[{0}], Booking ID [{1}], Agent Code [{2}] ", tr.ReferenceNo.ToString(), tr.EvtBookingID.ToString(), tr.AgentCode)); #endregion parsereference if (Request["amt"] != null) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Amount: " + Request["amt"].ToString()); tr.EvtTotalAmount = decimal.Parse(Request["amt"].ToString()); } if (Request["paymentid"] != null) { try { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Receipt: " + Request["paymentid"].ToString()); tr.EvtReceiptNo = Request["paymentid"].ToString(); } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Response: Error parsing receipt."); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(ex.Message); } } if (result == "CAPTURED") { # region CAPTURED //string retURL = UpdateResponseByTranId(status, amount, transactionId); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC payment captured."); try { string EvtBookingID = tr.EvtBookingID.ToString(); TransactionBOL.Get_Event_Details(tr.EvtBookingID, tr.EvtReceiptNo); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Going to Fetch Details of Booking Id from DB.Booking ID where" + EvtBookingID); DataTable dt = TransactionBOL.Select_EventTransaction(tr.EvtBookingID.ToString()); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Fetched Details of Booking Id from DB.Booking ID where" + EvtBookingID); if (dt != null && dt.Rows.Count > 0) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Fetched Details of Booking Id from DB.Booking ID where" + dt.Rows[0]); try { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Seats booked against HDFC payment."); qstring.Append("?b="); qstring.Append(tr.EvtBookingID.ToString()); // ReceiptUtils.ValentinePaymentSuccess(dt.Rows[0], tr.VLReceiptNo.ToString(), tr.BookingID.ToString()); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Payment successful..." + tr.EvtBookingID.ToString() + tr.EvtReceiptNo.ToString()); GTICKV.LogEntry("HDFC Payment successful...", "10", tr.BookingID.ToString(), tr.ReceiptNo.ToString()); } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Error processing receipt post booking. " + ex.Message); // ReceiptUtils.SuccessPaymentResponse(tr.ReceiptNo.ToString(), dt.Rows[0], ""); //ReceiptUtils.SuccessPaymentResponse(tr.VLBookingID.ToString(), tr.VLReceiptNo); qstring.Append((qstring.Length == 0) ? "?err=seat" : "&err=seat"); } return(qstring.ToString()); } else { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC successful booking but ask customer to call");; long BookingID1 = long.Parse(tr.ReferenceNo.ToString()); //DataTable dt1 = TransactionBOL.Select_Temptransaction_REFIDWISE(BookingID1); //ReceiptUtils.SuccessPaymentResponse(tr.ReceiptNo.ToString(), dt1.Rows[0], ""); //ReceiptUtils.SuccessPaymentResponse(tr.VLBookingID.ToString(), tr.VLReceiptNo); qstring.Append((qstring.Length == 0) ? "?err=seat" : "&err=seat"); } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Receipt: error getting transaction details - " + ex.Message); qstring.Append((qstring.Length == 0) ? "?err=seat" : "&err=seat"); } //if you reach here problem occurred String _refNo = tr.EvtBookingID.ToString(); KoDTicketing.GTICKV.LogEntry(_refNo, "HDFC Payment Not Successful", "17", tr.EvtBookingID.ToString()); //GTICKBOL.ON_Session_out(_refNo); KoDTicketing.GTICKV.LogEntry(_refNo, "Seats Unlocked", "18", tr.EvtBookingID.ToString()); qstring.Append("err=pay"); KoDTicketing.GTICKV.LogEntry(tr.EvtReceiptNo.ToString(), "HDFC Error Occurred -- Payment Not Successful", "19", tr.EvtBookingID.ToString()); string BookingID = tr.EvtBookingID.ToString(); try { DataTable dt = TransactionBOL.Select_EventTransaction(BookingID); if (dt.Rows.Count == 0) { ReceiptUtils.FailurePaymentResponse(); } else { ReceiptUtils.FailurePaymentResponse(dt.Rows[0]); } qstring.Append((qstring.Length == 1) ? "err=seat" : "&err=seat"); return(qstring.ToString()); } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Error occurred processing unsuccessful payment..." + ex.Message); } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("HDFC Final Call"); Response.Redirect(IpAddress + "EventTransaction/HDFC/FinalCall.aspx" + qstring.ToString(), false); #endregion } else { GTICKV.LogEntry(tr.EvtReceiptNo.ToString(), "HDFC Payment Not Successful", "17", tr.EvtBookingID.ToString()); //GTICKBOL.ON_Session_out(tr.ReferenceNo.ToString()); GTICKV.LogEntry(tr.EvtReceiptNo.ToString(), "Seats Unlocked", "18", tr.EvtBookingID.ToString()); long BookingID = long.Parse(tr.ReferenceNo.ToString()); DataTable dt = TransactionBOL.Select_Temptransaction_REFIDWISE(BookingID); ReceiptUtils.PaymentNotCaptureResponse(tr.ReceiptNo.ToString(), dt.Rows[0], ""); qstring.Append("?err=pay"); } }
protected void btnGo_Click(object sender, EventArgs e) { if (txt_Name.Text == "" && txt_BookingDate.Text == "" && txt_bookingDateTo.Text == "" && txt_ShowDate.Text == "" && txt_ShowDateTo.Text == "") { lblValidation.Visible = true; lblValidation.Text = "Please Enter Either The Name , Booking Dates or Show Dates !!"; txt_Name.Focus(); } else if (txt_BookingDate.Text != "" && txt_bookingDateTo.Text == "") { lblValidation.Visible = true; lblValidation.Text = "Please Select the Booking Date To !!"; txt_bookingDateTo.Focus(); } else if (txt_BookingDate.Text == "" && txt_bookingDateTo.Text != "") { lblValidation.Visible = true; lblValidation.Text = "Please Select the Booking Date From !!"; txt_BookingDate.Focus(); } else if (txt_ShowDate.Text == "" && txt_ShowDateTo.Text != "") { lblValidation.Visible = true; lblValidation.Text = "Please Select the Show Date From !!"; txt_ShowDate.Focus(); } else if (txt_ShowDate.Text != "" && txt_ShowDateTo.Text == "") { lblValidation.Visible = true; lblValidation.Text = "Please Select the Show Date To !!"; txt_ShowDateTo.Focus(); } else { //Defining the Values to the Object TransactionRecord tr = new TransactionRecord(); tr.BookingID = txt_BookingID.Text.Length > 0 ? long.Parse(txt_BookingID.Text) : 0; tr.ReceiptNo = txt_ReceiptNo.Text.Length > 0 ? txt_ReceiptNo.Text : "0"; tr.DateOfBooking = txt_BookingDate.Text.Length > 0 ? txt_BookingDate.Text : "0"; //location == bookingDate to tr.Location = txt_bookingDateTo.Text.Length > 0 ? txt_bookingDateTo.Text : "0"; tr.ShowDate = txt_ShowDate.Text.Length > 0 ? txt_ShowDate.Text : "0"; tr.MobileNo = txt_ShowDateTo.Text.Length > 0 ? txt_ShowDateTo.Text : "0"; tr.Name = txt_Name.Text.Length > 0 ? txt_Name.Text : "0"; tr.AgentCode = ddlAgent.SelectedValue; if (tr.BookingID != null || tr.BookingID.ToString() != "") { DataTable chkID1 = TransactionBOL.Select_MarchPromotionTransactionCounter_CounterIDWise(Convert.ToInt64(tr.BookingID.ToString())); if (chkID1 != null && chkID1.Rows.Count > 0) { tr.BookingID = long.Parse(chkID1.Rows[0][1].ToString()); } } DataSet ds = TransactionBOL.Select_Report_SearchFromTransactionsTemp_DS(tr); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { btnPrint.Disabled = false; Btn_Excel.Enabled = true; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataTable chkID = TransactionBOL.Select_MarchPromotionTransactionCounter_IDWise(Convert.ToInt64(ds.Tables[0].Rows[i][1])); if (chkID.Rows.Count > 0) { if (chkID.Rows[0][0].ToString().Substring(0, 2) == "31") { ds.Tables[0].Rows[i][1] = long.Parse(chkID.Rows[0][0].ToString()); } } if (ds.Tables[0].Rows[i][10].ToString() == "") { dis = Decimal.Parse(ds.Tables[0].Rows[i][8].ToString()); ds.Tables[0].Rows[i][10] = dis; ds.Tables[0].Rows[i][9] = "0.00"; } } gv_Report.DataSource = ds; lblMess.Text = ""; } else { btnPrint.Disabled = true; Btn_Excel.Enabled = false; lblMess.Text = "No records Found!"; } gv_Report.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { System.Text.StringBuilder qstring = new System.Text.StringBuilder("?"); try { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Amex Return Receipt Page"); int qsCount = Request.QueryString.Count; if (qsCount > 0 && Request.QueryString["sta"] != null && Request.QueryString["tid"] != null) { TransactionRecord tr = new TransactionRecord(); #region parsereference //tr.Status = Request.QueryString["sta"].ToString().Equals("0"); tr.Status = false; if (Request.QueryString["enroll"].ToString().Equals("Y")) { if (Request.QueryString["sta"].ToString().Equals("0") && (Request.QueryString["Safecode"].ToString().Equals("Y") || Request.QueryString["Safecode"].ToString().Equals("A"))) { tr.Status = true; } } else { if (Request.QueryString["sta"].ToString().Equals("0") && Request.QueryString["response"].ToString().Equals("M")) { tr.Status = true; } } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("AmEx Web payment transaction complete. Status: " + (tr.Status ? "Success" : "Failure")); String refNo = Request.QueryString["tid"].ToString(); string[] refTokens = refNo.Split('_'); KoDTicketing.GTICKV.LogEntry(refTokens[0], "Payment Getaway Response: " + (tr.Status ? "Success" : "Failure"), "14", ""); if (refTokens.Length < 2) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("AmEx Response from gateway received but query string does not have information about the transaction refernece: " + refNo); return; } tr.ReferenceNo = long.Parse(refTokens[0].ToString()); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("AmEx Transaction reference: " + tr.ReferenceNo.ToString()); string[] refSubTokens = refTokens[1].Split('~'); if (refTokens.Length < 2) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("AmEx Tokenization of query string did not result in enough sub tokens. --> " + refNo); return; } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("AmExBooking ID: " + refSubTokens[0]); tr.BookingID = long.Parse(refSubTokens[0]); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("AmEx Agent Code: " + refSubTokens[1]); tr.AgentCode = refSubTokens[1]; #endregion parsereference Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("AmEx Amount: " + Request.QueryString["amt"].ToString()); tr.TotalAmount = decimal.Parse(Request.QueryString["amt"].ToString()); if (true == tr.Status) //successful { #region handlesuccess #region parsereceipt if (Request.QueryString["rec"] != null) { try { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("AmEx Receipt: " + Request.QueryString["rec"]); tr.ReceiptNo = Request.QueryString["rec"]; } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Amex Resposne: Error parsing receipt."); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(ex.Message); } } #endregion parsereceipt try { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("AmEX Payment Successful. Ensuring the seats are reserved..."); //****** Promo code usecase start here ************ KODHelper objKODHelper = new KODHelper(); tr = objKODHelper.GetPromotionDetails(tr); tr.PaymentGateway = "AMEX"; //****** Promo code usecase END here ************ TransactionBOL.Update_PaymentStatus(tr); //Update payment status in temp transection table DataTable dt = TransactionBOL.Get_Transaction_Detail(tr); if (dt.Rows.Count == 0) { long BookingID1 = long.Parse(tr.ReferenceNo.ToString()); DataTable dt1 = TransactionBOL.Select_Temptransaction_REFIDWISE(BookingID1); if (dt1 != null && dt1.Rows.Count > 0 && (Convert.ToDateTime(dt1.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.ToShortDateString()) || Convert.ToDateTime(dt1.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.AddDays(-1).ToShortDateString()))) { ReceiptUtils.SuccessPaymentResponse(tr.ReceiptNo.ToString(), dt1.Rows[0], ""); } //ReceiptUtils.SuccessPaymentResponse(tr.BookingID.ToString(), tr.ReceiptNo); qstring.Append("?err=seat"); } else { bool seatsBooked = (int.Parse(dt.Rows[0]["SeatBooked"].ToString()) > 0); bool alreadyProcessed = (dt.Rows[0]["AlreadyProcessed"].ToString() == "1"); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(string.Format("Amex [{0},{1},{2}] Seats Booked.", tr.ReferenceNo.ToString(), tr.BookingID.ToString(), tr.ReceiptNo)); if (!alreadyProcessed) { if (dt.Rows[0]["PromotionCode"].ToString() == "MMT") { DataTable dt1 = TransactionBOL.Select_MMTTransaction_REFIDWISE(tr.BookingID.ToString()); ReceiptUtils.MMTPaymentResponse(dt.Rows[0], dt1.Rows[0], tr.ReceiptNo.ToString(), tr.BookingID.ToString(), ConfigurationManager.AppSettings.Get("ConcertRefMailId2"), ConfigurationManager.AppSettings.Get("ConcertRefMailId3"), dt.Rows[0]["ShowTime"].ToString(), dt.Rows[0]["ShowDate"].ToString()); } else if (dt.Rows[0]["PromotionCode"].ToString() == "MANA") { DataTable dt2 = TransactionBOL.Select_MANATransaction_REFIDWISE(tr.BookingID.ToString()); ReceiptUtils.MANAPaymentResponse(dt.Rows[0], dt2.Rows[0], tr.ReceiptNo.ToString(), tr.BookingID.ToString(), ConfigurationManager.AppSettings.Get("ConcertRefMailId2"), ConfigurationManager.AppSettings.Get("ConcertRefMailId3"), dt.Rows[0]["ShowTime"].ToString(), dt.Rows[0]["ShowDate"].ToString()); } else if (dt.Rows[0]["PromotionCode"].ToString() == "MCOTHERS" || dt.Rows[0]["PromotionCode"].ToString() == "MCWORLD") { DataTable dt3 = TransactionBOL.Select_MCTransaction_REFIDWISE(tr.ReferenceNo.ToString()); ReceiptUtils.MCPaymentResponse(dt.Rows[0], dt3.Rows[0], tr.ReceiptNo.ToString(), tr.BookingID.ToString(), ConfigurationManager.AppSettings.Get("ConcertRefMailId2"), ConfigurationManager.AppSettings.Get("ConcertRefMailId3"), dt.Rows[0]["ShowTime"].ToString(), dt.Rows[0]["ShowDate"].ToString()); } else if (dt.Rows[0]["PromotionCode"].ToString() == "JHUMROOOFFER") { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Enter into jhumroo offer mail content"); ReceiptUtils.JHUMROOOFFERPaymentResponse(seatsBooked, dt.Rows[0], tr.ReferenceNo.ToString(), tr.BookingID.ToString(), tr.ReceiptNo, ""); } else { ReceiptUtils.SuccessPaymentResponse(seatsBooked, dt.Rows[0], tr.ReferenceNo.ToString(), tr.BookingID.ToString(), tr.ReceiptNo, ""); } Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Mail send through normal flow"); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Values are " + dt.Rows[0] + " , " + tr.ReferenceNo.ToString() + "," + tr.BookingID.ToString() + "," + tr.PromotionCode.ToString()); SendNotificationMailForHotels(seatsBooked, dt.Rows[0], tr.ReferenceNo.ToString(), tr.BookingID.ToString(), tr.ReceiptNo, tr.PromotionCode.ToString()); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Mail send through Hotel flow"); } qstring.Clear(); qstring.Append("?b="); qstring.Append((seatsBooked) ? dt.Rows[0]["BookingID"].ToString() : dt.Rows[0]["ID"].ToString()); KoDTicketing.GTICKV.LogEntry(tr.ReferenceNo.ToString(), "AMEX Payment successful...", "16", tr.BookingID.ToString(), tr.ReceiptNo.ToString()); } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Receipt: error getting transaction details - " + ex.Message); String _refNo = tr.ReferenceNo.ToString(); KoDTicketing.GTICKV.LogEntry(tr.ReferenceNo.ToString(), "Amex Error Occured -- Payment Not Successful", "27", tr.ReferenceNo.ToString()); long BookingID = long.Parse(tr.ReferenceNo.ToString()); try { DataTable dt = TransactionBOL.Select_Temptransaction_REFIDWISE(BookingID); if (dt.Rows.Count == 0) { ReceiptUtils.FailurePaymentResponse(); } else { ReceiptUtils.FailurePaymentResponse(dt.Rows[0]); } qstring.Append("?err=seat"); } catch (Exception ex1) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Error occurred processing unsuccessful payment through Amex..." + ex1.Message); } } #endregion handlesuccess } else //failure { #region handlefailure String _refNo = tr.ReferenceNo.ToString(); KoDTicketing.GTICKV.LogEntry(_refNo, "Payment Not Successful", "25", tr.BookingID.ToString()); GTICKBOL.ON_Session_out(_refNo); KoDTicketing.GTICKV.LogEntry(_refNo, "Seats Unlocked", "26", tr.BookingID.ToString()); long BookingID = long.Parse(tr.ReferenceNo.ToString()); DataTable dt = TransactionBOL.Select_Temptransaction_REFIDWISE(BookingID); if (dt != null && dt.Rows.Count > 0 && (Convert.ToDateTime(dt.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.ToShortDateString()) || Convert.ToDateTime(dt.Rows[0]["DateOfBooking"].ToString()) == Convert.ToDateTime(DateTime.Now.Date.AddDays(-1).ToShortDateString()))) { ReceiptUtils.PaymentNotCaptureResponse(tr.ReceiptNo.ToString(), dt.Rows[0], ""); } qstring.Append("err=pay"); #endregion handlefailure } } else { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Response from gateway received but query string does not have information about the transaction."); qstring.Append((qstring.Length == 1) ? "err=seat" : "&err=seat"); } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Exception thrown processing receipt. " + ex.Message); qstring.Append((qstring.Length == 1) ? "err=seat" : "&err=seat"); } Response.Redirect("~/Payment/Print-Receipt.aspx" + qstring.ToString(), false); }