private async Task LoadCmbSongs()
        {
            bool isPending = (entity != null && entity.Status == ReviewStatus.Pending);

            var request = new Model.Requests.SongsSearchRequest
            {
                Filter = isPending
                        ? (int)ReviewStatus.FilterPendingApproved
                        : (int)ReviewStatus.Approved
            };
            var list = await _serviceSongs.Get <List <Model.Songs> >(request);

            if (isPending)
            {
                foreach (var item in list)
                {
                    if (item.Status == ReviewStatus.Pending)
                    {
                        item.Name = "(PENDING) " + item.Name;
                    }
                }
            }
            cmbSong.DataSource    = list;
            cmbSong.ValueMember   = "Id";
            cmbSong.DisplayMember = "Name";
        }
Exemplo n.º 2
0
        public async Task LoadSongs()
        {
            SongList.Clear();

            var request = new Model.Requests.SongsSearchRequest
            {
                AlbumId = AlbumId,
                Filter  = (int)ReviewStatus.Approved
            };
            var list = await _serviceSongs.Get <List <Model.Songs> >(request);

            foreach (var item in list)
            {
                SongList.Add(item);
            }
        }
Exemplo n.º 3
0
        private async Task loadSongs()
        {
            var request = new Model.Requests.SongsSearchRequest
            {
                SearchTerm = txtSearch.Text,
                Filter     = (cmbStatusFilter.SelectedItem as FilterItem).Id
            };
            var list = await _serviceSongs.Get <List <Model.Songs> >(request);

            foreach (var item in list)
            {
                if (item.Status == Model.ReviewStatus.Rejected)
                {
                    item.Status = Model.ReviewStatus.Pending;
                }
            }
            dgvSongs.AutoGenerateColumns = false;
            dgvSongs.DataSource          = list;
        }
        public async Task LoadSongs()
        {
            SongList.Clear();

            var request = new Model.Requests.SongsSearchRequest
            {
                AlbumId = _albumId,
                Filter  = (int)ReviewStatus.Approved
            };
            var list = await _serviceSongs.Get <List <Model.Songs> >(request);

            NothingToSeeSongs = list.Count == 0;
            int counter = 0;

            foreach (var item in list)
            {
                SongList.Add(item);
                item.Counter = ++counter;
            }
        }
 public List <Model.Songs> Get([FromQuery] Model.Requests.SongsSearchRequest request)
 {
     return(_service.Get(request));
 }