Ejemplo n.º 1
0
 private static void UpdateToolTipTimer(ToolTip toolTip)
 {
     toolTip.SetToolTipTimer();
 }
Ejemplo n.º 2
0
        public void RebindUserAccountData()
        {
            bool exist = false;

            txtInputPassword.Password = string.Empty;
            if (uiUsers.SelectedValue != null && (Guid)uiUsers.SelectedValue != Guid.Empty)
            {
                Guid    userId  = (Guid)uiUsers.SelectedValue;
                AspUser aspUser = _aspUsers.FirstOrDefault(i => i.UserId == userId);
                if (aspUser != null)
                {
                    exist = true;
                    uiImageOnline.Visibility = chkResetPassword.Visibility = System.Windows.Visibility.Visible;
                    txtPassword.Password     = aspUser.Password;
                    txtPassword.IsEnabled    = false;
                    txtEmail.Text            = string.Empty;

                    if (!string.IsNullOrEmpty(aspUser.Email))
                    {
                        txtEmail.Text = aspUser.Email;
                    }
                    //uiEmployees.IsEnabled = false;
                    chkAccountApproved.IsChecked = aspUser.IsApproved;
                    chkResetPassword.IsChecked   = false;
                    txtResetPasswordInfo.Text    = string.Empty;
                    if (aspUser.IsLockedOut)
                    {
                        chkResetPassword.IsEnabled   = false;
                        chkAccountApproved.IsEnabled = false;
                        btnUnlock.IsEnabled          = this.IsEditable;
                        ucInformation.InfoMessage    = string.Format(ResourceHelper.GetReourceValue("UserAccount_LockedOutMessage"), aspUser.LastLockoutDate);
                    }
                    else
                    {
                        btnUnlock.IsEnabled          = false;
                        chkAccountApproved.IsEnabled = true;
                        chkResetPassword.IsEnabled   = true;
                        ucInformation.InfoMessage    = string.Format(ResourceHelper.GetReourceValue("UserAccount_CreatedInfo"), aspUser.CreationDate.ToString(), aspUser.LastActivityDate.ToString());
                    }
                    if (!string.IsNullOrEmpty(aspUser.PasswordQuestion))
                    {
                        txtPasswordQuestion.Text = aspUser.PasswordQuestion;
                    }
                    if (!string.IsNullOrEmpty(aspUser.PasswordAnswer))
                    {
                        txtPasswordAnswer.Text = aspUser.PasswordAnswer;
                    }

                    chkChangePasswordQuestionAnswer.IsChecked = false;

                    if (aspUser.IsOnline) /*This displays after adding new Admins incorrectly, as the UserID reset triggers this method, ie after saving a new siteAdmin as Org admin.*/
                    {                     /*Dont know where else it is used though, so shall leave for now*/
                        uiImageOnline.Source = new BitmapImage(new Uri(OnlineImage, UriKind.Relative));
                        nsTooltips.ToolTip tooltip = new nsTooltips.ToolTip()
                        {
                            DisplayTime  = new Duration(TimeSpan.FromSeconds(10)),
                            InitialDelay = new Duration(TimeSpan.FromMilliseconds(0)),
                            Content      = ResourceHelper.GetReourceValue("UserAccount_OnlineTooltip")
                        };
                        nsTooltips.ToolTipService.SetToolTip(uiImageOnline, tooltip);
                    }
                    else
                    {
                        uiImageOnline.Source = new BitmapImage(new Uri(OfflineImage, UriKind.Relative));
                        nsTooltips.ToolTip tooltip = new nsTooltips.ToolTip()
                        {
                            DisplayTime  = new Duration(TimeSpan.FromSeconds(10)),
                            InitialDelay = new Duration(TimeSpan.FromMilliseconds(0)),
                            Content      = ResourceHelper.GetReourceValue("UserAccount_OfflineTooltip")
                        };
                        nsTooltips.ToolTipService.SetToolTip(uiImageOnline, tooltip);
                    }
                }
            }

            if (!exist)
            {
                ResetControlStatus();
            }
        }
Ejemplo n.º 3
0
        public void RebindUserAccountData()
        {
            bool exist = false;
            txtInputPassword.Password = string.Empty;
            if (uiUsers.SelectedValue != null && (Guid)uiUsers.SelectedValue != Guid.Empty)
            {
                Guid userId = (Guid)uiUsers.SelectedValue;
                AspUser aspUser = _aspUsers.FirstOrDefault(i => i.UserId == userId);
                if (aspUser != null)
                {
                    exist = true;
                    uiImageOnline.Visibility = chkResetPassword.Visibility = System.Windows.Visibility.Visible;
                    txtPassword.Password = aspUser.Password;
                    txtPassword.IsEnabled = false;
                    txtEmail.Text = string.Empty;

                    if (!string.IsNullOrEmpty(aspUser.Email))
                    {
                        txtEmail.Text = aspUser.Email;
                    }
                    //uiEmployees.IsEnabled = false;
                    chkAccountApproved.IsChecked = aspUser.IsApproved;
                    chkResetPassword.IsChecked = false;
                    txtResetPasswordInfo.Text = string.Empty;
                    if (aspUser.IsLockedOut)
                    {
                        chkResetPassword.IsEnabled = false;
                        chkAccountApproved.IsEnabled = false;
                        btnUnlock.IsEnabled = this.IsEditable;
                        ucInformation.InfoMessage = string.Format(ResourceHelper.GetReourceValue("UserAccount_LockedOutMessage"), aspUser.LastLockoutDate);
                    }
                    else
                    {
                        btnUnlock.IsEnabled = false;
                        chkAccountApproved.IsEnabled = true;
                        chkResetPassword.IsEnabled = true;
                        ucInformation.InfoMessage = string.Format(ResourceHelper.GetReourceValue("UserAccount_CreatedInfo"), aspUser.CreationDate.ToString(), aspUser.LastActivityDate.ToString());
                    }
                    if(!string.IsNullOrEmpty(aspUser.PasswordQuestion))
                        txtPasswordQuestion.Text = aspUser.PasswordQuestion;
                    if (!string.IsNullOrEmpty(aspUser.PasswordAnswer))
                    txtPasswordAnswer.Text = aspUser.PasswordAnswer;

                    chkChangePasswordQuestionAnswer.IsChecked = false;

                    if (aspUser.IsOnline)  /*This displays after adding new Admins incorrectly, as the UserID reset triggers this method, ie after saving a new siteAdmin as Org admin.*/
                    {                   /*Dont know where else it is used though, so shall leave for now*/
                        uiImageOnline.Source = new BitmapImage(new Uri(OnlineImage, UriKind.Relative));
                        nsTooltips.ToolTip tooltip = new nsTooltips.ToolTip()
                        {
                            DisplayTime = new Duration(TimeSpan.FromSeconds(10)),
                            InitialDelay = new Duration(TimeSpan.FromMilliseconds(0)),
                            Content = ResourceHelper.GetReourceValue("UserAccount_OnlineTooltip")
                        };
                        nsTooltips.ToolTipService.SetToolTip(uiImageOnline, tooltip);
                    }
                    else
                    {
                        uiImageOnline.Source = new BitmapImage(new Uri(OfflineImage, UriKind.Relative));
                        nsTooltips.ToolTip tooltip = new nsTooltips.ToolTip()
                        {
                            DisplayTime = new Duration(TimeSpan.FromSeconds(10)),
                            InitialDelay = new Duration(TimeSpan.FromMilliseconds(0)),
                            Content = ResourceHelper.GetReourceValue("UserAccount_OfflineTooltip")
                        };
                        nsTooltips.ToolTipService.SetToolTip(uiImageOnline, tooltip);
                    }
                }
            }

            if (!exist)
            {
                ResetControlStatus();
            }
        }