private void button2_Click(object sender, EventArgs e) { EmployeesDataSet.EmployeesRow row = ds.Employees.NewEmployeesRow(); row.EmployeeID = int.Parse(comboBox1.Text); row.FirstName = textBox1.Text; row.LastName = textBox2.Text; row.HomePhone = textBox3.Text; row.Notes = textBox4.Text; ds.Employees.AddEmployeesRow(row); FillEmployees(); }
private void button2_Click(object sender, EventArgs e) { if (comboBox1.Text == "" || textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "") { MessageBox.Show("Please enter all the details about an employee"); return; } EmployeesDataSet.EmployeesRow row = ds.Employees.NewEmployeesRow(); row.EmployeeID = int.Parse(comboBox1.Text); row.FirstName = textBox1.Text; row.LastName = textBox2.Text; row.HomePhone = textBox3.Text; row.Notes = textBox4.Text; ds.Employees.AddEmployeesRow(row); FillEmployees(); }