public void setCBB() { foreach (LSH lsh in CSDL_OOP.Instance.GetAllLSH()) { lsh_cbb.Items.Add(new CBBItem { Value = lsh.ID_Lop, Text = lsh.NameLop }); } if (sv.MSSV == null) { lsh_cbb.SelectedIndex = 0; } else { for (int i = 0; i < lsh_cbb.Items.Count; i++) { CBBItem cb = (CBBItem)lsh_cbb.Items[i]; if (cb.Value == sv.ID_Lop) { lsh_cbb.SelectedIndex = i; break; } } } }
private void setData() { sv.MSSV = txt_MSSV.Text; sv.NameSV = txt_Name.Text; sv.NS = ns_picker.Value; CBBItem item = (CBBItem)lsh_cbb.SelectedItem; sv.ID_Lop = item.Value; }
private void sort_btn_Click(object sender, EventArgs e) { CBBItem cb = (CBBItem)sort_comboBox.SelectedItem; if (cb.Value == 0) { sortDelegate(byMSSV); //sortByMSSV(ascending); } else if (cb.Value == 1) { sortDelegate(byName); // sortByMSSV(descending); } else { sortDelegate(byDate); } }
private void search_btn_Click(object sender, EventArgs e) { CBBItem cb = (CBBItem)lopSH_cbb.SelectedItem; showListSV(search_txt.Text); }
public void showListSV(string name) { CBBItem cb = (CBBItem)lopSH_cbb.SelectedItem; dataGridView1.DataSource = CSDL_OOP.Instance.GetListSV(cb.Value, name); }