Beispiel #1
0
        //Funciones
        private void agregar()
        {
            if (Validador())
            {
                string      cod         = txtCodigo.Text;
                string      diag        = txtDiagnostico.Text;
                int         sumaId      = basicService.GetUltimoID() + 1;
                Diagnostico diagnostico = new Diagnostico(sumaId.ToString(), int.Parse(cod), diag);

                string query = "INSERT INTO " + _tableName + " (" + _idColName + ", ID_PACIENTE1, DESCRIPCION_DIAGNOSTICO)"
                               + "VALUES ('" + diagnostico.Id + "','" + diagnostico.IdPaciente + "', '" + diagnostico.DiagnosticoFinal + "' )";

                if (basicService.Crear(query))
                {
                    SetDataList(basicService.MostrarTodo());
                }
            }
        }