private void LoadData() { try { List <TypeModel> list = serviceT.GetList(); if (list != null) { controlDataGridViewOutput.FillDataGrid(list); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LoadListBox() { var listT = serviceT.GetList(); if (listT != null) { foreach (var type in listT) { bool check = false; if (bookTypes.FirstOrDefault(rec => rec.TypeId == type.Id) != null) { check = true; } types.Add(type.Title, check); } controlCheckedListType.LoadList(types); } }
private void LoadData() { try { List <TypeModel> list = serviceT.GetList(); if (list != null) { foreach (var type in list) { bool check = false; if (bookTypes.FirstOrDefault(rec => rec.TypeId == type.Id) != null) { check = true; } types.Add(type.Title, check); } controlCheckedListBox.LoadList(types); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }