public void CargarDatos() { PersonasPost PersonaCl = new PersonasPost(); List<Persona> Personas = new List<Persona>(); Personas = PersonaCl.CargarPersonas(); DataSet datos = PersonaCl.TraerPersonas(""); if (PersonaCl.IsError) { MessageBox.Show(PersonaCl.ErrorDescripcion, "Error"); } else { DatosPersonas.ItemsSource = Personas; } }
private void MenuItem_Click_1(object sender, RoutedEventArgs e) { PersonasPost PersonaCl = new PersonasPost(); try { PersonaCl.InsertarPersona(Convert.ToInt32(Cedulatextt.Text), NombreText.Text, ApellidoText.Text); } catch (Exception eroor) { MessageBox.Show(eroor.Message, "Informacion"); } Cedulatextt.Text = ""; NombreText.Text = ""; ApellidoText.Text = ""; CargarDatos(); }
private void MenuItem_Click_3(object sender, RoutedEventArgs e) { PersonasPost Personacl = new PersonasPost(); Personacl.EditarPersona(Convert.ToInt32(Cedulatextt.Text), NombreText.Text, ApellidoText.Text); Cedulatextt.Text = ""; NombreText.Text = ""; ApellidoText.Text = ""; CargarDatos(); }
private void MenuItem_Click_2(object sender, RoutedEventArgs e) { if (DatosPersonas.Items.Count > 0) { Persona Persona = (Persona)DatosPersonas.SelectedItem; PersonasPost Personacl = new PersonasPost(); Personacl.EliminarPersona(Persona.cedula); CargarDatos(); } }