private void btnActualizar_Click(object sender, RoutedEventArgs e) { Snippet selected = lstSnippets.SelectedItem as Snippet; SnippetEventArgs args = new SnippetEventArgs { Result = selected }; Actualizar(this, args); Refresh(); }
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); }
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); }
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(); }
void update_Confirmed(object sender, SnippetEventArgs args) { Snippet result = args.Result; context.Update(result); Refresh(); }
void edition_Confirmed(object sender, SnippetEventArgs args) { Snippet result = args.Result; int r = context.Insert(result); MessageBox.Show("Se guardo el registro " + r); }
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); }
private void btnEliminar_Click(object sender, SnippetEventArgs args) { Snippet result = args.Result; context.Delete(result); Refresh(); }