private void btnThem_Click(object sender, EventArgs e) { FormThemLoaiSP them = new FormThemLoaiSP(); them.ShowDialog(); if (them.DialogResult == DialogResult.Cancel) { load(); } }
private void btnAddLoaiSP_Click(object sender, EventArgs e) { FormThemLoaiSP them = new FormThemLoaiSP(); them.ShowDialog(); if (them.DialogResult == DialogResult.Cancel) { cbbLoaiSP.DataSource = lo.LayLoaiSP(); cbbLoaiSP.DisplayMember = "TenLoaiSP"; cbbLoaiSP.ValueMember = "MaLoaiSP"; } }
private void btnSua_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow == null) { MessageBox.Show("Bạn phải chọn một dòng để sửa"); return; } int malsp = Int16.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString()); FormThemLoaiSP them = new FormThemLoaiSP(malsp); them.ShowDialog(); if (them.DialogResult == DialogResult.Cancel) { load(); } }