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

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

            if (isPending)
            {
                foreach (var item in list)
                {
                    if (item.Status == ReviewStatus.Pending)
                    {
                        item.Name = "(PENDING) " + item.Name;
                    }
                }
            }
            cmbArtist.DataSource    = list;
            cmbArtist.ValueMember   = "Id";
            cmbArtist.DisplayMember = "Name";
        }
예제 #2
0
        public async Task LoadArtists()
        {
            ArtistList.Clear();

            var request = new Model.Requests.ArtistsSearchRequest
            {
                Filter = (int)ReviewStatus.Approved
            };
            var list = await _serviceArtists.Get <List <Model.Artists> >(request);

            foreach (var item in list)
            {
                ArtistList.Add(item);
            }
        }
        private async Task loadArtists()
        {
            var request = new Model.Requests.ArtistsSearchRequest
            {
                Name   = txtSearch.Text,
                Filter = (cmbStatusFilter.SelectedItem as FilterItem).Id
            };
            var list = await _serviceArtists.Get <List <Model.Artists> >(request);

            foreach (var item in list)
            {
                if (item.Status == Model.ReviewStatus.Rejected)
                {
                    item.Status = Model.ReviewStatus.Pending;
                }
            }
            dgvArtists.AutoGenerateColumns = false;
            dgvArtists.DataSource          = list;
        }
 public List <Model.Artists> Get([FromQuery] Model.Requests.ArtistsSearchRequest request)
 {
     return(_service.Get(request));
 }