示例#1
0
        public async Task <IEnumerable <Category> > GetCategories()
        {
            if (!categories.Any())
            {
                categories.AddRange(await categoryServiceClient.GetCategories());
            }

            return(categories);
        }
示例#2
0
        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";
        }
示例#3
0
 private void InitComboBox()
 {
     cbCategories.DataSource    = _service.GetCategories();
     cbCategories.ValueMember   = "CategoryID";
     cbCategories.DisplayMember = "CategoryName";
 }