Example #1
0
 private void Add_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         DatabaseMethods _data      = new DatabaseMethods();
         var             action     = txtAction.Text;
         var             agentId    = ddlAction.SelectedValue;
         var             actionMech = txtActionMechanism.Text;
         var             actionResp = txtActionResponse.Text;
         int             i          = _data.AddAction(action, Convert.ToInt32(agentId), actionMech, actionResp);
         if (i > 0)
         {
             MessageBox.Show("Successfully Added");
             ViewActions viewActions = new ViewActions();
             viewActions.Show();
             this.Close();
         }
         else
         {
             MessageBox.Show("Error Occured while saving Action. Please try again");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error Occured while saving Action. Please try again");
     }
 }