Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnAdd_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- Persona p = new Persona();
- p.Nombre = txtNombre.Text;
- p.Rut = txtRut.Text;
- p.Fecha_nacimiento = DateTime.Parse(txtFecha.Text);
- p.Sueldo = int.Parse(txtSueldo.Text);
- p.Cargas = int.Parse(txtCargas.Text);
- if (cbTurno.IsChecked.Value)
- {
- p.Turno = true;
- }
- else
- {
- p.Turno = false;
- }
- Array.Resize(ref People, People.Length + 1);
- People[0] = p;
- txtRut.Text = string.Empty;
- txtNombre.Text = string.Empty;
- txtFecha.Text = string.Empty;
- txtCargas.Text = string.Empty;
- txtSueldo.Text = string.Empty;
- }
- catch (Exception)
- {
- MessageBox.Show("Error");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement