Ejemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e) {

            if (Request.Form["id"] == null) {
                Response.Redirect("/Coffee.aspx");
            }
            var order = new CoffeeOrder(Request.Form["id"].ToString());

            Session["order"] = order;
            Response.Redirect("Order.aspx");
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e) {

            string apiLogin = ConfigurationManager.AppSettings["ApiLogin"];
            string transactionKey = ConfigurationManager.AppSettings["TransactionKey"];

            if ((string.IsNullOrEmpty(apiLogin)) || (apiLogin.Trim().Length == 0) || (apiLogin == "ApiLogin") 
                || (string.IsNullOrEmpty(transactionKey)) || (transactionKey.Trim().Length == 0) || (transactionKey == "TransactionKey"))
            {
                CoffeeOrder order = new CoffeeOrder("");
                order.OrderMessage = "Please replace the ApiLogin and TransactionKey values in Web.config file with your Authorize.Net account!";
                Session["order"] = order;
                Response.Redirect("Error.aspx");
            }
        }