I'm developing an O.S. software where I've broken down the main problems in several checkboxes. All data entered on the screen will be sent to a text file, which will then be viewed by the boss in Excel.
My problem is that I'm not able to capture the information of only the checkboxes that have been marked.
My question is: How to capture the information regarding only the checkboxes that were marked and play in a text file?
PS: To identify the checkbox, next to each one I added a Label with the description of the problem that the checkbox represents, I do not know if it is the correct way. I added a code that I created from a Net tutorial, I need to capture the information about each checkbox that is marked
private void BtSalvar_Click(object sender, EventArgs e)
{
String path = @"C:\Users\Core i3\Desktop\OS.Soluctions.txt";
StreamWriter arq = new StreamWriter(path, true);
arq.WriteLine("");
arq.Write(TbNumeroOS.Text.ToUpper() + "," + maskedTextBox1.Text.ToUpper() + "," + maskedTextBox3.Text.ToUpper() + "," + TbSuporte.Text.ToUpper() + "," + maskedTextBox5.Text.ToUpper() + "," + maskedTextBox4.Text.ToUpper() + "," + CbListTec.Text.ToUpper() + "," + CbStatus.Text.ToUpper()
+ "," + label12.Text.ToUpper() + "," + label13.Text.ToUpper() + "," + label14.Text.ToUpper() + "," + label15.Text.ToUpper() + "," + label16.Text.ToUpper());
TbNumeroOS.Clear();
TbSuporte.Clear();
maskedTextBox1.Clear();
maskedTextBox3.Clear();
maskedTextBox5.Clear();
maskedTextBox4.Clear();
arq.Close();
arq.Dispose();
Console.WriteLine("Text Appended");
MessageBox.Show("O.S. ADCIONADA COM SUCESSO", "ATENÇÃO!!!", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void CbSupUsuario_CheckedChanged(object sender, EventArgs e)
{
if (CbSupUsuario.Checked == true)
label12.Text = "Suporte ao Usuário";
}
private void CbMaqEquip_CheckedChanged(object sender, EventArgs e)
{
if (CbMaqEquip.Checked == true)
label13.Text = "Máquina/Equipamento";
else
label13.Text = "";
}
private void CbFaltaInter_CheckedChanged(object sender, EventArgs e)
{
if (CbFaltaInter.Checked == true)
label14.Text = "Falta de Internet";
else
label14.Text = "";
}
private void CbConfigEquip_CheckedChanged(object sender, EventArgs e)
{
if (CbConfigEquip.Checked == true)
label15.Text = "Configuracao de Equipamento";
else
label15.Text = "";
}
private void CbAtuaSoftWare_CheckedChanged(object sender, EventArgs e)
{
if (CbAtuaSoftWare.Checked == true)
label16.Text = "Atualizacao de Software";
else
label16.Text = "";
}