private void chkAutoNumber_Click(object sender, EventArgs e) { oStudent = new DataAccess.Student(); if (chkAutoNumber.Checked) { txtStudentID.Enabled = false; txtStudentID.Text = oStudent.GetStudentAutoNo(); } else { txtStudentID.Enabled = true; txtStudentID.Text = ""; } }
private void frmStudentEntry_Load(object sender, EventArgs e) { oStudent = new DataAccess.Student(); LoadStudents(); txtStudentID.Focus(); if (TransactionType == eVariable.TransactionType.ADD) { txtStudentID.Enabled = false; txtStudentID.Text = oStudent.GetStudentAutoNo(); } else { txtStudentID.Enabled = false; chkAutoNumber.Enabled = false; } }