private void updateBornDigitalFlagMenuItem_Click(object sender, EventArgs e) { if ((gridPanel == null) || (gridPanel.Selected_Row == null) || (gridPanel.Selected_Row.Length == 0)) { return; } Update_Born_Digital_Form workflowForm = new Update_Born_Digital_Form(); if (workflowForm.ShowDialog() == DialogResult.OK) { Cursor = Cursors.WaitCursor; int updated = 0; bool newflag = workflowForm.Born_Digital_Flag; foreach (DataRow thisRow in gridPanel.Selected_Row) { int itemid = Convert.ToInt32(thisRow["ItemID"]); if (itemid > 0) { if (SobekCM_Database.Update_Born_Digital_Flag(itemid, newflag)) { thisRow["Born_Digital"] = newflag; } updated++; } } Cursor = Cursors.Default; gridPanel.Refresh(); MessageBox.Show(updated + " records updated."); } }
private void updateBornDigitalFlagMenuItem_Click(object sender, EventArgs e) { if ((gridPanel == null) || (gridPanel.Selected_Row == null) || (gridPanel.Selected_Row.Length == 0)) return; Update_Born_Digital_Form workflowForm = new Update_Born_Digital_Form(); if (workflowForm.ShowDialog() == DialogResult.OK) { Cursor = Cursors.WaitCursor; int updated = 0; bool newflag = workflowForm.Born_Digital_Flag; foreach (DataRow thisRow in gridPanel.Selected_Row) { int itemid = Convert.ToInt32(thisRow["ItemID"]); if (itemid > 0) { if ( SobekCM_Database.Update_Born_Digital_Flag(itemid, newflag)) thisRow["Born_Digital"] = newflag; updated++; } } Cursor = Cursors.Default; gridPanel.Refresh(); MessageBox.Show(updated + " records updated."); } }
private void updateBornDigitalContextMenuItem_Click(object sender, EventArgs e) { if ((gridPanel == null) || (gridPanel.Selected_Row == null) || (gridPanel.Selected_Row.Length == 0)) return; Update_Born_Digital_Form workflowForm = new Update_Born_Digital_Form(); if (workflowForm.ShowDialog() == DialogResult.OK) { Cursor = Cursors.WaitCursor; int updated = 0; int skipped = 0; bool newflag = workflowForm.Born_Digital_Flag; foreach (DataRow thisRow in gridPanel.Selected_Row) { int itemid = Convert.ToInt32(thisRow["ItemID"]); if (itemid > 0) { Resource_Object.Database.SobekCM_Database.Update_Born_Digital_Flag(itemid, newflag); updated++; } else { skipped++; } } Cursor = Cursors.Default; MessageBox.Show(updated + " records updated.\n\n" + skipped + " multi-volume records skipped"); } }