Пример #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            buscarSintomas bs = new buscarSintomas();

            bs.ShowDialog(this);
            if (bs.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                bool existe = false;

                foreach (var item in sintoma)
                {
                    if (item.idsintoma == bs.Sintoma.idsintoma)
                    {
                        existe = true;
                        break;
                    }
                }

                if (!existe)
                {
                    sintoma.Add(bs.Sintoma);
                    cargarGrid();
                }
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            buscarSintomas bs = new buscarSintomas();

            bs.ShowDialog();

            if (bs.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                sintomas s = new sintomas();
                s.idsintoma = bs.Sintoma.idsintoma;
                s.sintoma   = bs.Sintoma.sintoma;
                listasintomas.Add(s);
            }
            cargar();
        }