private void init_combo_award() { try { comboBoxAwards.Items.Clear(); List <STAward> st = clAward.GetList(); foreach (STAward item in st) { comboBoxAwards.Items.Add(item.nameaward); } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }
private void init_data() { dataGridViewAward.Rows.Clear(); list = clWork.GetList(); gpos = -1; try { if (list.Count > 0) { g_f = true; dataGridViewAward.Rows.Add(list.Count); for (int i = 0; i < list.Count; i++) { dataGridViewAward.Rows[i].Cells[0].Value = list[i].idaward.ToString(); if (list[i].nameaward != null) { dataGridViewAward.Rows[i].Cells[1].Value = list[i].nameaward; } if (flawour.Equals(list[i])) { gpos = i; } } dataGridViewAward.AllowUserToAddRows = false; } else { dataGridViewAward.AllowUserToAddRows = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } }