Beispiel #1
0
        public Debate(string creador, string asunto, string mensaje, string fecha)
        {
            SQLSERVERDB miBD      = new SQLSERVERDB(BD_SERVER, BD_NAME);
            string      sentencia = "INSERT INTO Debate VALUES (" + 0 + ",'" + creador + "', '" + asunto + "','" + mensaje + "','" + fecha + "');";

            miBD.Insert(sentencia);
            this.id               = (int)miBD.SelectScalar("SELECT MAX(id) FROM Debate");
            this.creadorDebate    = creador;
            this.asuntoDebate     = asunto;
            this.mensajeDebate    = mensaje;
            this.fechaPublicacion = fecha;
        }
Beispiel #2
0
        public Respuesta(Debate debate, Usuario creador, string mensaje, string fecha)
        {
            SQLSERVERDB miBD = new SQLSERVERDB(BD_SERVER, BD_NAME);

            string sentencia = "INSERT INTO Respuesta VALUES (" + 0 + "," + debate.ID + ",'" + creador.CorreoUsuario + "','" + mensaje + "','" + fecha + "');";

            miBD.Insert(sentencia);

            this.idRespuesta = (int)miBD.SelectScalar("SELECT MAX(idRespuesta) FROM Respuesta;");;
            this.debate      = debate;
            this.mensaje     = mensaje;
            this.creador     = creador;
            this.fecha       = fecha;
        }
Beispiel #3
0
        public Actividad(Usuario user, string nombreAct, string descrAct, string fIniAct, string fFinAct, string hIniAct, string hFinAct, string lugarAct, int aforoPermitido)
        {
            SQLSERVERDB miBD      = new SQLSERVERDB(BD_SERVER, BD_NAME);
            string      sentencia = "INSERT INTO Actividad VALUES (" + 0 + ",'" + user.CorreoUsuario + "','" + nombreAct + "','" + descrAct + "','" + fIniAct
                                    + "','" + fFinAct + "','" + hIniAct + "','" + hFinAct + "','" + lugarAct + "'," + aforoPermitido + ");";

            miBD.Insert(sentencia);
            this.idActividad          = (int)miBD.SelectScalar("SELECT MAX(idActividad) FROM Actividad;");
            this.usuarioCreador       = user;
            this.nombreActividad      = nombreAct;
            this.descripcionActividad = descrAct;
            this.fechaInicioActividad = fIniAct;
            this.fechaFinActividad    = fFinAct;
            this.horaInicioActividad  = hIniAct;
            this.horaFinActividad     = hFinAct;
            this.lugarActividad       = lugarAct;
            this.aforoActividad       = aforoPermitido;
        }
Beispiel #4
0
        public Curso(Usuario profesorCurso, string nombreCurso, string descripcionCurso, string fechaInicioCurso
                     , string fechaFinCurso, string horaInicioCurso, string horaFinCurso, string lugarCurso, int aforoCurso, bool online)
        {
            SQLSERVERDB miBD = new SQLSERVERDB(BD_SERVER, BD_NAME);

            string sentencia = "INSERT INTO Curso VALUES (" + 0 + ",'" + profesorCurso.CorreoUsuario + "','" + nombreCurso + "','" + descripcionCurso + "','"
                               + fechaInicioCurso + "','" + fechaFinCurso + "','" + horaInicioCurso + "','" + horaFinCurso + "','" + lugarCurso + "'," + aforoCurso + "," + (online ? 1 : 0) + ");";

            miBD.Insert(sentencia);
            this.idCurso          = (int)miBD.SelectScalar("SELECT MAX(idCurso) FROM Curso;");
            this.profesorCurso    = profesorCurso;
            this.nombreCurso      = nombreCurso;
            this.descripcionCurso = descripcionCurso;
            this.fechaInicioCurso = fechaInicioCurso;
            this.fechaFinCurso    = fechaFinCurso;
            this.horaInicioCurso  = horaInicioCurso;
            this.horaFinCurso     = horaFinCurso;
            this.lugarCurso       = lugarCurso;
            this.aforoCurso       = aforoCurso;
            this.online           = online;
        }