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