public static Resultado GetPreferences() { var query = new DPreferencia().GetPreferences(); List <EPreference> PreferencesList = new List <EPreference>(); foreach (var item in query) { EPreference preference = new EPreference { Name = item.descripcion, Id = item.id_Preferencias, Status = Convert.ToBoolean(item.estado) }; PreferencesList.Add(preference); } if (PreferencesList.Count > 0) { return(new Resultado() { Respuesta = 1, Mensaje = "Preferencias encontradas.", Valores = PreferencesList }); } return(new Resultado() { Respuesta = 0, Mensaje = "No se encontraron preferecias.", Valores = null }); }
// Constructor public CIEvent( CPGDate date, string sType, string sDescription, string sOverview, string sNote, bool sImportant, bool bCapitalise ) { m_epPreference = EPreference.Unknown; m_date = date; if( bCapitalise ) { CCreator.Capitalise( ref sDescription ); } if( sDescription.Length > 0 ) { if( sDescription[ sDescription.Length - 1 ] == '.' ) { m_sDescription = sDescription.Substring( 0, sDescription.Length - 1 ); } else { m_sDescription = sDescription; } } m_sOverview = sOverview; m_bImportant = sImportant; m_sNote = sNote; if( sNote == "" ) { m_sNote = null; } m_sType = sType; }