private void btCrearPregunta_Click(object sender, RoutedEventArgs e)
        {
            conn = dba.getConn();
            string titulo      = tbTitulo.Text;
            string descripcion = tbDesc.Text;
            string resp        = Convert.ToString(cbRespuesta.IsChecked);

            conn.HashSet("Pregunta:C" + idClase + "P" + noPregunta, new HashEntry[] { new HashEntry("id", idPregunta), new HashEntry("titulo", titulo), new HashEntry("descripcion", descripcion), new HashEntry("idClase", idClase), new HashEntry("respuesta", resp) });
            aw.updateTable();
            this.Close();
        }
Ejemplo n.º 2
0
        private void btCrear_Click(object sender, RoutedEventArgs e)
        {
            conn = dba.getConn();
            int id = Convert.ToInt32(tbId.Text);

            tbId.IsReadOnly = true;
            string nombre = tbNombre.Text;

            conn.HashSet("Clase:Clase" + id, new HashEntry[] { new HashEntry("id", id), new HashEntry("nombre", nombre) });
            this.Close();
            aw.updateTable();
        }
Ejemplo n.º 3
0
        private void btCrearExamen_Click(object sender, RoutedEventArgs e)
        {
            conn = dba.getConn();
            int    preg  = Convert.ToInt32(tbPreguntas.Text);
            string fecha = ((DateTime)dp_fecha.SelectedDate).ToString("d");

            if (preg > noPreguntas)
            {
                MessageBox.Show("El examen no puede tener más preguntas que las que tiene la clase.");
                tbPreguntas.Text = "";
            }
            else
            {
                conn.HashSet("Examen:E" + noExamen + "C" + idClase, new HashEntry[] { new HashEntry("id", id), new HashEntry("idClase", idClase), new HashEntry("noPreguntas", preg), new HashEntry("fecha", fecha), new HashEntry("noExamen", noExamen) });
                aw.updateTable();
                this.Close();
            }
        }