Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. private void btnAdd_Click(object sender, RoutedEventArgs e)
  2. {
  3. try
  4. {
  5. Persona p = new Persona();
  6. p.Nombre = txtNombre.Text;
  7. p.Rut = txtRut.Text;
  8. p.Fecha_nacimiento = DateTime.Parse(txtFecha.Text);
  9. p.Sueldo = int.Parse(txtSueldo.Text);
  10. p.Cargas = int.Parse(txtCargas.Text);
  11.  
  12. if (cbTurno.IsChecked.Value)
  13. {
  14. p.Turno = true;
  15. }
  16. else
  17. {
  18. p.Turno = false;
  19. }
  20. Array.Resize(ref People, People.Length + 1);
  21. People[0] = p;
  22. txtRut.Text = string.Empty;
  23. txtNombre.Text = string.Empty;
  24. txtFecha.Text = string.Empty;
  25. txtCargas.Text = string.Empty;
  26. txtSueldo.Text = string.Empty;
  27.  
  28. }
  29. catch (Exception)
  30. {
  31.  
  32. MessageBox.Show("Error");
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement