Exemple #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);
        }
        public DataView getListaTemas(System.Byte IdCurso)
        {
            clsTema  Tema = new clsTema();
            DataView dv   = Tema.getLista().DefaultView;

            dv.RowFilter = "Id_Curso=" + IdCurso;
            Tema         = null;
            return(dv);
        }
Exemple #3
0
        public DataView getListaTemas()
        {
            clsTema       Tema       = new clsTema();
            clsMaestrante Maestrante = new clsMaestrante(HttpContext.Current.User.Identity.Name);
            DataView      dv         = Tema.getListaForMaestrante(Maestrante.Id).DefaultView;

            Maestrante = null;
            Tema       = null;
            return(dv);
        }
Exemple #4
0
 public bool ActualizarTema(clsTema Tema)
 {
     try
     {
         return(Tema.Actualizar());
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Error al actualizar los datos del tema.", Ex);
     }
 }
Exemple #5
0
 public bool AgregarTema(clsTema Tema)
 {
     try
     {
         return(System.Convert.ToBoolean(Tema.Agregar()));
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Error al agregar tema.", Ex);
     }
 }
Exemple #6
0
        public DataView[] getListas()
        {
            DataView[] dv   = new DataView[2];
            clsTema    Tema = new clsTema();

            dv[0] = Tema.getListaForConsultasRespondidas().DefaultView;
            Tema  = null;
            clsDocente Docente = new clsDocente();

            dv[1]   = Docente.getListaConConsultasRespondidas().DefaultView;
            Docente = null;
            return(dv);
        }
Exemple #7
0
 public clsTema getTemaClass()
 {
     try
     {
         clsTema Tema = new clsTema();
         return(Tema);
     }
     catch (System.Exception Ex)
     {
         string strErrorMessage = "Error al devolver la clase para los datos del tema.";
         throw new System.Exception(strErrorMessage, Ex);
     }
 }
Exemple #8
0
 public string[] WhyCanNotDeleteTema(System.Byte Id)
 {
     try
     {
         clsTema  Tema      = new clsTema();
         string[] aryResult = Tema.WhyCanNotBeDeleted(Id);
         Tema = null;
         return(aryResult);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Error al recuperar la(s) causa que impide eliminar el tema.", Ex);
     }
 }
Exemple #9
0
 public bool CanDeleteTema(System.Byte Id)
 {
     try
     {
         clsTema Tema     = new clsTema();
         bool    boResult = Tema.canBeDeleted(Id);
         Tema = null;
         return(boResult);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Error al comprobar si puede ser eliminado el tema.", Ex);
     }
 }
Exemple #10
0
 public bool EliminarTema(System.Byte Id)
 {
     try
     {
         clsTema Tema     = new clsTema();
         bool    boResult = Tema.Eliminar(Id);
         Tema = null;
         return(boResult);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Error al eliminar tema.", Ex);
     }
 }
Exemple #11
0
 public DataView getListaTemas(System.Byte IdCurso)
 {
     try
     {
         clsTema  Tema = new clsTema();
         DataView dv   = Tema.getLista().DefaultView;
         dv.RowFilter = "Id_Curso=" + IdCurso;
         Tema         = null;
         return(dv);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Imposible recuperar la lista de los temas registrados.", Ex);
     }
 }
Exemple #12
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);
        }
Exemple #13
0
 public DataView getAllTemas(System.Byte IdCurso)
 {
     try
     {
         clsTema   Tema    = new clsTema();
         DataTable dtTemas = new DataTable();
         dtTemas = Tema.getAllRecords(IdCurso);
         for (int i = 0; i <= (dtTemas.Rows.Count - 1); i++)
         {
             dtTemas.Rows[i]["ActividadesAprendizaje"]    = clsUtiles.getFromBLOB(dtTemas.Rows[i]["ActividadesAprendizaje"]).ToString();
             dtTemas.Rows[i]["ActividadesAutoevaluacion"] = clsUtiles.getFromBLOB(dtTemas.Rows[i]["ActividadesAutoevaluacion"]).ToString();
         }
         DataView dvTemas = dtTemas.DefaultView;
         dtTemas = null;
         Tema    = null;
         return(dvTemas);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Imposible recuperar la lista de temas que le pertenecen al curso seleccionado.", Ex);
     }
 }