private void viewAgents_Click(object sender, RoutedEventArgs e) { ViewAgents frmAgent = new ViewAgents(); frmAgent.Show(); this.Close(); }
private void Add_Click(object sender, RoutedEventArgs e) { try { DatabaseMethods _data = new DatabaseMethods(); int i = _data.AddAgent(txtAgent.Text); if (i > 0) { MessageBox.Show("Successfully Added"); ViewAgents viewAgents = new ViewAgents(); viewAgents.Show(); this.Close(); } else { MessageBox.Show("Error Occured while saving Agent. Please try again"); } } catch (Exception ex) { MessageBox.Show("Error Occured while saving Agent. Please try again"); } }