Esempio n. 1
0
        private void LoadCustomerComboBox()
        {
            //  kosongkan combobox
            CustomerComboBox.DataSource = null;
            CustomerComboBox.Items.Clear();

            //  ambil data
            var listCustomer = _customerBL.ListData();

            //  exit jika kosong
            if (listCustomer == null)
            {
                return;
            }

            listCustomer = listCustomer.OrderBy(x => x.CustomerName).ToList();
            CustomerComboBox.DataSource    = listCustomer;
            CustomerComboBox.DisplayMember = "CustomerName";
            CustomerComboBox.ValueMember   = "CustomerID";

            CustomerComboBox.SelectedItem = null;
        }
 public IEnumerable <CustomerModel> ListCustomer()
 {
     return(_customerBL.ListData());
 }