private void btnDeleteRecord_Click(object sender, RoutedEventArgs e) { string[] aryRecs; int max, idx, setidx; int id; if (checkCancelModify() == true) { return; } m_libOdbc.deleteHanbai(m_nCrtId); aryRecs = m_sRecsCsv.Split(','); max = aryRecs.Length; m_sRecsCsv = ""; setidx = 0; for (idx = 0; idx < max; idx++) { id = m_libCmn.StrToInt(aryRecs[idx]); if (m_nCrtId != id) { if (setidx == 0) { m_sRecsCsv = m_sRecsCsv + aryRecs[idx]; } else { m_sRecsCsv = m_sRecsCsv + "," + aryRecs[idx]; } } } if (m_nNextId != -1) { m_nCrtId = m_nNextId; } else if (m_nPrevId != -1) { m_nCrtId = m_nPrevId; } else { m_sMsg = "操作可能なレコードがないため終了します"; System.Diagnostics.Trace.WriteLine(m_sMsg); this.Close(); } setElementText(); setPrevNextButton(); }