コード例 #1
0
        private void OnEditThuoc()
        {
            if (_dictThuoc == null)
            {
                return;
            }
            if (dgThuoc.SelectedRows == null || dgThuoc.SelectedRows.Count <= 0)
            {
                MsgBox.Show(Application.ProductName, "Vui lòng chọn 1 thuốc.", IconType.Information);
                return;
            }

            DataRow drThuoc = (dgThuoc.SelectedRows[0].DataBoundItem as DataRowView).Row;

            if (drThuoc == null)
            {
                return;
            }
            dlgAddThuoc dlg = new dlgAddThuoc(drThuoc, AllowEdit);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                SearchAsThread();
            }
        }
コード例 #2
0
        private void OnAddThuoc()
        {
            dlgAddThuoc dlg = new dlgAddThuoc();

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                SearchAsThread();
            }
        }