コード例 #1
0
ファイル: PlaceOrder.aspx.cs プロジェクト: smzakaria/boromela
    protected void btnPlaceOrder_Click1(object sender, EventArgs e)
    {
        // this.LoadRecord_Buyer_Information(intProfileID, UserType);
        try
        {
            using (ShoppingCartAccess shoppingCart = new ShoppingCartAccess())
            {
                if (Int32.TryParse(hfOrderID.Value, out intOrderID))
                {
                    if (!shoppingCart.IsOrder_PlacedOnce(intOrderID))
                    {
                        if (shoppingCart.Verify_CustomerOrder(intOrderID,
                                                              hfCustomerName.Value, hfCustomerEmail.Value, hfShippingAddress.Value, hfBillingAddress.Value))
                        {
                            string strQueryString = "oi=" + hfOrderID.Value;
                            strQueryString += "&pfi=" + hfProfileID.Value;
                            strQueryString += "&ut=" + hfUserType.Value;
                            strQueryString += "&po=" + hfPaymentOption.Value;
                            //strQueryString += "&po=" + Server.UrlEncode(hfPaymentOption.Value);
                            strQueryString += "&total=" + hfTotalAmount.Value;
                            strQueryString += "&curr=" + hfCurrency.Value;

                            string strEncryptedUrl = UTLUtilities.Encrypt(strQueryString);
                            //string strDecryptedUrl =

                            Response.Redirect("OrderConfirmation.aspx?data=" + strEncryptedUrl, false);
                        }
                        else
                        {
                            lblSystemMessage.Text = "There were some errors processing your order. Please contact Boromela.";
                        }
                    }
                    else
                    {
                        string data = UTLUtilities.Encrypt("You may have already placed this order once.");
                        Response.Redirect("../Error.aspx?data=" + data, false);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            lblSystemMessage.Text = "Error: " + ex.Message;
        }
    }