Пример #1
0
 private void btnActualizar_Click(object sender, RoutedEventArgs e)
 {
     Snippet selected = lstSnippets.SelectedItem as Snippet;
     SnippetEventArgs args = new SnippetEventArgs
     {
         Result = selected
     };
     Actualizar(this, args);
     Refresh();
 }
Пример #2
0
 private void btnActualizar_Click(object sender, SnippetEventArgs args)
 {
     Snippet result = args.Result;
     grdContainer.Children.Clear();
     SnippetEdit edition = new SnippetEdit()
     {
         Snippet = result,
         Way = EditingWay.UPDATING
     };
     grdContainer.Children.Add(edition);
     edition.Confirmed += new EventHandler<SnippetEventArgs>(update_Confirmed);
 }
Пример #3
0
 private void btnCommand_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     SnippetEventArgs args = new SnippetEventArgs
     {
         Result = new Snippet
         {
             ID = Snippet.ID,
             Nombre = txtName.Text,
             Descripcion = txtDescription.Text
         }
     };
     Confirmed(this, args);
 }
Пример #4
0
 private void btnVer_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     Snippet selected = lstSnippets.SelectedItem as Snippet;
     SnippetEventArgs args = new SnippetEventArgs
     {
         Result = selected
     };
     Ver(this, args);
     Refresh();
 }
Пример #5
0
 void update_Confirmed(object sender, SnippetEventArgs args)
 {
     Snippet result = args.Result;
     context.Update(result);
     Refresh();
 }
Пример #6
0
 void edition_Confirmed(object sender, SnippetEventArgs args)
 {
     Snippet result = args.Result;
     int r = context.Insert(result);
     MessageBox.Show("Se guardo el registro " + r);
 }
Пример #7
0
 private void btnVer_Click(object sender, SnippetEventArgs args)
 {
     Snippet result = args.Result;
     grdContainer.Children.Clear();
     SnippetView view = new SnippetView()
     {
         Snippet = result,
     };
     grdContainer.Children.Add(view);
 }
Пример #8
0
 private void btnEliminar_Click(object sender, SnippetEventArgs args)
 {
     Snippet result = args.Result;
     context.Delete(result);
     Refresh();
 }