/// <summary> /// When the page loads, the transaction date and information are displayed. /// </summary> /// Creator: Olivia Johnson 11-28-12 protected void Page_Load(object sender, EventArgs e) { //read in txn token from querystring String txToken = Request.QueryString.Get("tx"); String IPNResponce = getIPN(txToken); //Create dictonary with Paypal info Dictionary<String, String> payPalInfo = getPayPalStuff(IPNResponce); // Parse the eventID and transactionID from the 'option' field // Example: eventID_transactionID (112314_31231231231) String customField = payPalInfo["custom"].ToString(); eventID = customField.Substring(0, customField.LastIndexOf("_")); transactionID = customField.Substring(customField.IndexOf("_") + 1, customField.Length - customField.LastIndexOf("_") - 1); customerInfo = new Dictionary<string, string>(); customerInfo["transactionID"] = transactionID; customerInfo["eventID"] = eventID; customerInfo["firstName"] = payPalInfo["first_name"]; customerInfo["lastName"] = payPalInfo["last_name"]; customerInfo["suffix"] = ""; customerInfo["phone"] = ""; if(Session["email"] == null) customerInfo["email"] = payPalInfo["payer_email"].Replace("%40", "@"); else customerInfo["email"] = Session["email"].ToString(); customerInfo["address"] = payPalInfo["address_street"]; customerInfo["city"] = payPalInfo["address_city"]; customerInfo["state"] = payPalInfo["address_state"]; customerInfo["zip"] = payPalInfo["address_zip"]; lblOrderDate.Text = DateTime.Now.ToString("MM/dd/yyyy"); //Display Date lblTransaction.Text = transactionID; BusinessTier bt = new BusinessTier(); eventType = bt.getEventType(eventID).Tables[1].Rows[0][0].ToString(); switch (eventType) { case "Golf": golfConfirmation(); break; case "Dinner": dinnerConfirmation(); break; case "Run": runConfirmation(); break; case "Donation": donateConfirmation(); break; } }
private string getEventType(string eventID) { try { BusinessTier bt = new BusinessTier(); DataSet ds = bt.getEventType(eventID); string eventType = ds.Tables[1].Rows[0][0].ToString(); return eventType; } catch (Exception ex) { ErrorLog.logError(ex); Response.Redirect("Oops.aspx"); return ""; } }
/// <summary> /// On page load, two functions are called - getEventType and Display???ReistrantDetails ///The Display function fills in the checkout table to display the total cost. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// Created by: OJ 11-18-12 protected void Page_Load(object sender, EventArgs e) { try { //Used to bring the user back to the previous screen with the info filled out -Andrew Heim 11/30/12 if (!IsPostBack) { PostBackCount = 1; Session["PostBackCount"] = PostBackCount; } else { PostBackCount = ((int)Session["PostBackCount"]); Session["PostBackCount"] = ++PostBackCount; } BusinessTier bt = new BusinessTier(); String eventID = Session["eventID"].ToString(); DataSet ds = bt.getEventType(eventID); eventType = ds.Tables[1].Rows[0][0].ToString(); btnPayPal.Enabled = chkLiabilityStatus(); //enables or disables the continue to paypal button based on the liabilty checkbox if (eventType != "Run") regInfo = (Dictionary<String, String>)Session["regInfo"]; //if not a 5k, session variable is a dictionary object else runnerList = (List<Dictionary<String, string>>)Session["regInfo"]; //if a 5k, session variable is a list of dictionary objects lblEventType.Text = eventType + " Event"; switch (eventType) { case "Golf": displayGolfRegistrantDetails(); break; case "Dinner": displayDinnerRegistrantDetails(); break; case "Run": displayRunRegistrantDetails(); break; case "Donation": displayDonationDetails(); break; } } catch (Exception ex) { ErrorLog.logError(ex); Response.Redirect("Oops.aspx"); } }