Ejemplo n.º 1
0
        public static bool AgregarTag(Tag tag)
        {
            Conexiones.Con_Tags CT = new Conexiones.Con_Tags();
            bool flag = CT.AgregarTag(tag);

            return(flag);
        }
Ejemplo n.º 2
0
        public static Tag GetTagById(int idTag)
        {
            Conexiones.Con_Tags CT = new Conexiones.Con_Tags();
            DataTable           DT = CT.GetTagById(idTag);

            if (DT != null && DT.Rows.Count > 0)
            {
                Tag tagFinal = new Tag(DT.Rows[0]);
                return(tagFinal);
            }
            return(null);
        }
Ejemplo n.º 3
0
        public static List <Tag> GetTagByTagName(string name)
        {
            Conexiones.Con_Tags CT = new Conexiones.Con_Tags();
            DataTable           DT = CT.GetTagByTagName(name);

            if (DT != null && DT.Rows.Count > 0)
            {
                List <Tag> LT = new List <Tag>();
                foreach (DataRow DR in DT.Rows)
                {
                    LT.Add(new Tag(DR));
                }
                return(LT);
            }
            return(null);
        }
Ejemplo n.º 4
0
        public static List <int> GetCharsDiscriminados()
        {
            Conexiones.Con_Tags CT = new Conexiones.Con_Tags();
            DataTable           DT = CT.GetCharsDiscriminados();

            if (DT != null && DT.Rows.Count > 0)
            {
                List <int> LI = new List <int>();
                for (int a = 0; a < DT.Rows.Count; a++)
                {
                    LI.Add(Convert.ToInt32(DT.Rows[a][0]));
                }
                return(LI);
            }
            return(null);
        }
Ejemplo n.º 5
0
        public static bool EliminarTag(int idTag)
        {
            //Elimina el tag de la lista de tags
            Conexiones.Con_Tags CT = new Conexiones.Con_Tags();
            bool flag = CT.BorrarTag(idTag);

            //Elimina las asociaciones existentes del tag a los pacientes
            List <Paciente> aux = Paciente.PacientesPorTag(idTag);

            if (aux != null)
            {
                foreach (Paciente paciente in aux)
                {
                    flag = paciente.BorrarTag(idTag);
                }
            }

            return(flag);
        }