private void btnElim_Click(object sender, RoutedEventArgs e) { lblDescripcion.Visibility = Visibility.Hidden; lblNombre.Visibility = Visibility.Hidden; lblRubroEliminar.Visibility = Visibility.Hidden; lblRubroEliminar.Content = validador.validarNombre(txtElim.Text); Rubro ru = new Rubro(); ru.TipoRubro = txtElim.Text; ServiceReference1.Service1Client proxy = new ServiceReference1.Service1Client(); string json = ru.Serializar(); if (lblRubroEliminar.Content.Equals("OK")) { if (proxy.EliminarRubro(json)) { MessageBox.Show("RUBRO ELIMINADO"); } else { MessageBox.Show("ERROR"); } } else { lblRubroEliminar.Visibility = Visibility.Visible; } }
private void btnActu_Click(object sender, RoutedEventArgs e) { lblDescripcion.Visibility = Visibility.Hidden; lblNombre.Visibility = Visibility.Hidden; lblRubroEliminar.Visibility = Visibility.Hidden; Rubro ru = new Rubro(); ru.TipoRubro = txtTRubro.Text; ru.Descripcion = txtDesc.Text; ServiceReference1.Service1Client proxy = new ServiceReference1.Service1Client(); string json = ru.Serializar(); if (proxy.ActualizarRubro(json)) { MessageBox.Show("RUBRO ACTUALIZADO"); } else { MessageBox.Show("ERROR"); } }