Exemplo n.º 1
0
 protected void cmdSchedule_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.cboProcessType.DataSource != null)
         {
             Plugin selectedPlugin;
             selectedPlugin = ((IList <Plugin>) this.cboProcessType.DataSource)[this.cboProcessType.SelectedIndex];
             object[] objarray = new object[] {
                 this.lueContactToScheduleFor.LookupResultValue,
                 selectedPlugin.PluginId,
                 selectedPlugin.Family,
                 selectedPlugin.Name,
                 this.ownProcessOwner.LookupResultValue
             };
             Sage.Platform.Orm.DynamicMethodLibraryHelper.Instance.Execute("Contact.ScheduleProcess", objarray);
             DialogService.CloseEventHappened(sender, e);
             Sage.Platform.WebPortal.Services.IPanelRefreshService refresher = PageWorkItem.Services.Get <Sage.Platform.WebPortal.Services.IPanelRefreshService>();
             refresher.RefreshTabWorkspace();
         }
         else
         {
             DialogService.ShowMessage(GetLocalResourceObject("Error_ProcessTypes").ToString(), "SalesLogix");
         }
     }
     catch (Exception error)
     {
         DialogService.ShowMessage(error.InnerException.Message, "SalesLogix");
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Performs the password validation rules. If validation fails an exception is raised from the
        /// ValidateUserPassword method. If validation succeeds, but the password was changed
        /// to an empty string that result is returned, which will be displayed to the UI.
        /// </summary>
        /// <param name="form">The change password form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnSave_OnClick(IUserChangePassword form, EventArgs args)
        {
            string newPassword = form.txtNewPassword.Text;

            if (newPassword.Equals(form.txtConfirmPassword.Text))
            {
                IUser user = (IUser)form.usrUser.LookupResultValue;
                if (user.ValidateUserPassword(newPassword))
                {
                    Sage.Platform.WebPortal.Services.IWebDialogService ds = form.Services.Get <Sage.Platform.WebPortal.Services.IWebDialogService>();
                    user.SavePassword(newPassword);
                    form.lblInvalidPassword.Text = newPassword.Length == 0 ? form.GetResource("PasswordBlank").ToString() : String.Empty;
                    if (newPassword.Length == 0)
                    {
                        ds.ShowMessage(form.GetResource("PasswordBlank").ToString());
                    }
                    else
                    {
                        ds.ShowMessage(form.GetResource("PasswordChanged").ToString());
                    }
                    ds.CloseEventHappened(form, null);
                    Sage.Platform.WebPortal.Services.IPanelRefreshService refresher = form.Services.Get <Sage.Platform.WebPortal.Services.IPanelRefreshService>();
                    if (refresher != null)
                    {
                        refresher.RefreshAll();
                    }
                }
            }
            else
            {
                throw new Sage.Platform.Application.ValidationException(form.GetResource("Error_PasswordsDontMatch").ToString());
            }
        }
        public static void btnOK_OnClickStep(IQuickInsertAccountContact form, EventArgs args)
        {
            IUser    currentUser = Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser;
            IContact contact     = form.CurrentEntity as IContact;
            IAccount account     = Sage.Platform.EntityFactory.Create <IAccount>();

            IAddress ad = Sage.Platform.EntityFactory.Create <IAddress>();

            ad.Description = contact.Address.Description;
            ad.Address1    = contact.Address.Address1;
            ad.Address2    = contact.Address.Address2;
            ad.Address3    = contact.Address.Address3;
            ad.Address4    = contact.Address.Address4;
            ad.City        = contact.Address.City;
            ad.State       = contact.Address.State;
            ad.PostalCode  = contact.Address.PostalCode;
            ad.Country     = contact.Address.Country;
            ad.County      = contact.Address.County;
            ad.Salutation  = contact.Address.Salutation;

            account.Address        = ad;
            account.AccountName    = form.txtAccount.Text;
            account.AccountManager = currentUser;
            account.Owner          = currentUser.DefaultOwner;
            account.Type           = form.pklType.PickListValue;
            account.MainPhone      = form.phAccountMain.Text;
            //if ((string.IsNullOrEmpty(contact.LastName)&&(string.IsNullOrEmpty(contact.FirstName))))
            //{
            //   contact.LastName = string.Format("New Contact for {0}",currentUser.UserInfo.UserName );
            //}
            contact.Account        = account;
            contact.AccountManager = currentUser;
            contact.Owner          = currentUser.DefaultOwner;
            contact.SaveContactAccount(account);

            ISelectionService srv     = ApplicationContext.Current.Services.Get <ISelectionService>(true);
            ISelectionContext sc      = new SimpleSelectionContext();
            SelectionInfo     selInfo = new SelectionInfo();
            SelectionItem     item    = new SelectionItem();

            item.Id = contact.Id.ToString();
            selInfo.Selections.Add(item);
            sc.Key           = "QuickInsertAccountContact";
            sc.SelectionInfo = selInfo;
            srv.SetSelectionContext(sc.Key, sc);

            Sage.Platform.WebPortal.Services.IPanelRefreshService refresher = form.Services.Get <Sage.Platform.WebPortal.Services.IPanelRefreshService>();
            if (refresher != null)
            {
                refresher.RefreshAll();
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Sets the flag, LostReplaced, on the opportunity competitor indicating that this opportunity
        /// competitor was associated as a competitor lost to.
        /// </summary>
        /// <param name="form">The opportunity closed lost form.</param>
        /// <param name="args">The event arguments.<see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void lueCompetitorLoss_OnChange(IOpportunityClosedLost form, EventArgs args)
        {
            ICompetitor competitor = form.lueCompetitorLoss.LookupResultValue as ICompetitor;

            if (competitor != null)
            {
                IOpportunity opportunity = form.CurrentEntity as IOpportunity;
                opportunity.SetOppCompetitorReplacedFlag(competitor);
            }

            Sage.Platform.WebPortal.Services.IPanelRefreshService panelRefresh = form.Services.Get <Sage.Platform.WebPortal.Services.IPanelRefreshService>();
            if (panelRefresh != null)
            {
                panelRefresh.RefreshMainWorkspace();
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Performs the password validation rules. If validation fails an exception is raised from the
        /// ValidateUserPassword method. If validation succeeds, but the password was changed
        /// to an empty string that result is returned, which will be displayed to the UI.
        /// </summary>
        /// <param name="form">The change password form.</param>
        /// <param name="args">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public static void btnSave_OnClick(IUserChangePassword form, EventArgs args)
        {
            string newPassword = form.txtNewPassword.Text;

            if (newPassword.Equals(form.txtConfirmPassword.Text))
            {
                IUser user = (IUser)form.CurrentEntity;

                if (user.ValidateUserPassword(newPassword))
                {
                    Sage.Platform.WebPortal.Services.IWebDialogService ds = form.Services.Get <Sage.Platform.WebPortal.Services.IWebDialogService>();
                    user.SavePassword(newPassword);
                    var slxUserService = (ISlxUserService)ApplicationContext.Current.Services.Get <Sage.Platform.Security.IUserService>(true);
                    var currentUser    = slxUserService.GetUser();
                    if (user.UserName == currentUser.UserName)
                    {
                        var data = (Sage.SalesLogix.SLXDataService)ApplicationContext.Current.Services.Get <IDataService>(true);
                        var auth = (Sage.SalesLogix.Web.SLXWebAuthenticationProvider)data.AuthenticationProvider;
                        auth.AuthenticateWithContext(currentUser.UserName, newPassword);
                    }

                    form.lblInvalidPassword.Text = newPassword.Length == 0 ? form.GetResource("PasswordBlank").ToString() : String.Empty;
                    if (newPassword.Length == 0)
                    {
                        ds.ShowMessage(form.GetResource("PasswordBlank").ToString());
                    }
                    else
                    {
                        ds.ShowMessage(form.GetResource("PasswordChanged").ToString());
                    }
                    ds.CloseEventHappened(form, null);
                    Sage.Platform.WebPortal.Services.IPanelRefreshService refresher = form.Services.Get <Sage.Platform.WebPortal.Services.IPanelRefreshService>();
                    if (refresher != null)
                    {
                        refresher.RefreshAll();
                    }
                }
            }
            else
            {
                throw new Sage.Platform.Application.ValidationException(form.GetResource("Error_PasswordsDontMatch").ToString());
            }
        }
 protected void btnSave_ClickActionBRC(object sender, EventArgs e)
 {
     Sage.Platform.WebPortal.Services.IPanelRefreshService refresher = PageWorkItem.Services.Get <Sage.Platform.WebPortal.Services.IPanelRefreshService>();
     refresher.RefreshTabWorkspace();
 }