private void adviceLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Edit_Disposition_Advice_Form trackingForm = new Edit_Disposition_Advice_Form(trackingInfoObj.Disposition_Advice, trackingInfoObj.Disposition_Advice_Notes); if (trackingForm.ShowDialog() == DialogResult.OK) { int type = trackingForm.Disposition_Type_ID; string notes = trackingForm.Disposition_Notes; if ((type != trackingInfoObj.Disposition_Advice) || (notes.Trim() != trackingInfoObj.Disposition_Advice_Notes.Trim())) { if (Resource_Object.Database.SobekCM_Database.Edit_Disposition_Advice(itemid, type, notes)) { trackingInfoObj.Disposition_Advice = (short)type; trackingInfoObj.Disposition_Advice_Notes = notes; string disposition = SobekCM_Library_Settings.Disposition_Term_Future(trackingInfoObj.Disposition_Advice).ToUpper(); if (trackingInfoObj.Disposition_Advice_Notes.Trim().Length > 0) { adviceLinkLabel.Text = disposition + " - " + trackingInfoObj.Disposition_Advice_Notes; adviceLabel.Text = disposition + " - " + trackingInfoObj.Disposition_Advice_Notes; } else { adviceLinkLabel.Text = disposition; adviceLabel.Text = disposition; } } else { MessageBox.Show("Error encountered while saving disposition advice! ", "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void editDispositionAdviceMenuItem_Click(object sender, EventArgs e) { if ((gridPanel == null) || (gridPanel.Selected_Row == null) || (gridPanel.Selected_Row.Length == 0)) { return; } Edit_Disposition_Advice_Form trackingBox = new Edit_Disposition_Advice_Form(); if (trackingBox.ShowDialog() == DialogResult.OK) { Cursor = Cursors.WaitCursor; int updated = 0; int typeid = trackingBox.Disposition_Type_ID; string notes = trackingBox.Disposition_Notes; string typeString = SobekCM_Library_Settings.Disposition_Term_Future(typeid); foreach (DataRow thisRow in gridPanel.Selected_Row) { int itemid = Convert.ToInt32(thisRow["ItemID"]); if (itemid > 0) { if (thisRow["Disposition_Date"] == DBNull.Value) { if (SobekCM_Database.Edit_Disposition_Advice(itemid, typeid, notes)) { thisRow["Disposition_Advice"] = typeString; //thisRow["Disposition_Advice_Notes"] = notes; } updated++; } } } Cursor = Cursors.Default; gridPanel.Refresh(); MessageBox.Show(updated + " records updated."); } }
private void editDispositionAdviceMenuItem_Click(object sender, EventArgs e) { if ((gridPanel == null) || (gridPanel.Selected_Row == null) || (gridPanel.Selected_Row.Length == 0)) return; Edit_Disposition_Advice_Form trackingBox = new Edit_Disposition_Advice_Form(); if (trackingBox.ShowDialog() == DialogResult.OK) { Cursor = Cursors.WaitCursor; int updated = 0; int typeid = trackingBox.Disposition_Type_ID; string notes = trackingBox.Disposition_Notes; string typeString = SobekCM_Library_Settings.Disposition_Term_Future(typeid); foreach (DataRow thisRow in gridPanel.Selected_Row) { int itemid = Convert.ToInt32(thisRow["ItemID"]); if (itemid > 0) { if (thisRow["Disposition_Date"] == DBNull.Value) { if (SobekCM_Database.Edit_Disposition_Advice(itemid, typeid, notes)) { thisRow["Disposition_Advice"] = typeString; //thisRow["Disposition_Advice_Notes"] = notes; } updated++; } } } Cursor = Cursors.Default; gridPanel.Refresh(); MessageBox.Show(updated + " records updated."); } }
private void editDispositionAdviceMenuItem_Click(object sender, EventArgs e) { if ((gridPanel == null) || (gridPanel.Selected_Row == null) || (gridPanel.Selected_Row.Length == 0)) return; Edit_Disposition_Advice_Form trackingBox = new Edit_Disposition_Advice_Form(); if (trackingBox.ShowDialog() == DialogResult.OK) { Cursor = Cursors.WaitCursor; int updated = 0; int skipped = 0; int typeid = trackingBox.Disposition_Type_ID; string notes = trackingBox.Disposition_Notes; foreach (DataRow thisRow in gridPanel.Selected_Row) { int itemid = Convert.ToInt32(thisRow["ItemID"]); if (itemid > 0) { // Verify this wasn't already disposed off, in which case no point in allowing this edit DataRow[] selectedRow = completeSet.Tables[0].Select("ItemID=" + itemid); if (selectedRow.Length > 0) { if (selectedRow[0]["Disposition_Date"] == DBNull.Value) { SobekCM_Database.Edit_Disposition_Advice(itemid, typeid, notes); updated++; } } } else { skipped++; } } Cursor = Cursors.Default; MessageBox.Show(updated + " records updated.\n\n" + skipped + " multi-volume records skipped"); } }
private void adviceLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Edit_Disposition_Advice_Form trackingForm = new Edit_Disposition_Advice_Form(trackingInfoObj.Disposition_Advice, trackingInfoObj.Disposition_Advice_Notes); if (trackingForm.ShowDialog() == DialogResult.OK) { int type = trackingForm.Disposition_Type_ID; string notes = trackingForm.Disposition_Notes; if ((type != trackingInfoObj.Disposition_Advice) || (notes.Trim() != trackingInfoObj.Disposition_Advice_Notes.Trim())) { if (Resource_Object.Database.SobekCM_Database.Edit_Disposition_Advice(itemid, type, notes)) { trackingInfoObj.Disposition_Advice = (short)type; trackingInfoObj.Disposition_Advice_Notes = notes; string disposition = SobekCM_Library_Settings.Disposition_Term_Future(trackingInfoObj.Disposition_Advice).ToUpper(); if (trackingInfoObj.Disposition_Advice_Notes.Trim().Length > 0) { adviceLinkLabel.Text = disposition + " - " + trackingInfoObj.Disposition_Advice_Notes; adviceLabel.Text = disposition + " - " + trackingInfoObj.Disposition_Advice_Notes; } else { adviceLinkLabel.Text = disposition; adviceLabel.Text = disposition; } } else { MessageBox.Show("Error encountered while saving disposition advice! ", "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void editDispositionAdviceContextMenuItem_Click(object sender, EventArgs e) { if ((gridPanel == null) || (gridPanel.Selected_Row == null) || (gridPanel.Selected_Row.Length == 0)) return; Edit_Disposition_Advice_Form trackingBox = new Edit_Disposition_Advice_Form(); if (trackingBox.ShowDialog() == DialogResult.OK) { Cursor = Cursors.WaitCursor; int updated = 0; int typeid = trackingBox.Disposition_Type_ID; string notes = trackingBox.Disposition_Notes; foreach (DataRow thisRow in gridPanel.Selected_Row) { int itemid = Convert.ToInt32(thisRow["ItemID"]); if (itemid > 0) { if (thisRow["Disposition_Date"] == DBNull.Value) { Resource_Object.Database.SobekCM_Database.Edit_Disposition_Advice(itemid, typeid, notes); updated++; } } } Cursor = Cursors.Default; MessageBox.Show(updated + " records updated."); } }