Пример #1
0
    public void ReplaceTeamMemberDepartment(IList <string> targetIds)
    {
        IEntityHistoryService ehs = ApplicationContext.Current.Services.Get <IEntityHistoryService>();
        object lastId             = ehs.GetLastIdForType <IDepartment>();

        if (lastId != null)
        {
            targetIds = new List <string>()
            {
                lastId.ToString()
            };
            Dialog.DialogParameters.Clear();
            Dialog.DialogParameters.Add("selectedIds", targetIds);
            Dialog.DialogParameters.Add("context", typeof(IDepartment));
            Dialog.SetSpecs(200, 350, "ReplaceTeamMember", "");
            Dialog.ShowDialog();
        }
    }
Пример #2
0
        /// <summary>
        /// Loads the default setting for the change password form.
        /// </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 OnChangePasswordLoad(IUserChangePassword form, EventArgs args)
        {
            IEntityHistoryService entities = ApplicationContext.Current.Services.Get <IEntityHistoryService>(false);

            if (entities != null)
            {
                EntityHistory entity = entities[0];
                if (entity != null && entity.EntityType == typeof(IUser))
                {
                    if (form.usrUser.LookupResultValue == null)
                    {
                        form.usrUser.LookupResultValue = entity.EntityId;
                    }
                    form.ctrlstButtons.Visible = true;
                }
                else
                {
                    form.ctrlstButtons.Visible = false;
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Loads the default setting for the change password form.
        /// </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 OnChangePasswordLoad(IUserChangePassword form, EventArgs args)
        {
            IEntityHistoryService entities = ApplicationContext.Current.Services.Get <IEntityHistoryService>(false);

            if (entities != null)
            {
                EntityHistory entity = entities[0];
                if (entity != null && entity.EntityType.Equals(typeof(IUser)))
                {
                    //form.usrUser.Enabled = (entity.EntityId.ToString().Trim().Equals("ADMIN"));
                    if (form.usrUser.LookupResultValue == null)
                    {
                        form.usrUser.LookupResultValue = entity.EntityId;
                    }
                    form.ctrlstButtons.Visible = true;
                }
                else
                {
                    form.ctrlstButtons.Visible = false;
                    //form.usrUser.LookupResultValue = Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser;
                }
            }
        }