/// <summary>
        /// Validates the accounting feed input can be successfully tested.
        /// </summary>
        /// <param name="form">The Add Edit Accounting System form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnTestFeed_OnClick(IAddEditAccountingSystem form, EventArgs args)
        {
            IAppIdMapping appIdMapping = form.CurrentEntity as IAppIdMapping;

            //ensure the passwod is encrypted
            appIdMapping.EncryptAccountingSystemPassword(form.txtPassword.Text);
            form.txtStatus.Text = appIdMapping.TestAccountingFeed();
        }
        /// <summary>
        /// Saves the synchronization interval to the configuration file.
        /// </summary>
        /// <param name="form">The Synchronization form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnSave_OnClickStep(ISynchronization form, EventArgs args)
        {
            IAppIdMapping appIdMapping = form.CurrentEntity as IAppIdMapping;
            int           syncInterval = Convert.ToInt32(form.txtInterval.Text);

            appIdMapping.SaveSyncConfiguration(syncInterval);
            appIdMapping.Save();
        }
Esempio n. 3
0
 private void LoadAccountTasks(EntityPage page)
 {
     if (page.IsDetailMode)
     {
         divEntityAccountList.Style.Add("display", "none");
         divEntityAccountDetails.Style.Add("display", "block");
         IAccount account = EntityFactory.GetRepository <IAccount>().Get(page.EntityContext.EntityID);
         if (account == null)
         {
             return;
         }
         if (BusinessRuleHelper.IsIntegrationContractEnabled())
         {
             if (account.PromotedToAccounting.HasValue && account.PromotedToAccounting.Value)
             {
                 lblLinkAccount.Text        = GetLocalResourceObject("lblLinkAnotherAccount.Caption").ToString();
                 lblNotLinkedStatus.Visible = false;
                 lblLinkedStatus.Visible    = true;
                 IAppIdMapping slxFeed = IntegrationHelpers.GetSlxAccountingFeed();
                 lblLinkAccount.Enabled = !slxFeed.RestrictToSingleAccount.HasValue ||
                                          !slxFeed.RestrictToSingleAccount.Value;
                 updateAccountPanel.Update();
             }
             else
             {
                 lblLinkAccount.Text        = GetLocalResourceObject("lblLinkAccount.Caption").ToString();
                 lblNotLinkedStatus.Visible = true;
                 lblLinkedStatus.Visible    = false;
                 lblLinkAccount.Enabled     = true;
             }
         }
         else
         {
             rowlnkLinkAccount.Style.Add("display", "none");
             rowlnkLinkAccount_List.Style.Add("display", "none");
             rowlnkLinkStatus.Style.Add("display", "none");
         }
         lblLastUpdate.Text = String.Format(GetLocalResourceObject("lblLastUpdate.Caption").ToString(),
                                            TimeZone.UTCDateTimeToLocalTime((DateTime)account.ModifyDate));
         if (page.IsNewEntity)
         {
             updateAccountPanel.Update();
         }
     }
     else
     {
         divEntityAccountList.Style.Add("display", "block");
         divEntityAccountDetails.Style.Add("display", "none");
         lblLinkStatus.Visible = false;
         if (!BusinessRuleHelper.IsIntegrationContractEnabled())
         {
             rowlnkLinkAccount.Style.Add("display", "none");
             rowlnkLinkAccount_List.Style.Add("display", "none");
             rowlnkLinkStatus.Style.Add("display", "none");
         }
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Encrypts the SalesLogix end points password.
        /// </summary>
        /// <param name="form">The Accounting Integration details form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnSave_OnClickStep(ISlxEndPointDetails form, EventArgs args)
        {
            IAppIdMapping appIdMapping = form.CurrentEntity as IAppIdMapping;

            if (appIdMapping != null)
            {
                appIdMapping.EncryptAccountingSystemPassword(form.txtPassword.Text);
            }
            appIdMapping.Save();
        }
Esempio n. 5
0
        /// <summary>
        /// Encrypts the accounting systems end point password.
        /// </summary>
        /// <param name="form">The Accounting System details form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void cmdOK_OnClickStep(IAddEditAccountingSystem form, EventArgs args)
        {
            IAppIdMapping appIdMapping = form.CurrentEntity as IAppIdMapping;

            if (appIdMapping != null)
            {
                appIdMapping.EncryptAccountingSystemPassword(form.txtPassword.Text);
            }
            appIdMapping.Save();
        }
Esempio n. 6
0
        /// <summary>
        /// Encrypts the Saleslogix end points password.
        /// </summary>
        /// <param name="form">The Accounting Integration details form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnSave_OnClickStep(ISlxEndPointDetails form, EventArgs args)
        {
            IAppIdMapping appIdMapping = form.CurrentEntity as IAppIdMapping;

            if (appIdMapping != null)
            {
                if (appIdMapping.EndPointURL.Contains(":[port]"))
                {
                    appIdMapping.EndPointURL = appIdMapping.EndPointURL.Replace(":[port]", string.Empty);
                }
                appIdMapping.EncryptAccountingSystemPassword(form.txtPassword.Text);
            }
            appIdMapping.Save();
        }
Esempio n. 7
0
        /// <summary>
        /// Saves the synchronization interval to the configuration file.
        /// </summary>
        /// <param name="form">The Synchronization form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnSave_OnClickStep(ISynchronization form, EventArgs args)
        {
            IAppIdMapping appIdMapping = form.CurrentEntity as IAppIdMapping;

            try
            {
                int syncInterval = Convert.ToInt32(form.txtInterval.Text);
                appIdMapping.SaveSyncConfiguration(syncInterval);
            }
            catch (FormatException)
            {
                throw new ValidationException(form.GetResource("Error_Invalid_Number").ToString());
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Loads the synchronization sync interval from the configuration file.
        /// </summary>
        /// <param name="form">The Synchronization form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void OnLoadSynchronization(ISynchronization form, EventArgs args)
        {
            IAppIdMapping appIdMapping = form.CurrentEntity as IAppIdMapping;

            try
            {
                form.txtInterval.Text = appIdMapping.GetSyncCycleInterval().ToString();
            }
            catch (FormatException)
            {
                form.txtInterval.Text = "60";
                //throw new ValidationException(form.GetResource("Error_Invalid_Number").ToString());
            }
        }
    private void LoadAccountTasks(EntityPage page)
    {
        var canPromote = RoleSecurityService.HasAccess("Entities/Account/PromoteAccount");
        var integrated = BusinessRuleHelper.IsIntegrationContractEnabled();

        if (page.IsDetailMode)
        {
            divEntityAccountList.Style.Add("display", "none");
            divEntityAccountDetails.Style.Add("display", "block");
            if (integrated)
            {
                IAccount account = EntityFactory.GetRepository <IAccount>().Get(page.EntityContext.EntityID);
                if (account == null)
                {
                    hideIntegration();
                    return;
                }
                lblLinkAccount.Visible = canPromote;
                imgLinkAccount.Visible = canPromote;
                if (account.PromotedToAccounting ?? false)
                {
                    IAppIdMapping slxFeed = IntegrationHelpers.GetSlxAccountingFeed();
                    lblLinkAccount.Text        = GetLocalResourceObject("lblLinkAnotherAccount.Caption").ToString();
                    lblNotLinkedStatus.Visible = false;
                    lblLinkedStatus.Visible    = true;
                    updateAccountPanel.Update();
                    lblLinkAccount.Visible = canPromote && !(slxFeed.RestrictToSingleAccount ?? false);
                    imgLinkAccount.Visible = canPromote && !(slxFeed.RestrictToSingleAccount ?? false);
                }
                else
                {
                    lblLinkAccount.Text        = GetLocalResourceObject("lblLinkAccount.Caption").ToString();
                    lblNotLinkedStatus.Visible = true;
                    lblLinkedStatus.Visible    = false;
                }
                lblLastUpdate.Text = String.Format(GetLocalResourceObject("lblLastUpdate.Caption").ToString(),
                                                   TimeZone.UTCDateTimeToLocalTime((DateTime)account.ModifyDate));
            }
            else
            {
                hideIntegration();
            }
            if (page.IsNewEntity)
            {
                updateAccountPanel.Update();
            }
        }
        else
        {
            if (!integrated)
            {
                hideIntegration();
            }
            else if (!canPromote)
            {
                rowlnkLinkAccount_List.Style.Add("display", "none");
            }
            divEntityAccountList.Style.Add("display", "block");
            divEntityAccountDetails.Style.Add("display", "none");
            lblLinkStatus.Visible = false;
        }
    }