private void fname_TextChanged(object sender, EventArgs e) { string fnam = fname.Text; if (BookRegValidation.isNumber(fnam)) { errorProvider1.SetError(fname, "can contain only letters"); RegStd.Enabled = false; } else { errorProvider1.Clear(); RegStd.Enabled = true; } }
private void author_TextChanged(object sender, EventArgs e) { string autho = author.Text; if (BookRegValidation.isNumber(autho)) { errorProvider1.SetError(author, "can contain only letters"); btregbk.Enabled = false; } else { errorProvider1.Clear(); btregbk.Enabled = true; } }
private void admisNum_TextChanged(object sender, EventArgs e) { string str = admisNum.Text; string let = new string(str.Take(2).ToArray()); // string result = new string(str.Take(5).ToArray()); // string let = str.Substring(0,2); // string result = str.Substring(2,5); if (BookRegValidation.isNumber(let)) //|| BookRegValidation.isNumber(result) ) { errorProvider1.SetError(admisNum, "Enter a Valid Admission Number starts with WS"); RegStd.Enabled = false; } else { errorProvider1.Clear(); RegStd.Enabled = true; } }