/// <summary> /// Fills the combo box with data. /// </summary> private void FillComboBox() { try { DeityViewModel deityViewModel = new DeityViewModel(); cmbDeity.DisplayMember = "DeityName"; cmbDeity.ValueMember = "DeityID"; cmbDeity.DataSource = deityViewModel.GetAllDeities().ToList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public Deity() { InitializeComponent(); lblMsg.Text = null; deityViewModel = new DeityViewModel(); }
private void Form1_Load(object sender, EventArgs e) { DeityViewModel dietyViewModel = new DeityViewModel(); dietyViewModel.GetAllDeities(); }