Esempio n. 1
0
        public struMencion[] getMencionesForEdit(System.Byte Id)
        {
            clsMencion Mencion     = new clsMencion();
            DataTable  dtMenciones = Mencion.getLista();

            Mencion = null;
            clsTemaProyecto TemaProyecto = new clsTemaProyecto();

            clsTemaProyecto.struMencion[] MisMenciones = TemaProyecto.getMenciones(Id);
            TemaProyecto = null;
            struMencion[] result = new struMencion[dtMenciones.Rows.Count];
            for (int x = 0; x <= (dtMenciones.Rows.Count - 1); x++)
            {
                result[x].Id     = System.Convert.ToByte(dtMenciones.Rows[x]["Id"]);
                result[x].Nombre = System.Convert.ToString(dtMenciones.Rows[x]["Nombre"]);
                for (int y = 0; y <= (MisMenciones.Length - 1); y++)
                {
                    if (System.Convert.ToByte(dtMenciones.Rows[x]["Id"]) == MisMenciones[y].Id)
                    {
                        result[x].Selected = true;
                        break;
                    }
                }
            }
            return(result);
        }
Esempio n. 2
0
        public struMencion[] getMencionesForEdit(System.Byte Id)
        {
            clsMencion Mencion     = new clsMencion();
            DataTable  dtMenciones = Mencion.getLista();

            Mencion = null;
            clsCurso Curso = new clsCurso();

            clsCurso.struMencion[] MisMenciones = Curso.getMenciones(Id);
            Curso = null;
            struMencion[] result = new struMencion[dtMenciones.Rows.Count];
            for (int x = 0; x <= (dtMenciones.Rows.Count - 1); x++)
            {
                result[x].Id     = System.Convert.ToByte(dtMenciones.Rows[x]["Id"]);
                result[x].Nombre = System.Convert.ToString(dtMenciones.Rows[x]["Nombre"]);
                for (int y = 0; y <= (MisMenciones.Length - 1); y++)
                {
                    System.Diagnostics.Debug.WriteLine("Id: " + result[x].Id + ", " + result[x].Nombre + ": " + System.Convert.ToByte(dtMenciones.Rows[x]["Id"]) + " = " + MisMenciones[y].Id);
                    if (System.Convert.ToByte(dtMenciones.Rows[x]["Id"]) == MisMenciones[y].Id)
                    {
                        result[x].Selected = true;
                        break;
                    }
                }
            }
            return(result);
        }
Esempio n. 3
0
        public struMencion[] getMencionesForNuevo()
        {
            clsMencion Mencion     = new clsMencion();
            DataTable  dtMenciones = Mencion.getLista();

            Mencion = null;
            struMencion[] result = new struMencion[dtMenciones.Rows.Count];
            for (int x = 0; x <= (dtMenciones.Rows.Count - 1); x++)
            {
                result[x].Id       = System.Convert.ToByte(dtMenciones.Rows[x]["Id"]);
                result[x].Nombre   = System.Convert.ToString(dtMenciones.Rows[x]["Nombre"]);
                result[x].Selected = true;
            }
            return(result);
        }
Esempio n. 4
0
        /// <summary>
        /// Devuelve una estructura con los campos: Id, Id_Mencion y Nombre de todos los registros
        /// de las menciones en la tabla tbl_curso_mencion.
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public struMencion[] getMenciones(System.Byte Id)
        {
            string strSQL = "SELECT " + this.m_TBL_MisMenciones + ".Id, " + this.m_TBL_MisMenciones + ".Id_Mencion, tbl_mencion.Nombre " +
                            "FROM " + this.m_TBL_MisMenciones + " " +
                            "INNER JOIN tbl_mencion ON " + this.m_TBL_MisMenciones + ".Id_Mencion=tbl_mencion.Id " +
                            "WHERE " + this.m_TBL_MisMenciones + ".Id_TemaProyecto=" + Id + " ORDER BY tbl_mencion.Nombre;";

            clsDAL   oDAL           = new clsDAL();
            DataView dvMisMenciones = oDAL.getDataTable(strSQL).DefaultView;

            struMencion[] MisMenciones = new struMencion[dvMisMenciones.Table.Rows.Count];
            for (int x = 0; x <= (dvMisMenciones.Table.Rows.Count - 1); x++)
            {
                MisMenciones[x].Id     = System.Convert.ToByte(dvMisMenciones.Table.Rows[x]["Id_Mencion"]);
                MisMenciones[x].Nombre = System.Convert.ToString(dvMisMenciones.Table.Rows[x]["Nombre"]);
            }
            return(MisMenciones);
        }