/// Lista brebe de posibles profecionales para invitar con /// IdProfesional,Nombre,Apellido /// </summary> /// <param name="nombreapellido">Filtro</param> /// <returns>HealthInstitutions_SuscriptionRequestsList</returns> public static HealthInstitutions_SuscriptionRequestsList Search_Pending_HealthInstitutionsSuscriptionInfo(int profesionalId) { return(HealthInstitutionDAC.Retrive_PendingSubscriptions_SimpleList(profesionalId)); // HealthInstitutions_SuscriptionRequestsList list = new HealthInstitutions_SuscriptionRequestsList(); //using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) //{ // ///Busca a los que ya se le enviaron solicitudes // var wHealthInstitution_pendings = HealthInstitutionDAC.Retrive_PendingSubscriptions_SimpleList(profesionalId); // list.AddRange(wHealthInstitution_pendings.ToList<HealthInstitutions_SuscriptionRequestsBE>()); //} // return list; }
/// <summary> /// Lista brebe de posibles profecionales para invitar con /// IdProfesional,Nombre,Apellido /// </summary> /// <param name="nombreapellido">Filtro</param> /// <returns>HealthInstitutions_SuscriptionRequestsList</returns> public static HealthInstitutions_SuscriptionRequestsList SearchProfesionals_ToSuscriptionInfo(int profesionalId, Guid healthInstituteId, string nombreapellido) { HealthInstitutions_SuscriptionRequestsList wProfesionalsBEList = new HealthInstitutions_SuscriptionRequestsList(); using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities)) { ///Busca a los que ya se le enviaron solicitudes var profesionals_pendings = HealthInstitutionDAC.Retrive_Subscriptions_SimpleList(healthInstituteId); ///Profesionales que ya pertenecen a la institución Esta es un alista para quitar var profesionals_exist = from hp in dc.HealthInstitution_Profesional from p in dc.Profesional_FullView where hp.HealthInstitutionId.Equals(healthInstituteId) && hp.ProfesionalId.Equals(p.IdProfesional) && hp.ProfesionalId.Equals(profesionalId) == false select new HealthInstitutions_SuscriptionRequestsBE { Profesional_To = p.IdProfesional, Nombre_To = p.Nombre, Apellido_To = p.Apellido }; Int32[] ids_pendings = (from s in profesionals_pendings select s.Profesional_To).ToArray(); Int32[] ids_exists = (from s in profesionals_exist select s.Profesional_To).ToArray(); var profesionals_All = from p in dc.Profesional_FullView where !(ids_pendings.Contains(p.IdProfesional)) && //excluye profesionals_pendings !(ids_exists.Contains(p.IdProfesional)) && // excluye profesionals_exist (String.IsNullOrEmpty(nombreapellido) || p.Nombre.Contains(nombreapellido) || p.Apellido.Contains(nombreapellido)) select new HealthInstitutions_SuscriptionRequestsBE { Profesional_To = p.IdProfesional, Nombre_To = p.Nombre, Apellido_To = p.Apellido, Status = (int)SubscriptionRequestStatus.Null }; wProfesionalsBEList.AddRange(profesionals_pendings.ToList <HealthInstitutions_SuscriptionRequestsBE>()); wProfesionalsBEList.AddRange(profesionals_All.ToList <HealthInstitutions_SuscriptionRequestsBE>()); } return(wProfesionalsBEList); }