private void LoadCustomer() { List <KeyValue> listoffuels = KeyValueRepository.GetCustomers().ToList(); if (listoffuels.Count > 0) { cmb_customers.DataSource = listoffuels; cmb_customers.DisplayMember = "Name"; cmb_customers.ValueMember = "Id"; cmb_customers.SelectedIndex = 0; } }
private void LoadCustomers() { try { List <KeyValue> listoffuels = KeyValueRepository.GetCustomers().ToList(); if (listoffuels.Count > 0) { cmb_customer.DataSource = listoffuels; cmb_customer.DisplayMember = "Name"; cmb_customer.ValueMember = "Id"; cmb_customer.SelectedIndex = 0; } } catch (Exception ex) { MessageBox.Show("Error Has found when loading data. Please forword following details to technical" + Environment.NewLine + "[" + ex.Message + Environment.NewLine + ex.Source + "]", Messaging.MessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error); } }