Exemple #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);
        }
Exemple #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);
        }
Exemple #3
0
 public bool Agregar(clsMencion Mencion)
 {
     try
     {
         return(System.Convert.ToBoolean(Mencion.Agregar()));
     }
     catch (System.Exception)
     {
         return(false);
     }
 }
Exemple #4
0
 public bool Actualizar(clsMencion Mencion)
 {
     try
     {
         return(Mencion.Actualizar());
     }
     catch (System.Exception)
     {
         return(false);
     }
 }
Exemple #5
0
 public clsMencion getMencionClass()
 {
     try
     {
         clsMencion Mencion = new clsMencion();
         return(Mencion);
     }
     catch (System.Exception Ex)
     {
         string strErrorMessage = "Error al devolver la clase para los datos de la mención.";
         throw new System.Exception(strErrorMessage, Ex);
     }
 }
Exemple #6
0
 public DataView getListaMenciones()
 {
     try
     {
         clsMencion Mencion     = new clsMencion();
         DataView   dvMenciones = Mencion.getLista().DefaultView;
         Mencion = null;
         return(dvMenciones);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Imposible recuperar la lista de las menciones.", Ex);
     }
 }
Exemple #7
0
 public string[] WhyCanNotBeDeleted(System.Byte Id)
 {
     try
     {
         clsMencion Mencion   = new clsMencion();
         string[]   aryResult = Mencion.WhyCanNotBeDeleted(Id);
         Mencion = null;
         return(aryResult);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Error al recuperar la(s) causa que impide eliminar la mención.", Ex);
     }
 }
Exemple #8
0
 public bool canBeDeleted(System.Byte Id)
 {
     try
     {
         clsMencion Mencion  = new clsMencion();
         bool       boResult = Mencion.canBeDeleted(Id);
         Mencion = null;
         return(boResult);
     }
     catch (System.Exception Ex)
     {
         throw new System.Exception("Error al comprobar si puede ser eliminada la mención.", Ex);
     }
 }
Exemple #9
0
 public bool Eliminar(System.Byte Id)
 {
     try
     {
         clsMencion Mencion  = new clsMencion();
         bool       boResult = Mencion.Eliminar(Id);
         Mencion = null;
         return(boResult);
     }
     catch (System.Exception)
     {
         return(false);
     }
 }
Exemple #10
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);
        }