static Controller() { _MutualList = EstablesIndependientesDAC.Search_MutualList_All(); _MutualList.Add(new MutualBE { Nombre = "Todos", IdMutual = (int)CommonValuesEnum.TodosComboBoxValue }); _MutualList.Add(new MutualBE { Nombre = Enum.GetName(typeof(CommonValuesEnum), CommonValuesEnum.Ninguno), IdMutual = (int)CommonValuesEnum.Ninguno }); _ProfecionalList = EstablesIndependientesDAC.Search_ProfecionalList_ByParams(new ProfecionalBE()); _ProfecionalList.Add(new ProfecionalBE { Nombre = "Todos", IdProfecional = (int)CommonValuesEnum.TodosComboBoxValue }); _ProfecionalList.Add(new ProfecionalBE { Nombre = Enum.GetName(typeof(CommonValuesEnum), CommonValuesEnum.Ninguno), IdProfecional = (int)CommonValuesEnum.Ninguno }); _TipoConsultaList = ParamComercialDAC.GetByParams(200, null, true, string.Empty); _TipoConsultaList.Add(new ParamComercialBE { Nombre = "Todos", IdParamComercial = (int)CommonValuesEnum.TodosComboBoxValue }); _TipoConsultaList.Add(new ParamComercialBE { Nombre = Enum.GetName(typeof(CommonValuesEnum), CommonValuesEnum.Ninguno), IdParamComercial = (int)CommonValuesEnum.Ninguno }); }
/// <summary> /// /// </summary> /// <param name="param"></param> /// <returns></returns> public static ProfecionalList Search_ProfecionalList_ByParams(ProfecionalBE param) { ProfecionalList list = new ProfecionalList(); try { using (ClinicaEntities dc = new ClinicaEntities()) { var x = from c in dc.Profecional where (param.IdEspecialidad.Equals(null) || c.IdEspecialidad.Equals(param.IdEspecialidad)) && (string.IsNullOrEmpty(param.Nombre) || c.Nombre.Contains(param.Nombre)) select new ProfecionalBE { IdEspecialidad = c.IdEspecialidad, IdProfecional = c.IdProfecional, Nombre = c.Nombre, Apellido = c.Apellido, UserId = c.UserId, }; list.AddRange(x.ToArray <ProfecionalBE>()); } return(list); } catch (Exception ex) { throw Fwk.Exceptions.ExceptionHelper.ProcessException(ex); } }