private void buttonList_Click(object sender, EventArgs e) { Employee emp = new Employee(); if (EmployeeValidation.isValidID(textboxEmployeeId) && EmployeeValidation.isValidName(textboxName)) { emp.EmployeeID = Convert.ToInt32(textboxEmployeeId.Text); emp.Name = textboxName.Text; emp.PhoneNumber = maskedtextboxPhoneNumber.Text; EmployeeDA.Add(emp); ClearAll(); } }