示例#1
0
 /// <summary>
 /// enables the textboxes so that
 /// changes/updates can be applied to a
 /// user's login information
 /// </summary>
 private void enable()
 {
     FirstnameTB.ReadOnly = false;
     FirstnameTB.Focus();
     LastnameTB.ReadOnly  = false;
     emailTB.ReadOnly     = false;
     usernameTB.ReadOnly  = false;
     PasswordTB.ReadOnly  = false;
     AccessTypeCB.Enabled = true;
 }
示例#2
0
        /// <summary>
        /// checks textboxes for null values
        /// </summary>
        /// <returns></returns>
        private bool CheckTB()
        {
            bool result = true;

            if (String.IsNullOrEmpty(FirstnameTB.Text))
            {
                errorMsg.SetError(FirstnameTB, "Firstname is missing."); result = false; FirstnameTB.Focus();
            }
            else
            {
                errorMsg.SetError(FirstnameTB, "");
            }
            if (String.IsNullOrEmpty(LastnameTB.Text))
            {
                errorMsg.SetError(LastnameTB, "Lastname is missing."); result = false; LastnameTB.Focus();
            }
            else
            {
                errorMsg.SetError(LastnameTB, "");
            }
            if (String.IsNullOrEmpty(usernameTB.Text))
            {
                errorMsg.SetError(usernameTB, "Username is missing."); result = false; usernameTB.Focus();
            }
            else
            {
                errorMsg.SetError(usernameTB, "");
            }
            if (String.IsNullOrEmpty(PasswordTB.Text))
            {
                errorMsg.SetError(PasswordTB, " Password is missing."); result = false; PasswordTB.Focus();
            }
            else
            {
                errorMsg.SetError(PasswordTB, "");
            }
            if (String.IsNullOrEmpty(AccessTypeCB.Text))
            {
                errorMsg.SetError(AccessTypeCB, "Access Type is missing."); result = false; AccessTypeCB.Focus();
            }
            else
            {
                errorMsg.SetError(AccessTypeCB, "");
            }

            return(result);
        }