private void cmdNew_Click(object sender, EventArgs e) { curIndex = grdViewMedicine.RowCount; frmMedicineDetail.intMedPK = 0; frmMedicineDetail fMedicineDetail = new frmMedicineDetail(); fMedicineDetail.ShowDialog(); BindingMedicine(); if (grdViewMedicine.RowCount > 0) { drMedicine = grdViewMedicine.GetDataRow(grdViewMedicine.FocusedRowHandle); } }
private void grdViewPatient_DoubleClick(object sender, EventArgs e) { curIndex = grdViewMedicine.GetDataSourceRowIndex(grdViewMedicine.FocusedRowHandle); frmMedicineDetail fMedicineDetail = new frmMedicineDetail(); frmMedicineDetail.intMedPK = int.Parse(drMedicine.ItemArray[0].ToString()); fMedicineDetail.ShowDialog(); BindingMedicine(); if (grdViewMedicine.RowCount > 0) { drMedicine = grdViewMedicine.GetDataRow(grdViewMedicine.FocusedRowHandle); } }
private void cmdEdit_Click(object sender, EventArgs e) { if (grdViewMedicine.RowCount>0) { curIndex = grdViewMedicine.GetDataSourceRowIndex(grdViewMedicine.FocusedRowHandle); frmMedicineDetail fMedicineDetail = new frmMedicineDetail(); frmMedicineDetail.intMedPK = int.Parse(drMedicine.ItemArray[0].ToString()); fMedicineDetail.ShowDialog(); BindingMedicine(); if (grdViewMedicine.RowCount > 0) { drMedicine = grdViewMedicine.GetDataRow(grdViewMedicine.FocusedRowHandle); } } }