Example #1
0
        private bool ValidateInfo()//验证输入的信息
        {
            bool b = true;

            if (string.IsNullOrWhiteSpace(txtName.Text))
            {
                MessageBox.Show("学号不能为空!", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtName.Focus();
                return(false);
            }
            //限定学号必须为5位数字
            if (!ValidataInput.IsSNO(txtName.Text) && rbtnstudent.Checked == true)
            {
                MessageBox.Show("学号为95开头的5位数字!", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);

                return(false);
            }
            if (!ValidataInput.IsPWD(txtPassword.Text))
            {
                MessageBox.Show("密码为5位数字!", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);

                return(false);
            }
            if (rbtnmanager.Checked == false && rbtnstudent.Checked == false && rbtnteacher.Checked == false)
            {
                MessageBox.Show("请选择身份信息", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }
            return(b);
        }