/// <summary> /// This method verifies the user input by calling verifyGolfRegistration() (Business tier handles verification). /// Upon success, it adds two session variables and redirects to checkout.aspx /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// 11/18/12 Michael Larsen /// Tested by Michael Larsen 11/27/12 protected void btnCheckout_Click(object sender, EventArgs e) { try { BusinessTier bt = new BusinessTier(); int numInParty; Int32.TryParse(txtNumInParty.Text, out numInParty); if (numInParty <= 0) { lblError.Text = "Please enter a valid number for 'Number in Party'"; PresentationHelpers.FocusControlOnPageLoad(lblError.ClientID, this.Page); } else { Dictionary<String, String> golfRegInfo = grabGolfRegInfo(); DataSet ds = bt.validateGolfReg(golfRegInfo); if (ds.Tables[0].Rows.Count > 0) displayUserInputErrors(ds); else { double cost = Convert.ToDouble(Session["admissionPrice"]) * Convert.ToDouble(txtNumInParty.Text); golfRegInfo["cost"] = cost.ToString(); Session["regInfo"] = golfRegInfo; Session["eventID"] = Request["eventID"].ToString(); Response.Redirect("Checkout.aspx", false); } } } catch (Exception ex) { ErrorLog.logError(ex); Response.Redirect("Oops.aspx",false); } }