public async Task <IEnumerable <Category> > GetCategories() { if (!categories.Any()) { categories.AddRange(await categoryServiceClient.GetCategories()); } return(categories); }
private void PopulateComboboxes() { var catService = new CategoryServiceClient(); cbCategory.DataSource = catService.GetCategories(); cbCategory.DisplayMember = "CategoryName"; cbCategory.ValueMember = "Id"; var ptService = new PaymentTypeServiceClient(); cbPaymentType.DataSource = ptService.GetPaymentTypes(); cbPaymentType.DisplayMember = "Name"; cbPaymentType.ValueMember = "id"; }
private void InitComboBox() { cbCategories.DataSource = _service.GetCategories(); cbCategories.ValueMember = "CategoryID"; cbCategories.DisplayMember = "CategoryName"; }