private void SaveBillingCycle()
        {
            if (!Page.IsValid)
            {
                return;
            }

            try
            {
                string cycleName     = txtCycleName.Text.Trim();
                string billingPeriod = ddlBillingPeriod.SelectedValue.Trim();
                int    periodLength  = Convert.ToInt32(txtPeriodLength.Text.Trim());

                int result = StorehouseHelper.UpdateBillingCycle(ecPanelRequest.BillingCycleId, cycleName, billingPeriod, periodLength);

                if (result < 0)
                {
                    ShowResultMessage(result);
                    return;
                }
            }
            catch (Exception ex)
            {
                // show error
                ShowErrorMessage("BILLING_CYCLE_SAVE", ex);
                return;
            }

            RedirectToBrowsePage();
        }
Esempio n. 2
0
 private void SaveRegistrarSettings()
 {
     try
     {
         KeyValueBunch props = new KeyValueBunch();
         //
         props[EnomSettings.USERNAME]  = txtServiceUsername.Text.Trim();
         props[EnomSettings.LIVE_MODE] = chkLiveMode.Checked.ToString();
         if (txtServicePassword.PasswordChanged)
         {
             props[EnomSettings.PASSWORD] = txtServicePassword.Text;
         }
         // set plugins props
         int result = StorehouseHelper.SetPluginProperties(SupportedPlugin.ENOM, props);
         if (result < 0)
         {
             // ERROR
             ShowResultMessage(result);
             return;
         }
         //
         RedirectToBrowsePage();
     }
     catch (Exception ex)
     {
         ShowErrorMessage("SAVE_PLUGIN_SETTINGS", ex);
     }
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Step #1: Disable "On Behalf Of" feature if that the case
            if (PanelSecurity.LoggedUserId != PanelSecurity.SelectedUserId)
            {
                DisablePageFunctionality();
                ShowWarningMessage("WORK_ON_BEHALF_DISABLED");
                return;
            }

            // Step #2: Create customer contract if necessary
            if (!StorehouseHelper.CheckCustomerContractExists())
            {
                ContractAccount accountSettings = ecUtils.GetContractAccountFromUserInfo(PanelSecurity.SelectedUser);
                GenericResult   result          = StorefrontHelper.AddContract(PanelSecurity.SelectedUser.OwnerId, accountSettings);
                // Show error message
                if (!result.Succeed)
                {
                    DisablePageFunctionality();
                    ShowResultMessage(result.GetProperty <int>("ResultCode"));
                    return;
                }
            }

            // Step #3: Load customer contract
            myContract = StorehouseHelper.GetCustomerContract(PanelSecurity.SelectedUserId);

            // Step #4: Bind payment profile
            if (!IsPostBack)
            {
                BindPaymentProfile();
            }
        }
Esempio n. 4
0
        private void AddManualPayment()
        {
            if (!Page.IsValid)
            {
                return;
            }

            try
            {
                decimal totalAmount = ctlManualPayment.TotalAmount;
                if (totalAmount == 0)
                {
                    totalAmount = CustomerInvoice.Total;
                }

                int result = StorehouseHelper.AddCustomerPayment(CustomerInvoice.ContractId, CustomerInvoice.InvoiceId,
                                                                 ctlManualPayment.TransactionId, totalAmount, ctlManualPayment.Currency,
                                                                 ctlManualPayment.SelectedMethod, ctlManualPayment.TranStatus);

                if (result < 0)
                {
                    ShowResultMessage(result);
                    return;
                }
                //
                RedirectToBrowsePage();
            }
            catch (Exception ex)
            {
                ShowErrorMessage("ADD_INVOICE_PAYMENT", ex);
            }
        }
        private void LoadProvisoningSettings()
        {
            StoreSettings settings = StorehouseHelper.GetStoreSettings(StoreSettings.SYSTEM_SETTINGS);

            //
            if (settings != null)
            {
                if (!String.IsNullOrEmpty(settings["InvoiceGracePeriod"]))
                {
                    txtGracePeriod.Text = settings["InvoiceGracePeriod"];
                }
                //
                txtInvoiceNumFormat.Text = settings["InvoiceNumberFormat"];
                //
                txtBaseCurrency.Text = settings["BaseCurrency"];
                //
                if (!String.IsNullOrEmpty(settings["SvcInvoiceThreshold"]))
                {
                    txtSvcsInvoiceThreshold.Text = settings["SvcInvoiceThreshold"];
                }
                //
                if (!String.IsNullOrEmpty(settings["SvcCancelThreshold"]))
                {
                    txtSvcsCancelThreshold.Text = settings["SvcCancelThreshold"];
                }
                //
                rblUseSSL.SelectedIndex = ecUtils.ParseBoolean(settings["SecurePayments"], true) ? 0 : 1;
            }
        }
        private void SavePaymentMethod()
        {
            try
            {
                //
                int result = StorehouseHelper.SetPluginProperties(SupportedPlugin.TO_CHECKOUT, ctlPluginProps.Properties);
                //
                if (result < 0)
                {
                    ShowResultMessage(result);
                    //
                    return;
                }

                // update payment method
                result = StorehouseHelper.SetPaymentMethod(PaymentMethod.TCO,
                                                           txtDisplayName.Text.Trim(), SupportedPlugin.TO_CHECKOUT);
                //
                if (result < 0)
                {
                    ShowResultMessage(result);
                    //
                    return;
                }
                //
                RedirectToBrowsePage();
            }
            catch (Exception ex)
            {
                ShowErrorMessage("SAVE_PAYMENT_METHOD", ex);
            }
        }
Esempio n. 7
0
 private void SavePaymentMethod()
 {
     try
     {
         // update provider settings
         IPluginProperties ctlSettings = (IPluginProperties)FindControl(CTL_CC_PROVIDER);
         //
         int result = StorehouseHelper.SetPluginProperties(ExtractProvId(ddlAcceptPlugins.SelectedValue),
                                                           ctlSettings.Properties);
         //
         if (result < 0)
         {
             ShowResultMessage(result);
             //
             return;
         }
         // update payment method
         result = StorehouseHelper.SetPaymentMethod(PaymentMethod.CREDIT_CARD,
                                                    txtDisplayName.Text.Trim(), ExtractProvId(ddlAcceptPlugins.SelectedValue));
         //
         if (result < 0)
         {
             ShowResultMessage(result);
             //
             return;
         }
         //
         RedirectToBrowsePage();
     }
     catch (Exception ex)
     {
         ShowErrorMessage("SAVE_PAYMENT_METHOD", ex);
     }
 }
        private void LoadHostingPlansAvailable()
        {
            HostingPlansHelper plans = new HostingPlansHelper();

            string[] plansTaken = Array.ConvertAll <int, string>(
                StorehouseHelper.GetHostingPlansTaken(),
                new Converter <int, string>(Convert.ToString)
                );

            DataSet ds = plans.GetRawHostingPlans();

            // check empty dataset
            if (ds != null && ds.Tables.Count > 0)
            {
                // apply filter only if necessary
                if (plansTaken.Length > 0)
                {
                    // apply filter for plans already created
                    ds.Tables[0].DefaultView.RowFilter = "PlanID NOT IN (" + String.Join(",", plansTaken) + ")";
                }

                // bind default view
                ddlHostingPlans.DataSource = ds.Tables[0].DefaultView;
                ddlHostingPlans.DataBind();
            }
        }
Esempio n. 9
0
 private void LoadProviders()
 {
     SupportedPlugin[] plugins = StorehouseHelper.GetSupportedPluginsByGroup(
         SupportedPlugin.CC_GATEWAY_GROUP);
     //
     foreach (SupportedPlugin plugin in plugins)
     {
         ddlAcceptPlugins.Items.Add(new ListItem(plugin.DisplayName,
                                                 plugin.PluginName + "_" + plugin.PluginId));
     }
 }
        private void SaveHostingPlan()
        {
            if (!Page.IsValid)
            {
                return;
            }

            try
            {
                string planName        = ddlHostingPlans.SelectedItem.Text;
                string productSku      = txtProductSku.Text.Trim();
                string planDescription = txtHostingPlanDesc.Text.Trim();
                bool   enabled         = Convert.ToBoolean(rblPlanStatus.SelectedValue);
                bool   taxInclusive    = chkTaxInclusive.Checked;

                int planId        = Convert.ToInt32(ddlHostingPlans.SelectedValue);
                int userRole      = Convert.ToInt32(rblPlanIntendsFor.SelectedValue);
                int initialStatus = Convert.ToInt32(ddlInitialStatus.SelectedValue);
                int domainOption  = Convert.ToInt32(ddlDomainOption.SelectedValue);

                HostingPlanCycle[] planCycles = ctlPlanCycles.GetHostingPlanCycles();
                int[]    planCategories       = ctlAssignedCats.AssignedCategories;
                string[] planHighlights       = ctlPlanHighlights.HighlightedItems.ToArray();
                // create hosting plan
                int result = StorehouseHelper.UpdateHostingPlan(
                    ecPanelRequest.ProductId,
                    planName,
                    productSku,
                    taxInclusive,
                    planId,
                    userRole,
                    initialStatus,
                    domainOption,
                    enabled,
                    planDescription,
                    planCycles,
                    planHighlights,
                    planCategories
                    );

                if (result < 0)
                {
                    ShowResultMessage(result);
                    return;
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("HOSTING_PLAN_SAVE", ex);
                return;
            }

            RedirectToBrowsePage();
        }
Esempio n. 11
0
 private void DoContractAccountGet(WizardNavigationEventArgs e)
 {
     try
     {
         Contract contract = StorehouseHelper.GetCustomerContract(WSP.PanelSecurity.SelectedUserId);
         ctlUserAccount.ContractId = contract.ContractId;
     }
     catch (Exception ex)
     {
         ShowErrorMessage("GET_CUSTOMER_CONTRACT", ex);
     }
 }
 private void VoidInvoice(int invoiceId)
 {
     try
     {
         StorehouseHelper.VoidCustomerInvoice(invoiceId);
         //
         gvCustomersInvoices.DataBind();
     }
     catch (Exception ex)
     {
         ShowErrorMessage("VOID_CUSTOMER_INVOICE", ex);
     }
 }
        private void DomainRegistrars_PreRender()
        {
            // ENOM
            bool enomActive = StorehouseHelper.IsSupportedPluginActive(SupportedPlugin.ENOM);

            LinkEnomRegistrar.Text += " " + (enomActive ? "(" + GetSharedLocalizedString(Keys.ModuleName, ITEM_ENABLED) + ")"
                                : "(" + GetSharedLocalizedString(Keys.ModuleName, ITEM_DISABLED) + ")");
            // DIRECTI
            bool directiActive = StorehouseHelper.IsSupportedPluginActive(SupportedPlugin.DIRECTI);

            LinkDirectiRegistrar.Text += " " + (directiActive ? "(" + GetSharedLocalizedString(Keys.ModuleName, ITEM_ENABLED) + ")"
                : "(" + GetSharedLocalizedString(Keys.ModuleName, ITEM_DISABLED) + ")");
        }
Esempio n. 14
0
 private void LoadWelcomeMessage()
 {
     try
     {
         StoreSettings settings = StorehouseHelper.GetStoreSettings(StoreSettings.WELCOME_MESSAGE);
         //
         txtWelcomeMsg.Text = settings["HtmlText"];
     }
     catch (Exception ex)
     {
         ShowErrorMessage("LOAD_WELCOME_MSG", ex);
     }
 }
Esempio n. 15
0
        private void AddTax()
        {
            // ensure page validity
            if (!Page.IsValid)
            {
                return;
            }

            try
            {
                //
                string description = txtDescription.Text.Trim();
                //
                string country = ddlCountries.SelectedValue;
                //
                string state = String.Empty;
                if (chkAllStates.Checked)
                {
                    state = ALL_STATES;
                }
                else
                {
                    state = (ddlStates.Visible) ? ddlStates.SelectedValue : txtStateProvince.Text.Trim();
                }
                //
                int taxTypeId = Convert.ToInt32(ddlTaxType.SelectedValue);
                //
                bool active = Convert.ToBoolean(rblTaxStatus.SelectedValue);
                //
                decimal amount = Convert.ToDecimal(txtTaxAmount.Text.Trim());
                //
                int result = StorehouseHelper.AddTaxation(country, state, description, taxTypeId,
                                                          amount, active);
                //
                if (result < 0)
                {
                    //
                    ShowResultMessage(Keys.ModuleName, result, country, state);
                    //
                    return;
                }
                //
                RedirectToBrowsePage();
            }
            catch (Exception ex)
            {
                ShowErrorMessage("SAVE_TAX", ex);
            }
        }
        private void LoadBillingCycle()
        {
            try
            {
                BillingCycle cycle = StorehouseHelper.GetBillingCycle(ecPanelRequest.BillingCycleId);

                txtCycleName.Text    = cycle.CycleName;
                txtPeriodLength.Text = cycle.PeriodLength.ToString();
                ecUtils.SelectListItem(ddlBillingPeriod, cycle.BillingPeriod);
            }
            catch (Exception ex)
            {
                ShowErrorMessage("BILLING_CYCLE_LOAD", ex);
            }
        }
Esempio n. 17
0
        private void SavePaymentProfile()
        {
            try
            {
                CheckoutDetails profile = ctlPaymentProfile.GetCheckoutDetails();

                StorehouseHelper.SetPaymentProfile(myContract.ContractId, profile);

                ShowSuccessMessage("SAVE_PAYMENT_PROFILE");
            }
            catch (Exception ex)
            {
                ShowErrorMessage("SAVE_PAYMENT_PROFILE", ex);
            }
        }
Esempio n. 18
0
        private void LoadTermsAndConds()
        {
            try
            {
                StoreSettings settings = StorehouseHelper.GetStoreSettings(StoreSettings.TERMS_AND_CONDITIONS);

                if (settings != null)
                {
                    txtTermsAndConds.Text = settings["StatementTemplate"];
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("LOAD_TERMS_CONDS", ex);
            }
        }
Esempio n. 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //
            Taxation cs_tax = StorehouseHelper.GetTaxation(ecPanelRequest.TaxationId);

            //
            if (cs_tax == null)
            {
                RedirectToBrowsePage();
            }
            //
            if (!IsPostBack)
            {
                //
                txtDescription.Text = cs_tax.Description;
                //
                PortalUtils.LoadCountriesDropDownList(ddlCountries, cs_tax.Country);
                //
                LoadCountryStates();
                //
                chkAllStates.Checked = String.Equals(ddlCountries.SelectedValue, TaxationsAddTax.ALL_COUNTRIES);
                chkAllStates.Checked = String.Equals(cs_tax.State, TaxationsAddTax.ALL_STATES);
                if (!chkAllStates.Checked)
                {
                    //
                    if (ddlStates.Visible)
                    {
                        ecUtils.SelectListItem(ddlStates, cs_tax.State);
                    }
                    else
                    {
                        txtStateProvince.Text = cs_tax.State;
                    }
                }
                chkAllStates_CheckedChanged(sender, e);
                //
                txtTaxAmount.Text = cs_tax.Amount.ToString("C");
                //
                rblTaxStatus.SelectedIndex = (cs_tax.Active) ? 0 : 1;
                //
                Utils.SelectListItem(ddlTaxType, cs_tax.TypeId);
                //
                SetTaxAmountValidationType(ddlTaxType.SelectedValue);
            }
        }
Esempio n. 20
0
 private void LoadRegistrarSettings()
 {
     try
     {
         KeyValueBunch props = StorehouseHelper.GetPluginProperties(SupportedPlugin.ENOM);
         //
         if (!props.IsEmpty)
         {
             txtServiceUsername.Text = props[EnomSettings.USERNAME];
             txtServicePassword.EnableDefaultPassword();
             chkLiveMode.Checked = ecUtils.ParseBoolean(props[EnomSettings.LIVE_MODE], false);
         }
     }
     catch (Exception ex)
     {
         ShowErrorMessage("LOAD_PLUGIN_SETTINGS", ex);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     //
     if (!IsPostBack)
     {
         // load hosting plan to edit
         EditingPlan = StorehouseHelper.GetHostingPlan(ecPanelRequest.ProductId);
         // redirect back if plan is incorrect
         if (EditingPlan == null)
         {
             RedirectToBrowsePage();
         }
         //
         LoadHostingPlansAvailable();
         //
         LoadFormFieldsWithData();
     }
 }
Esempio n. 22
0
 private bool DoContractAccountGet(WizardNavigationEventArgs e)
 {
     try
     {
         Contract contract = StorehouseHelper.GetCustomerContract(PanelSecurity.SelectedUserId);
         if (contract != null)
         {
             ctlCustomerCreate.ContractId = contract.ContractId;
             return(true);
         }
     }
     catch (Exception ex)
     {
         ShowErrorMessage("GET_CUSTOMER_CONTRACT", ex);
     }
     // No contract has been found
     return(false);
 }
 private void DeleteService()
 {
     try
     {
         int result = StorehouseHelper.DeleteCustomerService(CustomerService.ServiceId);
         //
         if (result < 0)
         {
             ShowResultMessage(result);
             return;
         }
         //
         RedirectToBrowsePage();
     }
     catch (Exception ex)
     {
         ShowErrorMessage("DELETE_SERVICE", ex);
     }
 }
Esempio n. 24
0
 private void DeletePaymentProfile()
 {
     try
     {
         int result = StorehouseHelper.DeletePaymentProfile(myContract.ContractId);
         // show result
         if (result < 0)
         {
             ShowResultMessage(result);
             return;
         }
         //
         BindPaymentProfile();
     }
     catch (Exception ex)
     {
         ShowErrorMessage("DELETE_PAYMENT_PROFILE", ex);
     }
 }
        private void DeleteBillingCycle()
        {
            try
            {
                int result = StorehouseHelper.DeleteBillingCycle(ecPanelRequest.BillingCycleId);

                if (result < 0)
                {
                    ShowResultMessage(result);
                    return;
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("BILLING_CYCLE_DELETE", ex);
            }

            RedirectToBrowsePage();
        }
Esempio n. 26
0
        private void BindTopLevelDomainData()
        {
            TopLevelDomain tld = StorehouseHelper.GetTopLevelDomain(ecPanelRequest.ProductId);

            if (tld == null)
            {
                RedirectToBrowsePage();
            }

            txtDomainTLD.Text = tld.ProductName;
            ecUtils.SelectListItem(ddlTLDRegistrar, tld.PluginId);
            txtProductSku.Text         = tld.ProductSku;
            chkTaxInclusive.Checked    = tld.TaxInclusive;
            rblTLDStatus.SelectedIndex = (tld.Enabled) ? 0 : 1;
            chkWhoisEnabled.Checked    = tld.WhoisEnabled;

            // load cycles
            ctlBillingCycles.LoadDomainNameCycles(
                StorehouseHelper.GetTopLevelDomainCycles(ecPanelRequest.ProductId));
        }
        private void LoadNotificationTemplate()
        {
            //
            StoreSettings s_store = StorehouseHelper.GetStoreSettings(StoreSettings.PAYMENT_RECEIVED);

            //
            if (s_store != null)
            {
                //
                EmailEditor.From = s_store["From"];
                //
                EmailEditor.CC = s_store["CC"];
                //
                EmailEditor.Subject = s_store["Subject"];
                //
                EmailEditor.HtmlBody = s_store["HtmlBody"];
                //
                EmailEditor.PlainTextBody = s_store["TextBody"];
            }
        }
 private void DeletePaymentMethod()
 {
     try
     {
         int result = StorehouseHelper.DeletePaymentMethod(PaymentMethod.TCO);
         //
         if (result < 0)
         {
             ShowResultMessage(result);
             //
             return;
         }
         //
         RedirectToBrowsePage();
     }
     catch (Exception ex)
     {
         ShowErrorMessage("SAVE_PAYMENT_METHOD", ex);
     }
 }
        private void DeleteHostingPlan()
        {
            try
            {
                int result = StorehouseHelper.DeleteProduct(ecPanelRequest.ProductId);

                if (result < 0)
                {
                    ShowResultMessage(result);
                    return;
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("HOSTING_PLAN_DELETE", ex);
                return;
            }

            RedirectToBrowsePage();
        }
Esempio n. 30
0
        private void DeleteTopLevelDomain()
        {
            try
            {
                int result = StorehouseHelper.DeleteProduct(ecPanelRequest.ProductId);

                if (result < 0)
                {
                    ShowResultMessage(result);
                    return;
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage("DOMAIN_PRODUCT_DELETE", ex);
                return;
            }

            RedirectToBrowsePage();
        }