private void FrmLuong_Load(object sender, EventArgs e) { model = new LuongModel(); model.setControl(dataGridView1, lblMessage); model.getAllData("LUONG_CO_BAN DESC"); model.ShowDetail(ShowDetail); validate.SetTooltip(toolTip1); if (CurrentRowSelected != null) { dataGridView1.ClearSelection(); foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells[0].Value.ToString().Equals(CurrentRowSelected)) { row.Cells[0].Selected = true; } } dataGridView1.DoubleClick += new EventHandler(dataGridView1_DoubleClick); } ShowDetail(dataGridView1.CurrentRow); }
private void loadComboBoxLuong() { //Variable LuongModel luongM = new LuongModel(); DataTable td = new DataTable(); ComboboxItem comboboxItem = new ComboboxItem(); td = luongM.getAllTable(); foreach (DataRow row in td.Rows) { comboboxItem = new ComboboxItem(); comboboxItem.Text = row[1].ToString(); //Gan ten chuc vu comboboxItem.Value = row[0].ToString(); //Gan ma chuc vu cbLuong.Items.Add(comboboxItem); //Add item moi vao trong comboBox } }