private void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                var roleSett = HccApp.CurrentStore.Settings.AdminRoles;
                roleSett.RoleCatalogManagement   = ddlCatalogManagement.SelectedValue;
                roleSett.RoleOrdersAndCustomers  = ddlOrdersManagement.SelectedValue;
                roleSett.RoleStoreAdministration = ddlStoreAdministration.SelectedValue;
                roleSett.RoleMobileAccess        = ddlMobileAccess.SelectedValue;

                HccApp.UpdateCurrentStore();

                msg.ShowOk(Localization.GetString("SettingsSuccessful"));
            }
        }
Пример #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveTaxationSetting();

                // hide wizard after setup completion
                var sett = HccApp.CurrentStore.Settings.Urls;
                sett.HideSetupWizardWelcome = true;
                HccApp.UpdateCurrentStore();

                //Show Next View
                NotifyFinishedEditing("EXIT");
            }
        }
Пример #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                SaveStoreInfo();
                SaveAddress();
                SaveLocation();
                SaveUrls();

                HccApp.UpdateCurrentStore();

                BindStoreInfo();

                NotifyFinishedEditing();
            }
        }
        private void SaveChanges()
        {
            var newList = new List <string>();

            for (var i = 0; i < PaymentMethodsGrid.Rows.Count; i++)
            {
                var chkEnabled = PaymentMethodsGrid.Rows[i].FindControl("chkEnabled") as CheckBox;
                if (chkEnabled != null && chkEnabled.Checked)
                {
                    newList.Add(PaymentMethodsGrid.DataKeys[i].Value.ToString());
                }
            }

            HccApp.CurrentStore.Settings.PaymentMethodsEnabled = newList;
            HccApp.UpdateCurrentStore();
        }
Пример #5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                SaveUrls();
                HccApp.UpdateCurrentStore();

                msg.ShowOk(Localization.GetString("SettingsSuccessful"));
            }
            catch (Exception ex)
            {
                msg.ShowError(string.Concat(Localization.GetString("ErrorOccured"), "&nbsp; ", ex));
            }

            BindUrls();
        }
Пример #6
0
        private void SaveChanges()
        {
            var newList = new List <string>();

            for (var i = 0; i <= gvPaymentMethods.Rows.Count - 1; i++)
            {
                var chkEnabled = gvPaymentMethods.Rows[i].FindControl("chkEnabled") as CheckBox;
                if (chkEnabled != null && chkEnabled.Checked)
                {
                    var paymentMethodId = (string)gvPaymentMethods.DataKeys[i].Value;
                    newList.Add(paymentMethodId);
                }
            }

            HccApp.CurrentStore.Settings.PaymentMethodsEnabled = newList;
            HccApp.UpdateCurrentStore();
        }
        protected void btnSave_OnClick(object sender, EventArgs e)
        {
            HccApp.CurrentStore.Settings.FaceBook.UseFaceBook = chkUseFaceBook.Checked;
            HccApp.CurrentStore.Settings.FaceBook.Admins      = FaceBookAdminsField.Text;
            HccApp.CurrentStore.Settings.FaceBook.AppId       = FaceBookAppIdField.Text;

            HccApp.CurrentStore.Settings.Twitter.UseTwitter    = chkUseTwitter.Checked;
            HccApp.CurrentStore.Settings.Twitter.TwitterHandle = TwitterHandleField.Text.Trim()
                                                                 .Replace("@", string.Empty);
            HccApp.CurrentStore.Settings.Twitter.DefaultTweetText = DefaultTweetTextField.Text.Trim();

            HccApp.CurrentStore.Settings.GooglePlus.UseGooglePlus = chkUseGooglePlus.Checked;

            HccApp.CurrentStore.Settings.Pinterest.UsePinterest = chkUsePinterest.Checked;

            HccApp.UpdateCurrentStore();

            msg.ShowOk(Localization.GetString("SettingsSuccessful"));
        }
Пример #8
0
        private void SaveData()
        {
            ShippingMethod.Name           = NameField.Text.Trim();
            ShippingMethod.ZoneId         = long.Parse(lstZones.SelectedItem.Value);
            ShippingMethod.AdjustmentType =
                (ShippingMethodAdjustmentType)int.Parse(AdjustmentDropDownList.SelectedValue);
            ShippingMethod.Adjustment = decimal.Parse(AdjustmentTextBox.Text, NumberStyles.Currency);

            if (ShippingMethod.AdjustmentType == ShippingMethodAdjustmentType.Amount)
            {
                ShippingMethod.Adjustment = Money.RoundCurrency(ShippingMethod.Adjustment);
            }

            // Global Settings
            HccApp.CurrentStore.Settings.ShippingUSPostalUserId      = txtUserId.Text.Trim();
            HccApp.CurrentStore.Settings.ShippingUSPostalDiagnostics = chbDiagnostics.Checked;
            HccApp.UpdateCurrentStore();

            // Method Settings
            var Settings = new USPostalServiceSettings();

            Settings.Merge(ShippingMethod.Settings);

            // Service Code
            var filter = new List <IServiceCode>();

            foreach (ListItem item in ShippingTypesCheckBoxList.Items)
            {
                if (item.Selected)
                {
                    var code = new ServiceCode {
                        Code = item.Value, DisplayName = item.Text
                    };
                    filter.Add(code);
                }
            }

            Settings.ServiceCodeFilter = filter;

            Settings["highlight"] = lstHighlights.SelectedValue;
            ShippingMethod.Settings.Merge(Settings);
        }
Пример #9
0
        private bool SaveSettings()
        {
            var sett = HccApp.CurrentStore.Settings;

            sett.AffiliateCommissionAmount = Convert.ToDecimal(txtCommissionAmount.Text);
            sett.AffiliateReferralDays     = Convert.ToInt32(txtReferralDays.Text);
            var typeSelection = Convert.ToInt32(lstCommissionType.SelectedValue);

            sett.AffiliateCommissionType = (AffiliateCommissionType)typeSelection;
            var conflictSelection = Convert.ToInt32(lstConflictMode.SelectedValue);

            sett.AffiliateConflictMode = (AffiliateConflictMode)conflictSelection;

            sett.AffiliateRequireApproval  = chkRequireApproval.Checked;
            sett.AffiliateDisplayChildren  = chkDisplayChildren.Checked;
            sett.AffiliateShowIDOnCheckout = chkShowIDOnCheckout.Checked;
            sett.AffiliateAgreementText    = txtAgreementText.Text;
            sett.AffiliateReview           = chkAffiliateNotify.Checked;

            return(HccApp.UpdateCurrentStore());
        }
Пример #10
0
        private bool Save()
        {
            var store = HccApp.CurrentStore;

            store.Settings.ProductEnableSwatches = chkSwatches.Checked;

            decimal weight = 0;

            decimal.TryParse(txtOrderLimitWeight.Text.Trim(), NumberStyles.Float, Thread.CurrentThread.CurrentUICulture,
                             out weight);

            store.Settings.MaxItemsPerOrder      = int.Parse(txtOrderLimitQuantity.Text.Trim());
            store.Settings.MaxWeightPerOrder     = Math.Round(weight, 3);
            store.Settings.AllowZeroDollarOrders = chkZeroDollarOrders.Checked;

            store.Settings.RequirePhoneNumber = chkRequirePhoneNumber.Checked;

            if (UpdateLastOrderNumber)
            {
                var lastOrderNumber = 0;

                if (int.TryParse(txtLastOrderNumber.Text.Trim(), out lastOrderNumber))
                {
                    HccApp.AccountServices.Stores.SetLastOrderNumber(HccApp.CurrentStore.Id, lastOrderNumber);
                }
            }

            store.Settings.UseChildChoicesAdjustmentsForBundles = chkUseChildChoicesAdjustmentsForBundles.Checked;
            store.Settings.ForceTermsAgreement = chkForceSiteTerms.Checked;

            store.Settings.PreserveCartInSession   = ddlShoppingCartStore.SelectedValue == "1";
            store.Settings.SendAbandonedCartEmails = chkSendAbandonedCartEmails.Checked;
            store.Settings.SendAbandonedEmailIn    = int.Parse(txtSendAbandonedEmailIn.Text.Trim());

            store.Settings.QuickbooksOrderAccount    = txtQuickbooksOrderAccount.Text.Trim();
            store.Settings.QuickbooksShippingAccount = txtQuickbooksShippingAccount.Text.Trim();

            return(HccApp.UpdateCurrentStore());
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                var allCountries = HccApp.GlobalizationServices.Countries.FindAll();

                var iso3Codes = new List <string>();
                foreach (GridViewRow row in gvCountries.Rows)
                {
                    var chbEnabled = row.FindControl("chbEnabled") as CheckBox;
                    if (!chbEnabled.Checked)
                    {
                        var country = allCountries[row.DataItemIndex];
                        iso3Codes.Add(country.IsoAlpha3);
                    }
                }

                HccApp.CurrentStore.Settings.DisabledCountryIso3Codes = iso3Codes;
                HccApp.UpdateCurrentStore();

                ucMessageBox.ShowOk(Localization.GetString("SettingsSuccessful"));
            }
        }
Пример #12
0
        private void SaveData()
        {
            ShippingMethod.Name           = NameField.Text.Trim();
            ShippingMethod.ZoneId         = long.Parse(lstZones.SelectedValue);
            ShippingMethod.AdjustmentType =
                (ShippingMethodAdjustmentType)int.Parse(AdjustmentDropDownList.SelectedValue);
            ShippingMethod.Adjustment = decimal.Parse(AdjustmentTextBox.Text, NumberStyles.Currency);

            if (ShippingMethod.AdjustmentType == ShippingMethodAdjustmentType.Amount)
            {
                ShippingMethod.Adjustment = Money.RoundCurrency(ShippingMethod.Adjustment);
            }

            // Method Settings
            var Settings = new FedExServiceSettings();

            Settings.Merge(ShippingMethod.Settings);
            Settings.ServiceCode           = int.Parse(lstServiceCode.SelectedValue);
            Settings.Packaging             = int.Parse(lstPackaging.SelectedValue);
            Settings["highlight"]          = lstHighlights.SelectedValue;
            Settings["UseNegotiatedRates"] = chkNegotiatedRates.Checked.ToString();
            ShippingMethod.Settings.Merge(Settings);

            // Globals
            HccApp.CurrentStore.Settings.ShippingFedExKey                      = KeyField.Text.Trim();
            HccApp.CurrentStore.Settings.ShippingFedExPassword                 = PasswordField.Text.Trim();
            HccApp.CurrentStore.Settings.ShippingFedExAccountNumber            = AccountNumberField.Text.Trim();
            HccApp.CurrentStore.Settings.ShippingFedExMeterNumber              = MeterNumberField.Text.Trim();
            HccApp.CurrentStore.Settings.ShippingFedExDefaultPackaging         = int.Parse(lstDefaultPackaging.SelectedValue);
            HccApp.CurrentStore.Settings.ShippingFedExDropOffType              = int.Parse(lstDropOffType.SelectedValue);
            HccApp.CurrentStore.Settings.ShippingFedExForceResidentialRates    = chkResidential.Checked;
            HccApp.CurrentStore.Settings.ShippingFedExDiagnostics              = chkDiagnostics.Checked;
            HccApp.CurrentStore.Settings.ShippingFedExUseDevelopmentServiceUrl = chkDevelopmentUrl.Checked;

            HccApp.UpdateCurrentStore();
        }
 private void SaveTaxationSetting()
 {
     HccApp.CurrentStore.Settings.ApplyVATRules = chkApplyVATRules.Checked;
     HccApp.UpdateCurrentStore();
 }
Пример #14
0
        protected void btnAccept_Click(object sender, EventArgs e)
        {
            if (rbContactYes.Checked == false & rbContactNo.Checked == false)
            {
                msg.ShowWarning(Localization.GetString("ContactWarning"));
            }
            else
            {
                try
                {
                    var UPSReg = new Registration();

                    UPSReg.Address1 = inAddress1.Text.Trim();
                    if (inAddress2.Text.Trim().Length > 0)
                    {
                        UPSReg.Address2 = inAddress2.Text.Trim();
                    }
                    if (inAddress3.Text.Trim().Length > 0)
                    {
                        UPSReg.Address3 = inAddress3.Text.Trim();
                    }
                    UPSReg.City    = inCity.Text.Trim();
                    UPSReg.Company = inCompany.Text.Trim();
                    UPSReg.Title   = inTitle.Text.Trim();
                    UPSReg.Country = inCountry.SelectedValue;
                    UPSReg.Email   = inEmail.Text.Trim();
                    UPSReg.Name    = inName.Text.Trim();
                    UPSReg.URL     = inURL.Text.Trim();
                    UPSReg.Phone   = inPhone.Text.Trim();
                    if (inCountry.SelectedValue == "US" || inCountry.SelectedValue == "CA")
                    {
                        UPSReg.State = inState.SelectedValue;
                        UPSReg.Zip   = inZip.Text.Trim();
                    }
                    if (rbContactYes.Checked)
                    {
                        UPSReg.ContactMe = "yes";
                    }
                    else
                    {
                        UPSReg.ContactMe = "no";
                    }
                    UPSReg.AccountNumber = inUPSAccountNumber.Text.Trim();

                    var sTempLicense = lblLicense.Text;
                    sTempLicense = sTempLicense.Replace("&nbsp;<br/>", ((char)10).ToString());
                    sTempLicense = Server.HtmlDecode(sTempLicense);

                    UPSReg.License = sTempLicense;


                    if (UPSReg.AcceptLicense(UPSService.UPSLIVESERVER))
                    {
                        HccApp.CurrentStore.Settings.ShippingUpsLicense = UPSReg.LicenseNumber;

                        // Complete Registration process here...

                        var tempUsername = "******";
                        if (inPhone.Text.Trim().Length > 3)
                        {
                            tempUsername += inPhone.Text.Trim().Substring(inPhone.Text.Trim().Length - 4, 4);
                        }
                        UPSReg.Password = PasswordGenerator.GeneratePassword(10);
                        if (UPSReg.Password.Length > 10)
                        {
                            UPSReg.Password = UPSReg.Password.Substring(0, 10);
                        }

                        var RegistrationComplete    = false;
                        var MaxRegistrationAttempts = 10;
                        var CurrentAttempts         = 0;


                        while (true)
                        {
                            CurrentAttempts += 1;
                            if (RegistrationComplete | CurrentAttempts > MaxRegistrationAttempts)
                            {
                                break;
                            }
                            UPSReg.Username = tempUsername;

                            UPSReg.RequestSuggestedUsername = true;
                            if (UPSReg.Register(UPSService.UPSLIVESERVER))
                            {
                                // Got Suggested Username
                                UPSReg.Username = UPSReg.SuggestedUsername;

                                // Now attempt actual registration
                                UPSReg.RequestSuggestedUsername = false;
                                if (UPSReg.Register(UPSService.UPSLIVESERVER))
                                {
                                    HccApp.CurrentStore.Settings.ShippingUpsUsername = UPSReg.Username;
                                    HccApp.CurrentStore.Settings.ShippingUpsPassword = UPSReg.Password;
                                    HccApp.AccountServices.Stores.Update(HccApp.CurrentStore);
                                    RegistrationComplete = true;
                                    break;
                                }
                            }

                            UPSReg.RequestSuggestedUsername = false;
                        }

                        if (RegistrationComplete)
                        {
                            Response.Redirect("ShippingUpsThanks.aspx");
                        }
                        else
                        {
                            msg.ShowError(Localization.GetString("RegistrationIncompleteError"));
                        }
                    }
                    else
                    {
                        msg.ShowError(string.Concat(UPSReg.ErrorMessage, "<br/>", Localization.GetString("ErrorCode"),
                                                    ":", UPSReg.ErrorCode));
                    }
                }
                catch (Exception Ex)
                {
                    ExceptionLogger.LogException(Ex);
                    msg.ShowException(Ex);
                }
            }

            HccApp.UpdateCurrentStore();
        }
Пример #15
0
 private bool Save()
 {
     HccApp.CurrentStore.Settings.AutomaticallyIssueRMANumbers =
         AutomaticallyIssueRMACheckBoxList.SelectedValue == "1";
     return(HccApp.UpdateCurrentStore());
 }
 protected void btnSkip_Click(object sender, EventArgs e)
 {
     SaveDisplaySettings();
     HccApp.UpdateCurrentStore();
     NotifyFinishedEditing("EXIT");
 }
Пример #17
0
 private bool Save()
 {
     HccApp.CurrentStore.Settings.MailServer.EmailForGeneral  = ContactEmailField.Text.Trim();
     HccApp.CurrentStore.Settings.MailServer.EmailForNewOrder = OrderNotificationEmailField.Text.Trim();
     return(HccApp.UpdateCurrentStore());
 }
Пример #18
0
 private bool Save()
 {
     HccApp.CurrentStore.Settings.StoreClosedDescription = ContentField.Text;
     return(HccApp.UpdateCurrentStore());
 }