private void btnThuocThayThe_Click(object sender, EventArgs e) { if (cboThuoc.SelectedValue == null || cboThuoc.Text == string.Empty) { return; } string thuocGUID = cboThuoc.SelectedValue.ToString(); dlgThuocThayThe dlg = new dlgThuocThayThe(thuocGUID); if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { cboThuoc.SelectedValue = dlg.ThuocThayThe; } }
private void thuocThayTheToolStripMenuItem_Click(object sender, EventArgs e) { DataRow row = gridViewPTT.GetFocusedDataRow(); if (row == null || row["ThuocGUID"] == null || row["ThuocGUID"] == DBNull.Value) { return; } string thuocGUID = row["ThuocGUID"].ToString(); dlgThuocThayThe dlg = new dlgThuocThayThe(thuocGUID); if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { row["ThuocGUID"] = dlg.ThuocThayThe; UpdateThongTinThuoc(row); gridViewPTT.UpdateCurrentRow(); } }