private void concludeButton_Click(object sender, EventArgs e) { data = new Space(); data.buildingIdentifier = buildingTextBox.Text; data.roomIdentifier = roomTextBox.Text; data.floorIdentifier = floorTextBox.Text; data.turnStart = new TimeSpan((int)startHourNumericUpDown.Value, (int)startMinutesNumericUpDown.Value, 0); data.turnEnd = new TimeSpan((int)endHourNumericUpDown.Value, (int)endMinuteNumericUpDown.Value, 0); data.surroundingsComments = surroundingInfoTextBox.Text; data.weekDays = ""; if (checkBox1.Checked) { data.weekDays += "Segunda-Feira\n"; } if (checkBox2.Checked) { data.weekDays += "Terça-Feira\n"; } if (checkBox3.Checked) { data.weekDays += "Quarta-Feira\n"; } if (checkBox4.Checked) { data.weekDays += "Quinta-Feira\n"; } if (checkBox5.Checked) { data.weekDays += "Sexta-Feira\n"; } if (checkBox6.Checked) { data.weekDays += "Sábado\n"; } if (checkBox7.Checked) { data.weekDays += "Domingo\n"; } try { data.CheckValidity(); Close(); } catch (Exception ex) { data = null; MessageBox.Show(ex.Message); } }