Пример #1
0
        /// <summary>
        /// Retorna profecionales directamente relacionados in la inst
        /// Retorna  Profesional_FullViewBE
        /// </summary>
        /// <param name="healthInstId"></param>
        /// <returns></returns>
        public static List <Profesional_FullViewBE> SearchBy_HealthInstRelated(Guid healthInstId, List <Int32> prof_ids_JustRetrived = null)
        {
            Profesional_FullViewList wProfesionalsBEList = new Profesional_FullViewList();
            Profesional_FullViewBE   wProfesionalBE      = null;

            if (prof_ids_JustRetrived == null)
            {
                prof_ids_JustRetrived = new List <int>();
            }
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                //Profecionales de la institucion


                var wProfesionals_DB = from p in dc.Profesional_FullView
                                       from hp in dc.HealthInstitution_Profesional
                                       where
                                       hp.HealthInstitutionId.Equals(healthInstId) &&
                                       hp.ProfesionalId.Equals(p.IdProfesional) &&
                                       (prof_ids_JustRetrived.Count().Equals(0) || !prof_ids_JustRetrived.Contains(p.IdProfesional))        //Exeptua los just retriveds
                                       select p;

                foreach (var item in wProfesionals_DB)
                {
                    wProfesionalBE = (Profesional_FullViewBE)item;
                    //wProfesionalBE.HealthInstitution_Profesional = (HealthInstitution_ProfesionalBE)item.Prof_hp;
                    wProfesionalsBEList.Add(wProfesionalBE);
                }
            }
            return(wProfesionalsBEList);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="nombre"></param>
        /// <param name="apellido"></param>
        /// <returns></returns>
        public static List <Profesional_FullViewBE> SearchByParams(string nombre, string apellido)
        {
            Profesional_FullViewList    wProfesionalsBEList = new Profesional_FullViewList();
            List <Profesional_FullView> wProfesionals       = null;

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                if (String.IsNullOrEmpty(nombre) || String.IsNullOrEmpty(apellido))
                {
                    wProfesionals = dc.Profesional_FullView.ToList <Profesional_FullView>();
                }
                else
                {
                    var Profesionals = from p in dc.Profesional_FullView
                                       where
                                       (String.IsNullOrEmpty(nombre) || p.Nombre.Contains(nombre) ||
                                        (String.IsNullOrEmpty(apellido) || p.Apellido.Contains(apellido)))
                                       select p;

                    wProfesionals = Profesionals.ToList <Profesional_FullView>();
                }

                Profesional_FullViewBE wProfesionalBE = null;

                foreach (Profesional_FullView p in wProfesionals)
                {
                    wProfesionalBE = (Profesional_FullViewBE)p;
                    wProfesionalsBEList.Add(wProfesionalBE);
                }
            }
            return(wProfesionalsBEList);
        }
Пример #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="nombre"></param>
        /// <param name="apellido"></param>
        /// <returns></returns>
        public static List<Profesional_FullViewBE> SearchByParams(string nombre, string apellido)
        {
            Profesional_FullViewList wProfesionalsBEList = new Profesional_FullViewList();
            List<Profesional_FullView> wProfesionals = null;

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                if (String.IsNullOrEmpty(nombre) || String.IsNullOrEmpty(apellido))
                    wProfesionals = dc.Profesional_FullView.ToList<Profesional_FullView>();
                else
                {
                    var Profesionals = from p in dc.Profesional_FullView
                                       where
                                           (String.IsNullOrEmpty(nombre) || p.Nombre.Contains(nombre)
                                           || (String.IsNullOrEmpty(apellido) || p.Apellido.Contains(apellido)))
                                       select p;

                    wProfesionals = Profesionals.ToList<Profesional_FullView>();
                }

                Profesional_FullViewBE wProfesionalBE = null;

                foreach (Profesional_FullView p in wProfesionals)
                {
                    wProfesionalBE = (Profesional_FullViewBE)p;
                    wProfesionalsBEList.Add(wProfesionalBE);
                }


            }
            return wProfesionalsBEList;
        }
Пример #4
0
        /// <summary>
        /// Retorna profecionales directamente relacionados in la inst
        /// Retorna  Profesional_FullViewBE
        /// </summary>
        /// <param name="healthInstId"></param>
        /// <returns></returns>
        public static List<Profesional_FullViewBE> SearchBy_HealthInstRelated(Guid healthInstId, List<Int32> prof_ids_JustRetrived = null)
        {
            Profesional_FullViewList wProfesionalsBEList = new Profesional_FullViewList();
            Profesional_FullViewBE wProfesionalBE=null;
            if (prof_ids_JustRetrived == null) prof_ids_JustRetrived = new List<int>();
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                //Profecionales de la institucion
        

                var wProfesionals_DB = from p in dc.Profesional_FullView
                                       from hp in dc.HealthInstitution_Profesional
                                       where
                                            hp.HealthInstitutionId.Equals(healthInstId)
                                           && hp.ProfesionalId.Equals(p.IdProfesional)
                                           && (prof_ids_JustRetrived.Count().Equals(0) || !prof_ids_JustRetrived.Contains(p.IdProfesional)) //Exeptua los just retriveds
                                       select p;

                foreach (var item in wProfesionals_DB)
                {
                    wProfesionalBE = (Profesional_FullViewBE)item;
                    //wProfesionalBE.HealthInstitution_Profesional = (HealthInstitution_ProfesionalBE)item.Prof_hp;
                    wProfesionalsBEList.Add(wProfesionalBE);
                }
            }
            return wProfesionalsBEList;
        }