Exemplo n.º 1
0
        /// <summary>
        /// Authenticates the user.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <returns></returns>
        public bool AuthenticateUser(IWin32Window parent)
        {
            DialogResult dlg;
            using (var f = new LogonPresentation())
            {
                dlg = f.ShowDialog(parent);
                _user = f.User;
            }

            if (dlg == DialogResult.OK)
                lblUser.Text = _user.UserId;

            return (dlg.Equals(DialogResult.OK));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PasswordUI"/> class.
 /// </summary>
 /// <param name="user">The user.</param>
 public PasswordUI(User user)
 {
     _user = user;
     InitializeComponent();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Handles the Validated event of the txtUserId control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void txtUserId_Validated(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtUserId.Text.Trim())) return;

            using (var db = new UserBase())
                _user = db.GetById(txtUserId.Text.Trim());
        }