private void btn_aceptar_Click(object sender, EventArgs e) { if (txt_nombre.Text != "") { Cliente c = new Cliente(); if (txt_calle.Text != "") { c.Direccion = txt_calle.Text; } else { c.Direccion = " "; } if (txt_ciudad.Text != "") { c.Ciudad = txt_ciudad.Text; } else { c.Ciudad = " "; } if (txt_email.Text != "") { c.Email = txt_email.Text; } else { c.Email = " "; } if (txt_numero_doc.Text != "") { c.Documento = txt_numero_doc.Text; } else { c.Documento = " "; } if (txt_telefono_numero.Text != "") { c.Telefono = txt_telefono_numero.Text; } else { c.Telefono = " "; } if (txt_rut.Text != "") { c.RUT = txt_rut.Text; } else { c.RUT = " "; } if (cbox_pais.SelectedItem != null) { c.id_Pais = ((Pais)cbox_pais.SelectedItem).Id_pais; } else { c.id_Pais = DatosPais.obtener_id_pais_maximo(); } c.Nacimiento = date_cumple.Value; c.Nombre = txt_nombre.Text; if (modificar == false) { DatosCliente.NuevoCliente(c); } else { c.Id_cliente = cli.Id_cliente; DatosCliente.ModificarCliente(c); } this.Close(); } else { MessageBox.Show(this, "Debe ingresar el nombre de cliente", "¡Aviso!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }