示例#1
0
        private void SubmitUserToDatabase()
        {
            if (lbNameError.Visible || lbEmailError.Visible || lbPhoneError.Visible || lbUsernameError.Visible ||
                lbPasswordError.Visible || lbConfirmError.Visible)
            {
                return;
            }

            User user = new User();

            user.Name      = tbName.Text.Trim();
            user.Sex       = cbSex.Text.Trim();
            user.Email     = tbEmail.Text.Trim();
            user.PhoneNum  = tbPhoneNo.Text.Trim();
            user.BirthDate = datePicker.Value;
            user.IDFunc    = ((Function)cbFunc.SelectedItem).ID;
            user.Username  = tbUsername.Text.Trim();
            user.Password  = tbPassword.Text.Trim();
            user.MId       = tbUID.Text.Trim();

            _business.CreateNewStaff(user);
        }