Ejemplo n.º 1
0
        public bool Agregar()
        {
            string strSQL = "INSERT INTO " + this.m_TableName + " VALUES(null, " + this.m_IdUsuario + ", " +
                            "'" + this.m_Titulo + "', '" + this.m_Autores + "', " + System.Convert.ToByte(this.m_Tipo) + ", " +
                            System.Convert.ToByte(this.m_Soporte) + ", '" + clsUtiles.getStringMySqlFormatedDate(System.DateTime.Now) + "');";
            clsDAL oDAL = new clsDAL();

            oDAL.BeginTrans();
            bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));

            this.m_Id = System.Convert.ToUInt32(oDAL.getLastIDENTITY(this.m_TableName));
            // Para agregar los temas a los que pertenece la bibliografía.
            clsTema Tema = new clsTema();

            System.Byte bytCantTemas = Tema.getCantidad();
            Tema = null;
            if ((this.m_Temas.Length > 0) & (this.m_Temas.Length < bytCantTemas))        // Cuando se declaran explícitamente los temas ó cuando se han seleccionado todos.
            {
                for (int i = 0; i <= (this.m_Temas.Length - 1); i++)
                {
                    strSQL = "INSERT INTO " + this.m_TableTemas + " VALUES(null, " + this.m_Id + ", " + System.Convert.ToByte(this.m_Temas[i].IdTema) + ");";
                    oDAL.ExecCommand(strSQL);
                }
            }
            else             // Para cuando no se declaran explícitamente los temas y se desea que pertenezca a todos, se inserta un cero (0).
            {
                strSQL = "INSERT INTO " + this.m_TableTemas + " VALUES(null, " + this.m_Id + ", 0);";
            }

            oDAL.CommitTrans();
            oDAL = null;
            return(boResult);
        }
Ejemplo n.º 2
0
        /*
         *
         * public new DataTable getById(System.UInt32 Id)
         * {
         *      string strSQL = "SELECT * FROM " + this.m_TableName + " WHERE Id_Usuario=" + Id + ";";
         *      clsDAL oDAL = new clsDAL();
         *      DataTable dt = oDAL.getDataTable(strSQL);
         *      oDAL = null;
         *      return dt;
         * }
         *
         * /// <summary>
         * /// Devuelve la cantidad de registros de esta entidad que estén en la base de datos.
         * /// </summary>
         * /// <returns></returns>
         * public new System.UInt32 getCantidad()
         * {
         *      clsDAL oDAL = new clsDAL();
         *      System.UInt32 bytCant = System.Convert.ToUInt32(oDAL.getEscalarValue("SELECT COUNT(Id_Usuario) FROM " + this.m_TableName + ";"));
         *      oDAL = null;
         *      return bytCant;
         * }
         *
         */

        public new bool Agregar()
        {
            clsDAL oDAL = new clsDAL();

            try
            {
                oDAL.BeginTrans();
                if (base.existURL(this.m_FullURL))
                {
                    return(false);
                }                                                                // Comprobar si ya existe la URL.
                if (!base.Agregar())
                {
                    return(false);
                }                                             // Comprobar que se agregan correctamente los datos generales del usuario.
                string strSQL = string.Empty;                 // Consulta para actualizar tbl_usuario.
                strSQL = "INSERT INTO " + this.m_TableFiles + " VALUES(null, " + this.m_Id + ", " + this.m_FileSize + ", '" + this.m_FullURL + "');";
                oDAL.ExecCommand(strSQL);
                if (this.m_URLUserName != string.Empty & this.m_URLUserPass != string.Empty)
                {
                    strSQL = "INSERT INTO " + this.m_TableCredenciales + " VALUES(" + this.m_Id + ", '" + this.m_URLUserName + "', '" + this.m_URLUserPass + "');";
                    oDAL.ExecCommand(strSQL);
                }
                oDAL.CommitTrans();
                oDAL = null;
                return(true);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al agregar nueva bibliografía en disco compacto.", Ex);
            }
        }
Ejemplo n.º 3
0
        private bool ActualizaMenciones()
        {
            clsDAL oDAL = new clsDAL();
            // Primero borrar
            string strMenciones = string.Empty;
            string strSQL;

            for (int x = 0; x <= (this.m_Menciones.Length - 1); x++)
            {
                if (strMenciones != string.Empty)
                {
                    strMenciones += ", ";
                }
                strMenciones += this.m_Menciones[x].Id.ToString();
            }
            strSQL = "DELETE FROM " + this.m_TBL_MisMenciones + " WHERE Id_TemaProyecto=" + this.m_Id + " AND Id_Mencion NOT IN(" + strMenciones + ");";
            oDAL.ExecCommand(strSQL);
            // Hacer el update o insert
            for (int x = 0; x <= (this.m_Menciones.Length - 1); x++)
            {
                strSQL = "SELECT Id FROM " + this.m_TBL_MisMenciones + " WHERE Id_TemaProyecto=" + this.m_Id + " AND Id_Mencion=" + this.m_Menciones[x].Id + ";";
                if (!(System.Convert.ToBoolean(oDAL.getEscalarValue(strSQL))))
                {
                    strSQL = "INSERT INTO " + this.m_TBL_MisMenciones + " VALUES(null, " + this.m_Menciones[x].Id + ", " + this.m_Id + ");";
                    oDAL.ExecCommand(strSQL);
                }
            }
            return(true);
        }
Ejemplo n.º 4
0
        public bool Eliminar()
        {
            if (this.m_Id == 0)
            {
                return(false);
            }
            clsDAL oDAL = new clsDAL();

            try
            {
                string strSQL = string.Empty;
                oDAL.BeginTrans();
                // 1. Eliminar él o los temas a los que corresponde.
                strSQL = "DELETE FROM tbl_bibliografia_tema WHERE Id_Bibliografia=" + this.m_Id + ";";
                oDAL.ExecCommand(strSQL);
                // 2. Eliminar él o los ficheros y sus respectivas URLs.
                strSQL = "DELETE FROM tbl_bibliografia_file WHERE Id_Bibliografia=" + this.m_Id + ";";
                oDAL.ExecCommand(strSQL);
                // 3. Eliminar las credenciales (para aquella bibliografía que se permite especificar tales parámetros).
                strSQL = "DELETE FROM tbl_bibliografia_credenciales WHERE Id_Bibliografia=" + this.m_Id + ";";
                oDAL.ExecCommand(strSQL);
                // 4. Finalmente eliminar de la tabla de tbl_bibliografia.
                strSQL = "DELETE FROM tbl_bibliografia WHERE Id=" + this.m_Id + ";";
                oDAL.ExecCommand(strSQL);
                oDAL.CommitTrans();
                oDAL = null;
                return(true);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al eliminar la bibliografía.", Ex);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Actualiza los datos del maestrante en las tablas:
        /// "tbl_usuario", "tbl_usuario_maestrante" y agrega
        /// o actualiza según como corresponda los datos del
        /// tema de proyecto que solicita el maestrante.
        /// </summary>
        /// <returns></returns>
        public new bool Actualizar()
        {
            if (this.m_Id == 0)
            {
                return(false);
            }
            clsDAL oDAL = new clsDAL();

            try
            {
                oDAL.BeginTrans();
                if (!base.Actualizar())
                {
                    return(false);
                }
                if (base.existUserId(base.Id, base.UserId))
                {
                    return(false);
                }                                                                         // Comprobar que el UserId no exista.
                string strSQL = "UPDATE " + this.m_TableName + " SET Id_Grupo=" + this.m_IdGrupo + ", " +
                                "NoCI='" + this.m_NoCI + "', Id_AcademicoAutoriza=" + this.m_IdAcademicoAutoriza + " " +
                                "WHERE Id_Usuario=" + this.m_Id + ";";
                bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
                if (!boResult)
                {
                    return(false);
                }
                if (this.m_IdTemaProyecto != 0)
                {
                    // Poner el Id de académico que revisa en cero (ninguno), si el estado es "NoRevisado"
                    if (this.m_EstadoTemaProyecto.ToString("d") == clsMaestrante.enuEstadoTemaProyecto.NoRevisado.ToString("d"))
                    {
                        this.m_IdAcademicoRevisa = 0;
                    }
                    if (this.TieneTemaProyecto)                    // Actualizar el tema de proyecto.
                    {
                        strSQL = "UPDATE tbl_maestrante_tema_proyecto SET Id_TemaProyecto=" + this.m_IdTemaProyecto + ", " +
                                 "Argumentos='" + this.m_Argumentos + "', datSolicitud='" + clsUtiles.getStringMySqlFormatedDate(this.m_datSolicitud) + "', " +
                                 "Estado=" + this.Estado.ToString("d") + ", Id_AcademicoRevisa=" + this.m_IdAcademicoRevisa + " " +
                                 "WHERE Id_Usuario=" + this.m_Id + ";";
                    }
                    else                     // Agregar el tema de proyecto.
                    {
                        strSQL = "INSERT INTO tbl_maestrante_tema_proyecto VALUES(" + this.m_Id + ", " + this.m_IdTemaProyecto + ", '" +
                                 this.m_Argumentos + "', '" + clsUtiles.getStringMySqlFormatedDate(this.m_datSolicitud) + "', " +
                                 this.Estado.ToString("d") + ", " + this.m_IdAcademicoRevisa + ");";
                    }
                    boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
                }
                oDAL.CommitTrans();
                oDAL = null;
                return(boResult);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al actualizar datos del maestrante.", Ex);
            }
        }
Ejemplo n.º 6
0
        public new bool Actualizar()
        {
            if (this.m_Id == 0)
            {
                return(false);
            }
            clsDAL oDAL = new clsDAL();

            try
            {
                oDAL.BeginTrans();
                if (!base.Actualizar())
                {
                    return(false);
                }
                if (base.existUserId(base.Id, base.UserId))
                {
                    return(false);
                }                                                                         // Comprobar que el UserId no exista.
                string strSQL = "UPDATE " + this.m_TableName + " SET FuncionAcademico='" + this.m_FuncionAcademico + "' " +
                                "WHERE Id_Usuario=" + this.m_Id + ";";
                bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
                oDAL.CommitTrans();
                oDAL = null;
                return(boResult);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al actualizar datos del académico.", Ex);
            }
        }
Ejemplo n.º 7
0
        public new bool Actualizar()
        {
            if (this.m_Id == 0)
            {
                return(false);
            }
            clsDAL oDAL = new clsDAL();

            try
            {
                oDAL.BeginTrans();
                if (!base.Actualizar())
                {
                    return(false);
                }
                if (base.existUserId(base.Id, base.UserId))
                {
                    return(false);
                }                                                                         // Comprobar que el UserId no exista.
                string strSQL = "UPDATE " + this.m_TableName + " SET Id_CategoriaDocente=" + this.m_IdCategoriaDocente + ", " +
                                "Id_TituloAcademico=" + this.m_IdTituloAcademico + ", FacultadDepartamento='" + this.m_FacultadDepartamento + "', " +
                                "Id_AcademicoRegistra=" + this.m_IdAcademicoRegistra + " " +
                                "WHERE Id_Usuario=" + this.m_Id + ";";
                bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
                oDAL.CommitTrans();
                oDAL = null;
                return(boResult);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al actualizar datos del docente.", Ex);
            }
        }
Ejemplo n.º 8
0
        public System.Byte Agregar()
        {
            if (this.m_Menciones.Length == 0)
            {
                throw new System.Exception("Los temas para proyecto de investigación deben estar destinados, al menos, a una de las Menciones registradas.");
            }
            string strSQL = "INSERT INTO " + this.m_TableName + " " +
                            "VALUES(null, '" + this.m_Nombre + "', " + this.m_Habilitado + ");";

            clsDAL oDAL = new clsDAL();

            try
            {
                oDAL.BeginTrans();
                oDAL.ExecCommand(strSQL);
                this.m_Id = System.Convert.ToByte(oDAL.getLastIDENTITY(this.m_TableName));
                AgregarMisMenciones(this.m_Menciones);
                oDAL.CommitTrans();
                oDAL = null;
                return(this.m_Id);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al insertar tema de proyecto.", Ex);
            }
        }
Ejemplo n.º 9
0
        public void Delete(System.UInt32 Id)
        {
            clsDAL oDAL = new clsDAL();

            oDAL.ExecCommand("DELETE FROM tbl_usuario_mensaje WHERE Id=" + Id + ";");
            oDAL = null;
        }
Ejemplo n.º 10
0
        public bool Actualizar()
        {
            string strSQL = "UPDATE " + this.m_TableName + " SET Nombre='" + this.m_Nombre + "', Habilitado=" + this.m_Habilitado +
                            " WHERE Id=" + this.m_Id + ";";
            clsDAL oDAL = new clsDAL();

            try
            {
                oDAL.BeginTrans();
                bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
                if (boResult & ActualizaMenciones())
                {
                    oDAL.CommitTrans();
                }
                else
                {
                    boResult = false;
                    oDAL.RollBackTrans();
                }
                oDAL = null;
                return(boResult);
            }
            catch (System.Exception Ex)
            {
                throw new System.Exception("Error al actualizar curso.", Ex);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Agrega un nuevo maestrante, no agrega los datos a la tabla "tbl_maestrante_tema_proyecto"
        /// porque se entiende que si es nuevo, no es necesario esto, sin embargo, hay que implementar
        /// en el mátodo que actualiza los datos que se agrege el tema de proyecto para cuando el propio
        /// maestrante lo solicita a través de la página perfil.aspx.
        /// </summary>
        /// <returns></returns>
        public new bool Agregar()
        {
            clsDAL oDAL = new clsDAL();

            try
            {
                oDAL.BeginTrans();
                if (base.existUserId(base.UserId))
                {
                    return(false);
                }                                                                // Comprobar que el UserId no exista.
                if (!base.Agregar())
                {
                    return(false);
                }                                             // Comprobar que se agregan correctamente los datos generales del usuario.
                string strSQL = string.Empty;                 // Consulta para actualizar tbl_usuario.
                strSQL = "INSERT INTO " + this.m_TableName + " VALUES(" + this.m_Id + ", " + this.m_IdGrupo + ", " +
                         "'" + this.m_NoCI + "', " + this.m_IdAcademicoAutoriza + ");";
                bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
                oDAL.CommitTrans();
                oDAL = null;
                return(boResult);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al agregar nuevo maestrante.", Ex);
            }
        }
Ejemplo n.º 12
0
        public bool Eliminar(System.Byte Id)
        {
            clsDAL oDAL = new clsDAL();

            try
            {
                if (Id == 0)
                {
                    return(false);
                }
                bool boResult = false;
                // Comprobar siempre si se puede eliminar antes de hacerlo, a pesar de que este método
                // es público, ya que al escribir el código se nos puede olvidar comprobar esto y MySQL
                // no admite chequeos de integridad, al menos en la 4.1.7.
                if (this.canBeDeleted(Id))
                {
                    string strSQL = "DELETE FROM " + this.m_TableName + " WHERE Id=" + Id + ";";
                    oDAL.BeginTrans();
                    boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
                    boResult = boResult & Eliminar_TemaProyecto_Mencion(Id);
                    oDAL.CommitTrans();
                    oDAL = null;
                }

                return(boResult);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al eliminar tema de proyecto.", Ex);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Agrega un nuevo mensaje tomando los valores del objeto Usuario_Mensaje
        /// actual, o sea, los valores de los campos son los establecidos a través
        /// de las propiedades que expone esta clase. Y devuelve el valor del Id
        /// que tomó el mensaje agregado.
        /// </summary>
        /// <returns></returns>
        public System.UInt32 Agregar()
        {
            string strSQL = "INSERT INTO tbl_usuario_mensaje " +
                            "VALUES(null, " + this.m_IdUsuarioFrom + ", " +
                            this.m_IdUsuarioTo + ", '" +
                            clsUtiles.getStringMySqlFormatedDate(this.m_datFechaHora) + "', '" +
                            this.m_Mensaje + "');";
            clsDAL oDAL = new clsDAL();

            try
            {
                oDAL.BeginTrans();
                oDAL.ExecCommand(strSQL);
                System.UInt32 intIdentity = System.Convert.ToUInt32(oDAL.getLastIDENTITY("tbl_usuario_mensaje"));
                //System.Diagnostics.Debug.WriteLine(intIdentity);
                oDAL.CommitTrans();
                oDAL = null;
                return(intIdentity);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al insertar mensaje.", Ex);
            }
        }
Ejemplo n.º 14
0
        public bool registrarComoDocente(System.Byte IdCategoriaDocente, System.Byte IdTituloAcademico, string strFacultadDepartamento)
        {
            string strSQL   = "INSERT INTO tbl_usuario_docente VALUES(" + this.m_Id + ", " + IdCategoriaDocente + ", " + IdTituloAcademico + ", " + strFacultadDepartamento + ", " + this.m_Id + ");";
            clsDAL oDAL     = new clsDAL();
            bool   boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));

            oDAL = null;
            return(boResult);
        }
Ejemplo n.º 15
0
        public bool Eliminar(System.UInt32 Id)
        {
            string strSQL   = "DELETE FROM " + this.m_TableName + " WHERE Id=" + Id + ";";
            clsDAL oDAL     = new clsDAL();
            bool   boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));

            oDAL = null;
            return(boResult);
        }
Ejemplo n.º 16
0
        public bool Actualizar()
        {
            string strSQL   = "UPDATE " + this.m_TableName + " SET Id_UsuarioDocente=" + this.m_IdUsuarioDocente + ", Id_Grupo=" + this.m_IdGrupo + ", datFecha='" + clsUtiles.getStringMySqlFormatedDate(this.m_datFecha) + "', Orientaciones='" + this.m_Orientaciones + "' WHERE Id=" + this.m_Id + ";";
            clsDAL oDAL     = new clsDAL();
            bool   boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));

            oDAL = null;
            return(boResult);
        }
Ejemplo n.º 17
0
        public bool marcarComoLeida(System.UInt32 Id)
        {
            string strSQL   = "UPDATE tbl_consulta_respuesta SET Leida=1 WHERE Id_Consulta=" + Id + ";";
            clsDAL oDAL     = new clsDAL();
            bool   boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));

            oDAL = null;
            return(boResult);
        }
Ejemplo n.º 18
0
        public bool ActualizarEstadoSolicitud(System.UInt32 IdUsuario, clsMaestranteTemaProyecto.enuEstado Estado, System.UInt32 IdAcademicoRevisa)
        {
            clsDAL oDAL   = new clsDAL();
            string strSQL = "UPDATE tbl_maestrante_tema_proyecto SET Estado=" + System.Convert.ToByte(Estado) +
                            ", Id_AcademicoRevisa=" + IdAcademicoRevisa + " WHERE Id_Usuario=" + IdUsuario + ";";
            bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));

            oDAL = null;
            return(boResult);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Eliminar los registros relacionados en la tabla "tbl_curso_mencion".
        /// </summary>
        /// <param name="IdCurso"></param>
        /// <returns></returns>
        private bool Eliminar_TemaProyecto_Mencion(System.Byte IdTemaProyecto)
        {
            bool   boResult = false;
            string strSQL   = "DELETE FROM " + this.m_TBL_MisMenciones + " WHERE Id_TemaProyecto=" + IdTemaProyecto + ";";
            clsDAL oDAL     = new clsDAL();

            boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
            oDAL     = null;
            return(boResult);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Actualiza la tabla "tbl_maestria" con los valores de las propiedades en el momento de ejecución de este.
        /// </summary>
        /// <returns></returns>
        public bool Actualizar()
        {
            clsDAL oDAL   = new clsDAL();
            string strSQL = "UPDATE tbl_maestria SET Id_Provincia=" + this.m_IdProvincia + ", Id_UsuarioDirector=" + this.m_IdUsuarioDirector + ", " +
                            "Nombre='" + this.m_Nombre + "', Hospedero='" + this.m_Hospedero + "', Fundamentos='" + this.m_Fundamentos + "', RequisitosIngreso='" + this.m_RequisitosIngreso + "', " +
                            "datFechaInicio='" + clsUtiles.getStringMySqlFormatedDate(this.m_datFechaInicio) + "', datFechaFin='" + clsUtiles.getStringMySqlFormatedDate(this.m_datFechaFin) + "', " +
                            "MatriculaAbierta=" + this.m_MatriculaAbierta + ", ModuloActual=" + this.m_IdModuloActual + ";";

            System.Boolean boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
            oDAL = null;
            return(boResult);
        }
Ejemplo n.º 21
0
        public new bool Actualizar()
        {
            if (this.m_Id == 0)
            {
                return(false);
            }
            clsDAL oDAL = new clsDAL();

            try
            {
                oDAL.BeginTrans();
                if (!base.Actualizar())
                {
                    return(false);
                }
                if (base.existURL(base.Id, this.m_FullURL))
                {
                    return(false);
                }                                                                         // Comprobar que el UserId no exista.
                // Actualizar la table de los ficheros.
                string strSQL = "UPDATE " + this.m_TableFiles + " SET FileSize=" + this.m_FileSize + ", FullURL='" + this.m_FullURL + "' " +
                                "WHERE Id_Bibliografia=" + this.m_Id + ";";
                oDAL.ExecCommand(strSQL);
                // Actualizar la table de las credenciales para acceder al recurso.
                if (this.m_URLUserName != string.Empty & this.m_URLUserPass != string.Empty)
                {
                    strSQL = "UPDATE " + this.m_TableCredenciales + " SET URLUserName="******", m_URLUserPass='******' " +
                             "WHERE Id_Bibliografia=" + this.m_Id + ";";
                    oDAL.ExecCommand(strSQL);
                }
                oDAL.CommitTrans();
                oDAL = null;
                return(true);
            }
            catch (System.Exception Ex)
            {
                oDAL.RollBackTrans();
                throw new System.Exception("Error al actualizar datos del académico.", Ex);
            }
        }
Ejemplo n.º 22
0
        public bool Actualizar()
        {
            if (this.m_Id == 0)
            {
                return(false);
            }
            string strSQL = "UPDATE " + this.m_TableName + " SET Titulo='" + this.m_Titulo + "', " +
                            "Autores='" + this.m_Autores + "', Tipo=" + System.Convert.ToByte(this.m_Tipo) + " WHERE Id=" + this.m_Id + ";";
            clsDAL oDAL = new clsDAL();

            oDAL.BeginTrans();
            bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));

            // PARA AGREGAR LOS TEMAS A LOS QUE PERTENECE LA BIBLIOGRAFÍA.
            // 1. Eliminar todos los temas a los que pertenece la bibliografía.
            strSQL = "DELETE FROM " + this.m_TableTemas + " WHERE Id_Bibliografia=" + this.m_Id + ";";
            oDAL.ExecCommand(strSQL);
            // 2. Proceso para insertar nuevamente, pero sólo los valores que se proporcionan.
            clsTema Tema = new clsTema();

            System.Byte bytCantTemas = Tema.getCantidad();
            Tema = null;
            if ((this.m_Temas.Length > 0) & (this.m_Temas.Length < bytCantTemas))        // Cuando se declaran explícitamente los temas ó cuando se han seleccionado todos.
            {
                for (int i = 0; i <= (this.m_Temas.Length - 1); i++)
                {
                    strSQL = "INSERT INTO " + this.m_TableTemas + " VALUES(null, " + this.m_Id + ", " + System.Convert.ToByte(this.m_Temas[i].IdTema) + ");";
                    oDAL.ExecCommand(strSQL);
                }
            }
            else             // Para cuando no se declaran explícitamente los temas y se desea que pertenezca a todos, se inserta un cero (0).
            {
                strSQL = "INSERT INTO " + this.m_TableTemas + " VALUES(null, " + this.m_Id + ", 0);";
            }

            oDAL.CommitTrans();
            oDAL = null;
            return(boResult);
        }
Ejemplo n.º 23
0
        private void AgregarMisMenciones(struMencion[] MisMenciones)
        {
            string strSQL = string.Empty;

            clsDAL oDAL = new clsDAL();

            for (int x = 0; x <= (MisMenciones.Length - 1); x++)
            {
                strSQL = "INSERT INTO " + this.m_TBL_MisMenciones + " VALUES(null, " + MisMenciones[x].Id + ", " + this.m_Id + ");";
                oDAL.ExecCommand(strSQL);
            }
            oDAL = null;
            return;
        }
Ejemplo n.º 24
0
        public bool EliminarTemaProyecto()
        {
            if (!this.TieneTemaProyecto)
            {
                return(false);
            }
            // Actualizar el tema de proyecto.
            string strSQL   = "DELETE FROM tbl_maestrante_tema_proyecto WHERE Id_Usuario=" + this.m_Id + ";";
            clsDAL oDAL     = new clsDAL();
            bool   boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));

            oDAL = null;
            return(boResult);
        }
Ejemplo n.º 25
0
        private void AgregarMisMenciones(struMencion[] MisMenciones)
        {
            string strSQL = string.Empty;

            clsDAL oDAL = new clsDAL();

            //DataView dvMisMenciones = oDAL.getDataTable(strSQL).DefaultView;
            for (int x = 0; x <= (MisMenciones.Length - 1); x++)
            {
                strSQL = "INSERT INTO tbl_curso_mencion VALUES(null, " + this.m_Id + ", " + MisMenciones[x].Id + ");";
                oDAL.ExecCommand(strSQL);
            }
            oDAL = null;
            return;
        }
Ejemplo n.º 26
0
		public bool Actualizar()
		{
			string strSQL = "UPDATE " + this.m_TableName + " SET Id_Sede=" + this.m_IdSede + ", Id_Mencion=" + this.m_IdMencion + ", Nombre='" + this.m_Nombre + "' WHERE Id=" + this.m_Id + ";";
			clsDAL oDAL = new clsDAL();
			try
			{
				bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
				oDAL = null;
				return boResult;
			}
			catch(System.Exception Ex)
			{
				throw new System.Exception("Error al actualizar grupo.", Ex);
			}
		}
Ejemplo n.º 27
0
		public bool Eliminar()
		{
			if(this.m_Id==0){return false;}
			bool boResult = false;
			// Comprobar siempre si se puede eliminar antes de hacerlo, a pesar de que este método
			// es público, ya que al escribir el código se nos puede olvidar comprobar esto y MySQL
			// no admite chequeos de integridad, al menos en la 4.1.7.
			if(this.canBeDeleted(this.m_Id))
			{
				string strSQL = "DELETE FROM " + this.m_TableName + " WHERE Id=" + this.m_Id + ";";
				clsDAL oDAL = new clsDAL();
				boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
				oDAL = null;
			}
			return boResult;
		}
Ejemplo n.º 28
0
        public bool Actualizar()
        {
            string strSQL = "UPDATE " + this.m_TableName + " SET Nombre='" + this.m_Nombre + "' WHERE Id=" + this.m_Id + ";";
            clsDAL oDAL   = new clsDAL();

            try
            {
                bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
                oDAL = null;
                return(boResult);
            }
            catch (System.Exception Ex)
            {
                throw new System.Exception("Error al actualizar categoría docente.", Ex);
            }
        }
Ejemplo n.º 29
0
        public bool Actualizar()
        {
            string strSQL = "UPDATE " + this.m_TableName + " SET Id_UsuarioMaestrante=" + this.m_IdUsuarioMaestrante + ", Id_UsuarioDocente=" + this.IdUsuarioDocente + ", Id_Tema=" + this.m_IdTema + ", datFechaHora= '" + clsUtiles.getStringMySqlFormatedDate(this.m_datFechaHora) + "', Consulta='" + this.m_Consulta + "'" +
                            " WHERE Id=" + this.m_Id + ";";
            clsDAL oDAL = new clsDAL();

            try
            {
                bool boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));
                oDAL = null;
                return(boResult);
            }
            catch (System.Exception Ex)
            {
                throw new System.Exception("Error al actualizar consulta.", Ex);
            }
        }
Ejemplo n.º 30
0
        public bool ActualizarTemaProyecto()
        {
            if (!this.TieneTemaProyecto)
            {
                return(false);
            }
            // Actualizar el tema de proyecto.
            string strSQL = "UPDATE tbl_maestrante_tema_proyecto SET Id_TemaProyecto=" + this.m_IdTemaProyecto + ", " +
                            "Argumentos='" + this.m_Argumentos + "', datSolicitud='" + clsUtiles.getStringMySqlFormatedDate(this.m_datSolicitud) + "', " +
                            "Estado=" + this.m_EstadoTemaProyecto.ToString("d") + ", Id_AcademicoRevisa=" + this.m_IdAcademicoRevisa + " " +
                            "WHERE Id_Usuario=" + this.m_Id + ";";
            clsDAL oDAL     = new clsDAL();
            bool   boResult = System.Convert.ToBoolean(oDAL.ExecCommand(strSQL));

            oDAL = null;
            return(boResult);
        }