Пример #1
0
    protected void EmailButton_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }
        SaveButton_Click(sender, e);
        string cartID = GetLoggedUserName();

        if (string.IsNullOrEmpty(cartID))
        {
            cartID = Request.AnonymousID;
        }

        string cartLink = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreURL) + "/ShoppingCart.aspx?CartID=" + cartID;

        try
        {
            EmailManager.EmailCart(cartLink, EmailTextBox.Text);
            MessageLiteral.Text = "Your cart has been emailed";
        }
        catch (Exception ex)
        {
            MessageLiteral.Text = ex.Message;
        }
    }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         GoogleImageButton.ImageUrl = String.Format(StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleImageButtonURL), StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantID));
     }
 }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         BindProducts();
         Page.Title = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
     }
 }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (StoreConfiguration.GetConfigurationValue(ConfigurationKey.SetupRan) == "true")
     {
         Utils.IS_CONFIGURED = true;
         Response.Redirect("../Default.aspx");
     }
 }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["CartID"]))
            {
                LoadCart(Request.QueryString["CartID"]);
            }

            BindCart();
            GoogleCheckoutControl1.Visible = Convert.ToBoolean(StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleCheckoutEnabled));
            Page.Title = "My Cart - " + StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
        }
    }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     RelatedProductsControl1.ProductID = CartProduct.ProductID.ToString();
     ProductOptionsControl1.ProductID  = CartProduct.ProductID;
     CustomFieldsControl1.ProductID    = CartProduct.ProductID;
     if (ProductBreadcrumbControl1 != null)
     {
         ProductBreadcrumbControl1.ProductID = CartProduct.ProductID;
     }
     if (!Page.IsPostBack)
     {
         Page.Title = CartProduct.ProductName + " - " + StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
         CheckProductInventory();
     }
 }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //If store is not configurated, show configuration screen
     if (!Utils.IS_CONFIGURED && StoreConfiguration.GetConfigurationValue(ConfigurationKey.SetupRan) == "true")
     {
         Utils.IS_CONFIGURED = true;
     }
     else if (!Utils.IS_CONFIGURED)
     {
         Response.Redirect("Setup/Default.aspx");
     }
     if (!Page.IsPostBack)
     {
         Page.Title = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
     }
 }
Пример #8
0
 protected void GoogleImageButton_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string           orderXML       = GetGoogleCartCode();
         string           googleResponse = Utils.PostToURL(String.Format(StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleCheckoutURL), StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantID)), orderXML, StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantID), StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantkey));
         TextReader       reader         = new StringReader(googleResponse);
         XmlSerializer    serializer     = new XmlSerializer(typeof(CheckoutRedirect));
         CheckoutRedirect redirect       = (CheckoutRedirect)serializer.Deserialize(reader);
         Response.Redirect(redirect.redirecturl);
     }
     catch (Exception ex)
     {
         MessageLabel.Text = "Problem using Google Checkout.";
     }
 }
Пример #9
0
 private void LoadForm()
 {
     StoreName.Text                  = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName);
     StoreURL.Text                   = StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreURL);
     SalesTeamEmail.Text             = StoreConfiguration.GetConfigurationValue(ConfigurationKey.SalesTeamEmail);
     NewOrdersEmail.Text             = StoreConfiguration.GetConfigurationValue(ConfigurationKey.NewOrdersEmail);
     ContactEmail.Text               = StoreConfiguration.GetConfigurationValue(ConfigurationKey.ContactEmail);
     PayPalAPIUsername.Text          = StoreConfiguration.GetConfigurationValue(ConfigurationKey.PayPalAPIUsername);
     PayPalAPIPassword.Text          = StoreConfiguration.GetConfigurationValue(ConfigurationKey.PayPalAPIPassword);
     PayPalAPISignature.Text         = StoreConfiguration.GetConfigurationValue(ConfigurationKey.PayPalAPISignature);
     GoogleCheckoutEnabled.Checked   = Convert.ToBoolean(StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleCheckoutEnabled));
     GoogleMerchantID.Text           = StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantID);
     GoogleMerchantkey.Text          = StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleMerchantkey);
     GoogleImageButtonURL.Text       = StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleImageButtonURL);
     GoogleCheckoutURL.Text          = StoreConfiguration.GetConfigurationValue(ConfigurationKey.GoogleCheckoutURL);
     AuthorizeNetTestMode.Checked    = Convert.ToBoolean(StoreConfiguration.GetConfigurationValue(ConfigurationKey.AuthorizeNetTestMode));
     AuthorizeNetAPILoginID.Text     = StoreConfiguration.GetConfigurationValue(ConfigurationKey.AuthorizeNetAPILoginID);
     AuthorizeNetTransactionKey.Text = StoreConfiguration.GetConfigurationValue(ConfigurationKey.AuthorizeNetTransactionKey);
 }
Пример #10
0
    private void SendNewCustomerOrderEmail(string orderNo)
    {
        Dictionary <string, string> replacmentValues = new Dictionary <string, string>();

        replacmentValues.Add("FirstName", FirstNameTextBox.Text);
        replacmentValues.Add("OrderNumber", orderNo);
        replacmentValues.Add("StoreName", StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName));
        replacmentValues.Add("StoreURL", StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreURL));

        string emailBody = EmailManager.GetEmailString(replacmentValues, EmailType.NewSaleCustomerEmail);

        Email.SendSimpleEmail(StoreConfiguration.GetConfigurationValue(ConfigurationKey.StoreName) + " Sales",
                              StoreConfiguration.GetConfigurationValue(ConfigurationKey.SalesTeamEmail), new List <System.Net.Mail.MailAddress>()
        {
            new System.Net.Mail.MailAddress(EmailTextBox.Text)
        },
                              "New Order Confirmation",
                              emailBody,
                              true);
    }
Пример #11
0
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }
        try
        {
            StringBuilder sb = new StringBuilder();
            // Build the email body
            sb.Append("Name: " + NameTextBox.Text + "<br>");
            sb.Append("Email: " + EmailTextBox.Text + "<br>");
            sb.Append("Phone: " + PhoneTextBox.Text + "<br>");
            sb.Append("Subject: " + SubjectDropDownList.SelectedValue + "<br>");
            sb.Append("Order Number: " + OrderNumberTextBox.Text + "<br>");
            sb.Append("Comments: " + CommentsTextBox.Text + "<br>");
            sb.Append("Where did you hear about us? " + AboutTextBox.Text + "<br>");

            Email.SendSimpleEmail(NameTextBox.Text,
                                  EmailTextBox.Text,
                                  new List <System.Net.Mail.MailAddress>()
            {
                new System.Net.Mail.MailAddress(StoreConfiguration.GetConfigurationValue(ConfigurationKey.ContactEmail))
            },
                                  "Contact Form - " + SubjectDropDownList.SelectedValue,
                                  sb.ToString(),
                                  true);

            MessageLabel.Text    = "Your inquiry has been sent to us. Please allow for two business days to respond.";
            SubmitButton.Enabled = false;
        }
        catch (Exception ex)
        {
            MessageLabel.Text = "Error sending email: " + ex.Message;
        }
    }