private void btnMovePt_Click(object sender, EventArgs e) { string strPIDs = ""; foreach (DataGridViewRow dr in dgvListData.Rows) { if (dr.Cells[0].Value != null && Convert.ToBoolean(dr.Cells[0].Value)) { strPIDs += ",'" + ((DataGridViewCell)dr.Cells["Idx"]).Value.ToString() + "'"; } } strPIDs = strPIDs.TrimStart(','); if (strPIDs == "") { MessageBox.Show("请选择要移动的数据!", "温馨提示:"); return; } this.Cursor = Cursors.WaitCursor; By.frmDataMoveCopy frm = new By.frmDataMoveCopy(int.Parse(strZtID), strPIDs, strDbType, "MOVE"); if (frm.ShowDialog() == DialogResult.OK) { LoadData(true); } this.Cursor = Cursors.Default; }
private void 移动到ToolStripMenuItem_Click_1(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; DataGridViewCell cell = (DataGridViewCell)dgvListData.SelectedRows[0].Cells["Idx"]; string strPID = cell.Value.ToString(); By.frmDataMoveCopy frm = new By.frmDataMoveCopy(int.Parse(strZtID), strPID, strDbType, "MOVE"); if (frm.ShowDialog() == DialogResult.OK) { LoadData(true); } this.Cursor = Cursors.Default; }