public FormResultado(Informe informe) { InitializeComponent(); this.informe = informe; if (informe.getTipoInforme() == "7a35") { labelTituloInforme.Text = "Informe de 7 a 35 meses"; } ; int x = 15; int y = 60; int x1 = 65; int y1 = 55; int resulForm = 0; foreach (Pregunta item in informe.getListaPreguntas()) { int ind = item.getNumero() + 1; Label label = new Label(); TextBox text = new TextBox(); label.Location = new Point(x, y); label.Size = new Size(45, 15); text.Size = new Size(35, 20); text.Location = new Point(x1, y1); label.Text = "Preg " + ind; text.Text = item.getResultadoPregunta().ToString(); this.Controls.Add(text); this.Controls.Add(label); resulForm += item.getResultadoPregunta(); y1 = y1 + 30; y = y + 30; if (ind == 6 || ind == 12 || ind == 18) { x = x + 85; x1 = x1 + 85; y = 60; y1 = 55; } } textResultado.Text = resulForm.ToString(); }
private void buttonSiguiente_Click(object sender, EventArgs e) { if (textNombre.Text == "") { MessageBox.Show("Debe informar el Nombre del paciente"); } else if (textApellido1.Text == "") { MessageBox.Show("Debe informar el primer apellido del paciente"); } else if (textApellido2.Text == "") { MessageBox.Show("Debe informar el segundo apellido del paciente"); } else if (textFechaNacimiento.Text == "") { MessageBox.Show("Debe informar la fecha de nacimiento del paciente"); } else if (comboTerapeuta.Text == "Seleccione Terapeuta") { MessageBox.Show("Debe seleccionar terapeuta que genera el informe"); } else if (!checkBox1.Checked && !checkBox2.Checked && !check7a35Meses.Checked) { MessageBox.Show("Seleccione una opcion de informe a generar"); } else { if (check7a35Meses.Checked) { tipoInforme = "7a35"; } Informe informe = new Informe(textNombre.Text, textApellido1.Text, textApellido2.Text, textFechaNacimiento.Text, tipoInforme, comboTerapeuta.Text); form7a35preg1 = new FormPreguntas(informe); form7a35preg1.ShowDialog(); } }
public FormPreguntas(Informe informe) { InitializeComponent(); this.informe = informe; rellanarFormularioPreg(); }