Exemplo n.º 1
0
 //Responsible of filling necessary fields for the adding process
 private void AddStudent_Load(object sender, EventArgs e)
 {
     studentList = new StudentList();
     //Fills the ID text box with the now to be added Student ID (Last Student ID in the table + 1)
     textBoxID.Text = (studentList.GetMaxID() + 1).ToString();
     //Fills the date text box with the current Time and Date
     textBoxEdate.Text = DateTime.Now.ToString();
 }
Exemplo n.º 2
0
 private void Clear()
 {
     //for loop to clear the controls which are textboxes
     foreach (Control ctr in Controls)
     {
         if (ctr is TextBox)
         {
             ctr.Text = "";
         }
     }
     textBoxID.Text    = studentList.GetMaxID().ToString();
     textBoxEdate.Text = DateTime.Now.ToString();
 }