private void btnEdit_Click(object sender, EventArgs e) { if (dgvNguyenLieu.SelectedRows.Count > 0) { if (rowselect == -1 || rowselect >= dsNL.Count) { return; } int vt = 0; for (int i = 0; i < dsNL.Count; i++) { if (dsNL[i].MaNL == (int)(dgvNguyenLieu.Rows[rowselect].Cells[0].Value)) { vt = i; break; } } DataGridViewRow row = dgvNguyenLieu.Rows[vt]; int Ma = int.Parse(row.Cells[0].Value.ToString()); v_NguyenLieu nl = new v_NguyenLieu(); nl = dsNL.Find(x => x.MaNL == Ma); DetailMaterial detail = new DetailMaterial(nl); var result = detail.ShowDialog(); LoadData(); } }
public DetailMaterial(v_NguyenLieu n) { InitializeComponent(); nl = n; BLNguyenLieu blNL = new BLNguyenLieu(); }