Exemplo n.º 1
0
        private void CargarParametros()
        {
            aleatorio             = ChbOrdenPregAle.Checked;
            cronometro            = ChbCronometro.Checked;
            guardar               = ChbGuardarResultados.Checked;
            arrayOrdenDePreguntas = ObteneOrdenDePreguntas(aleatorio);

            ArrayOrdenPreguntas arrayOrdenDePreguntasO = new ArrayOrdenPreguntas
            {
                p01            = arrayOrdenDePreguntas[0],
                p02            = arrayOrdenDePreguntas[1],
                p03            = arrayOrdenDePreguntas[2],
                p04            = arrayOrdenDePreguntas[3],
                p05            = arrayOrdenDePreguntas[4],
                p06            = arrayOrdenDePreguntas[5],
                p07            = arrayOrdenDePreguntas[6],
                p08            = arrayOrdenDePreguntas[7],
                p09            = arrayOrdenDePreguntas[8],
                p10            = arrayOrdenDePreguntas[9],
                p11            = arrayOrdenDePreguntas[10],
                p12            = arrayOrdenDePreguntas[11],
                p13            = arrayOrdenDePreguntas[12],
                p14            = arrayOrdenDePreguntas[13],
                p15            = arrayOrdenDePreguntas[14],
                p16            = arrayOrdenDePreguntas[15],
                p17            = arrayOrdenDePreguntas[16],
                p18            = arrayOrdenDePreguntas[17],
                p19            = arrayOrdenDePreguntas[18],
                p20            = arrayOrdenDePreguntas[19],
                p21            = arrayOrdenDePreguntas[20],
                p22            = arrayOrdenDePreguntas[21],
                p23            = arrayOrdenDePreguntas[22],
                p24            = arrayOrdenDePreguntas[23],
                p25            = arrayOrdenDePreguntas[24],
                p26            = arrayOrdenDePreguntas[25],
                p27            = arrayOrdenDePreguntas[26],
                p28            = arrayOrdenDePreguntas[27],
                p29            = arrayOrdenDePreguntas[28],
                p30            = arrayOrdenDePreguntas[29],
                p31            = arrayOrdenDePreguntas[30],
                p32            = arrayOrdenDePreguntas[31],
                p33            = arrayOrdenDePreguntas[32],
                p34            = arrayOrdenDePreguntas[33],
                p35            = arrayOrdenDePreguntas[34],
                p36            = arrayOrdenDePreguntas[35],
                p37            = arrayOrdenDePreguntas[36],
                p38            = arrayOrdenDePreguntas[37],
                p39            = arrayOrdenDePreguntas[38],
                p40            = arrayOrdenDePreguntas[39],
                p41            = arrayOrdenDePreguntas[40],
                p42            = arrayOrdenDePreguntas[41],
                p43            = arrayOrdenDePreguntas[42],
                p44            = arrayOrdenDePreguntas[43],
                p45            = arrayOrdenDePreguntas[44],
                p46            = arrayOrdenDePreguntas[45],
                p47            = arrayOrdenDePreguntas[46],
                p48            = arrayOrdenDePreguntas[47],
                p49            = arrayOrdenDePreguntas[48],
                p50            = arrayOrdenDePreguntas[49],
                ExamenIdExamen = ObtenerUltimoIdExamen()
            };

            using (ModelContainer conexion = new ModelContainer())
            {
                conexion.ArrayOrdenPreguntas.Add(arrayOrdenDePreguntasO);
                conexion.SaveChanges();
            }
        }
        private void CargarArrayOrdenPreguntas()
        {
            arrayOrdenPreguntas = new int[50];//para un maximo de 50 preguntas

            int idExamen = FormMain.idExamenActual;
            using (ModelContainer conexion = new ModelContainer())
            {
                ArrayOrdenPreguntas arrayOrdenDePreguntasO = new ArrayOrdenPreguntas();

                arrayOrdenDePreguntasO = conexion.ArrayOrdenPreguntas.Where(p => p.ExamenIdExamen == idExamen).FirstOrDefault();

                arrayOrdenPreguntas[0] = arrayOrdenDePreguntasO.p01;
                arrayOrdenPreguntas[1] = arrayOrdenDePreguntasO.p02;
                arrayOrdenPreguntas[2] = arrayOrdenDePreguntasO.p03;
                arrayOrdenPreguntas[3] = arrayOrdenDePreguntasO.p04;
                arrayOrdenPreguntas[4] = arrayOrdenDePreguntasO.p05;
                arrayOrdenPreguntas[5] = arrayOrdenDePreguntasO.p06;
                arrayOrdenPreguntas[6] = arrayOrdenDePreguntasO.p07;
                arrayOrdenPreguntas[7] = arrayOrdenDePreguntasO.p08;
                arrayOrdenPreguntas[8] = arrayOrdenDePreguntasO.p09;
                arrayOrdenPreguntas[9] = arrayOrdenDePreguntasO.p10;
                arrayOrdenPreguntas[10] = arrayOrdenDePreguntasO.p11;
                arrayOrdenPreguntas[11] = arrayOrdenDePreguntasO.p12;
                arrayOrdenPreguntas[12] = arrayOrdenDePreguntasO.p13;
                arrayOrdenPreguntas[13] = arrayOrdenDePreguntasO.p14;
                arrayOrdenPreguntas[14] = arrayOrdenDePreguntasO.p15;
                arrayOrdenPreguntas[15] = arrayOrdenDePreguntasO.p16;
                arrayOrdenPreguntas[16] = arrayOrdenDePreguntasO.p17;
                arrayOrdenPreguntas[17] = arrayOrdenDePreguntasO.p18;
                arrayOrdenPreguntas[18] = arrayOrdenDePreguntasO.p19;
                arrayOrdenPreguntas[19] = arrayOrdenDePreguntasO.p20;
                arrayOrdenPreguntas[20] = arrayOrdenDePreguntasO.p21;
                arrayOrdenPreguntas[21] = arrayOrdenDePreguntasO.p22;
                arrayOrdenPreguntas[22] = arrayOrdenDePreguntasO.p23;
                arrayOrdenPreguntas[23] = arrayOrdenDePreguntasO.p24;
                arrayOrdenPreguntas[24] = arrayOrdenDePreguntasO.p25;
                arrayOrdenPreguntas[25] = arrayOrdenDePreguntasO.p26;
                arrayOrdenPreguntas[26] = arrayOrdenDePreguntasO.p27;
                arrayOrdenPreguntas[27] = arrayOrdenDePreguntasO.p28;
                arrayOrdenPreguntas[28] = arrayOrdenDePreguntasO.p29;
                arrayOrdenPreguntas[29] = arrayOrdenDePreguntasO.p30;
                arrayOrdenPreguntas[30] = arrayOrdenDePreguntasO.p31;
                arrayOrdenPreguntas[31] = arrayOrdenDePreguntasO.p32;
                arrayOrdenPreguntas[32] = arrayOrdenDePreguntasO.p33;
                arrayOrdenPreguntas[33] = arrayOrdenDePreguntasO.p34;
                arrayOrdenPreguntas[34] = arrayOrdenDePreguntasO.p35;
                arrayOrdenPreguntas[35] = arrayOrdenDePreguntasO.p36;
                arrayOrdenPreguntas[36] = arrayOrdenDePreguntasO.p37;
                arrayOrdenPreguntas[37] = arrayOrdenDePreguntasO.p38;
                arrayOrdenPreguntas[38] = arrayOrdenDePreguntasO.p39;
                arrayOrdenPreguntas[39] = arrayOrdenDePreguntasO.p40;
                arrayOrdenPreguntas[40] = arrayOrdenDePreguntasO.p41;
                arrayOrdenPreguntas[41] = arrayOrdenDePreguntasO.p42;
                arrayOrdenPreguntas[42] = arrayOrdenDePreguntasO.p43;
                arrayOrdenPreguntas[43] = arrayOrdenDePreguntasO.p44;
                arrayOrdenPreguntas[44] = arrayOrdenDePreguntasO.p45;
                arrayOrdenPreguntas[45] = arrayOrdenDePreguntasO.p46;
                arrayOrdenPreguntas[46] = arrayOrdenDePreguntasO.p47;
                arrayOrdenPreguntas[47] = arrayOrdenDePreguntasO.p48;
                arrayOrdenPreguntas[48] = arrayOrdenDePreguntasO.p49;
                arrayOrdenPreguntas[49] = arrayOrdenDePreguntasO.p50;

            }
        }