private void UpdateEmployeeRoleButton_Click(object sender, EventArgs e) { try { EmployeesData ed = new EmployeesData(); SqlEmployeesRepository employees = new SqlEmployeesRepository(connectionString); employees.UpdateEmployeeRole(Convert.ToInt32(EmployeeIdText.Text), EmailTextbox.Text, NameTextbox.Text, EmployeeRoleText.Text, Convert.ToInt32(SalaryTextbox.Text)); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void CreateEmployeeButton_Click(object sender, EventArgs e) { try { SqlEmployeesRepository employees = new SqlEmployeesRepository(connectionString); Employees createEmployees = employees.CreateEmployee(EmailTextbox.Text, NameTextbox.Text, RoleTextbox.Text, Convert.ToInt32(SalaryTextbox.Text)); list.Add(createEmployees); EmployeesData ed = new EmployeesData(); ed.dataGridView1.DataSource = list; } catch (Exception ex) { MessageBox.Show("There cannot be any empty or incorrectly entered parameters. Check submission."); } }
private void EmployeesButton_Click(object sender, EventArgs e) { EmployeesData ed = new EmployeesData(); ed.ShowDialog(); }