private void DeleteAutoPackageDrugInfo() { foreach (DataGridViewRow selRow in dgvDrug.SelectedRows) { int id = Convert.ToInt32(Judgement.JudgeDBNullValue(selRow.Cells[DBConstDef.OPDD_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER)); DbMaintainment operDb = new DbMaintainment(); operDb.DeleteAutoPackageDrugInfo(id); DataRow[] selRows = ((DataTable)dgvDrug.DataSource).Select(string.Format("{0}={1}", DBConstDef.OPDD_ID, id)); if (selRows.Length > 0) { ((DataTable)dgvDrug.DataSource).Rows.Remove(selRows[0]); } } }
private void DeleteAutoPackageDrugInfo() { foreach (DataGridViewRow selRow in dgvDrug.SelectedRows) { int id = Convert.ToInt32(Judgement.JudgeDBNullValue(selRow.Cells[DBConstDef.OPDD_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER)); DbMaintainment operDb = new DbMaintainment(); operDb.DeleteAutoPackageDrugInfo(id); DataRow[] selRows = ((DataTable)dgvDrug.DataSource).Select(string.Format("{0}={1}", DBConstDef.OPDD_ID, id)); if (selRows.Length > 0) ((DataTable)dgvDrug.DataSource).Rows.Remove(selRows[0]); } }