this is the button that generates the report:
private void bunifuThinButton21_Click(object sender, EventArgs e)
{
Datos datos = new Datos();
AsesoriaFiscal af = new AsesoriaFiscal();
datos.Nombre = txtNombre.Text;
datos.Nif = txtNifCif.Text;
datos.Direccion = txtDireccion.Text;
datos.Poblacion = txtPoblacion.Text;
datos.Provincia = txtProvincia.Text;
datos.CodigoPostal = txtCodigoPostal.Text;
datos.Telefono = txtTelefono.Text;
datos.Email = txtEmail.Text;
datos.Actividades = Actividad.Text;
af.datos.Add(datos);
af.Show();
}
And this is the class Data:
namespace Operaciones
{
public class Datos
{
public string Nombre { get; set; }
public string Nif { get; set; }
public string Direccion { get; set; }
public string Poblacion { get; set; }
public string Provincia { get; set; }
public string CodigoPostal { get; set; }
public string Telefono { get; set; }
public string Email { get; set; }
public string Actividades { get; set; }
}
}
All this is correct. But when I try it with a chekedlistbox, it only recognizes one item (the chekedlistbox are all those that start with chlb:
private void bunifuThinButton21_Click(object sender, EventArgs e)
{
SeguridadDatos datos1 = new SeguridadDatos();
InformeSeguridad ag = new InformeSeguridad();
datos1.SeguridadFisica = chlbSeguridadFisicaInstalaciones.SelectedItem.ToString();
datos1.DescripcionDeLosSistemas = chlbDescripcionSistemas.CheckedItems.ToString();
datos1.ServidorDedicado = chlbServidorDedicado.CheckedItems.ToString();
datos1.ServidorNoDedicado = chlbServidorNoDedicado.CheckedItems.ToString();
datos1.OrdenadoresPersonales = chlbOrdenadoresPersonales.CheckedItems.ToString();
datos1.ServidorCorreoElectronico = chlbServidorCorreoElectronico.CheckedItems.ToString();
datos1.ServidorPaginaWeb = chlbServidorPaginaWeb.CheckedItems.ToString();
datos1.EquiposInformaticos = chlbEquiposInformaticos.CheckedItems.ToString();
ag.informe.Add(datos1);
ag.Show();
}