Exemple #1
0
        public IEnumerable <ProfileMme> GetMmeProfiles(long mmeCodeId)
        {
            lock (_locker)
            {
                var list = new List <ProfileMme>();
                if (_connection == null || _connection.State != ConnectionState.Open)
                {
                    return(list);
                }

                list = _profilesService.GetProfileItems().Select(p => new ProfileMme {
                    Id = p.ProfileId, Name = p.ProfileName
                }).ToList();

                var codesSelectCommand = new SQLiteCommand("SELECT PROFILE_ID FROM MME_CODES_TO_PROFILES where MME_CODE_ID=@MME_CODE_ID", _connection);
                codesSelectCommand.Parameters.Add("@MME_CODE_ID", DbType.Int64);
                codesSelectCommand.Prepare();
                codesSelectCommand.Parameters["@MME_CODE_ID"].Value = mmeCodeId;
                using (var reader = codesSelectCommand.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var id   = (long)reader[0];
                        var item = list.FirstOrDefault(p => p.Id.Equals(id));
                        if (!ReferenceEquals(item, null))
                        {
                            item.IsSelected = true;
                        }
                    }
                }
                return(list);
            }
        }
Exemple #2
0
 public List <ProfileItem> GetProfiles()
 {
     try
     {
         return(_profilesService.GetProfileItems());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
 public List <ProfileItem> GetProfileItems()
 {
     return(_profilesService.GetProfileItems());
 }