Ejemplo n.º 1
0
 protected void SubmitButton_Click(object sender, EventArgs e)
 {
     try
     {
         Transaction    transaction      = new Transaction();
         HRSPaymentsBLL paymentBLLObject = new HRSPaymentsBLL();
         transaction.CustomerID    = Session["userId"].ToString();
         transaction.BookingID     = BookingIDDropDownList.SelectedItem.ToString();
         transaction.Amount        = Convert.ToInt32(AmountTextBox.Text.ToString());
         transaction.CardNo        = Convert.ToInt64(CreditCardNoTextBox.Text.ToString());
         transaction.DateTimeOfTXN = DateTime.Now;
         transaction.TXNStatus     = HRSConstants.SUCCESS;
         var transactionID = paymentBLLObject.AddTransactionDetails(transaction);
         if (!string.IsNullOrEmpty(transactionID))
         {
             string display = "Payment Successfully Done." + "\n" + "Transaction ID: " + transactionID;
             ErrorMessageLabel.Text = display;
         }
         else
         {
             ErrorMessageLabel.Text = HRSConstants.FAILED;
         }
         System.Text.StringBuilder sb = new System.Text.StringBuilder();
         sb.Append(@"<script type='text/javascript'>");
         sb.Append("$(function () {");
         sb.Append(" $('#Result').modal('show');});");
         sb.Append("</script>");
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ModelScript", sb.ToString(), false);
     }
     catch (Exception ex)
     {
         ExceptionUtility.ExceptionLog(ex);
         throw;
     }
 }
 protected void ViewButton_Click(object sender, EventArgs e)
 {
     try
     {
         HRSPaymentsBLL paymentBLLObject = new HRSPaymentsBLL();
         string         bookingID        = BookingIDDropDownList.SelectedItem.Text;
         var            transaction      = paymentBLLObject.GetTransactionDetailsByBookindID(bookingID);
         TXNGridView.DataSource = transaction;
         TXNGridView.DataBind();
         hidden2.Visible = true;
     }
     catch (Exception ex)
     {
         Utility.ExceptionUtility.ExceptionLog(ex);
         throw;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             HRSPaymentsBLL paymentBLLObject = new HRSPaymentsBLL();
             string         customerID       = Session["userId"].ToString();
             var            bookings         = paymentBLLObject.GetTXNBookindID(customerID);
             BookingIDDropDownList.DataSource = bookings;
             BookingIDDropDownList.DataBind();
         }
         hidden2.Visible = false;
     }
     catch (Exception ex)
     {
         Utility.ExceptionUtility.ExceptionLog(ex);
         throw;
     }
 }