private void updateItemDispositionMenuItem_Click(object sender, EventArgs e)
        {
            if ((gridPanel == null) || (gridPanel.Selected_Row == null) || (gridPanel.Selected_Row.Length == 0))
            {
                return;
            }

            Update_Disposition_Form trackingBox = new Update_Disposition_Form();

            if (trackingBox.ShowDialog() == DialogResult.OK)
            {
                Cursor = Cursors.WaitCursor;
                int      updated    = 0;
                int      typeid     = trackingBox.Disposition_Type_ID;
                DateTime date       = trackingBox.Disposition_Date;
                string   notes      = trackingBox.Disposition_Notes;
                string   typeString = SobekCM_Library_Settings.Disposition_Term_Past(typeid);
                if (notes.Trim().Length == 0)
                {
                    notes = SobekCM_Library_Settings.Disposition_Term_Past(typeid);
                }
                foreach (DataRow thisRow in gridPanel.Selected_Row)
                {
                    int itemid = Convert.ToInt32(thisRow["ItemID"]);
                    if (itemid > 0)
                    {
                        if (SobekCM_Database.Update_Disposition(itemid, typeid, notes, date, username))
                        {
                            thisRow["Disposition_Type"] = typeString;
                            thisRow["Disposition_Date"] = date;
                        }
                        updated++;
                    }
                }

                Cursor = Cursors.Default;
                gridPanel.Refresh();
                MessageBox.Show(updated + " records updated.");
            }
        }
        private void show_milestones_worklog()
        {
            // Pull the tracking information
            trackingInfo = SobekCM_Database.Tracking_Get_History_Archives(itemid, null);

            // Pull out the standard tracking milestones
            trackingInfoObj = new Tracking_Info();
            trackingInfoObj.Set_Tracking_Info(trackingInfo);
            if (trackingInfoObj.Digital_Acquisition_Milestone.HasValue)
            {
                acquisitionLabel.Text = trackingInfoObj.Digital_Acquisition_Milestone.Value.ToShortDateString();
            }
            if (trackingInfoObj.Image_Processing_Milestone.HasValue)
            {
                imageProcessingLabel.Text = trackingInfoObj.Image_Processing_Milestone.Value.ToShortDateString();
            }
            if (trackingInfoObj.Quality_Control_Milestone.HasValue)
            {
                qcLabel.Text = trackingInfoObj.Quality_Control_Milestone.Value.ToShortDateString();
            }
            if (trackingInfoObj.Online_Complete_Milestone.HasValue)
            {
                onlineCompleteLabel.Text = trackingInfoObj.Online_Complete_Milestone.Value.ToShortDateString();
            }

            if (trackingInfoObj.Born_Digital)
            {
                if (trackingInfoObj.Material_Received_Date.HasValue)
                {
                    if (trackingInfoObj.Material_Rec_Date_Estimated)
                    {
                        receivedLabel.Text = trackingInfoObj.Material_Received_Date.Value.ToShortDateString() + " (estimated - Born Digital)";
                    }
                    else
                    {
                        receivedLabel.Text = trackingInfoObj.Material_Received_Date.Value.ToShortDateString() + " (Born Digital)";
                    }
                }
                else
                {
                    receivedLabel.Text = "Born Digital";
                }
            }
            else
            {
                if (trackingInfoObj.Material_Received_Date.HasValue)
                {
                    if (trackingInfoObj.Material_Rec_Date_Estimated)
                    {
                        receivedLabel.Text = trackingInfoObj.Material_Received_Date.Value.ToShortDateString() + " (estimated)";
                    }
                    else
                    {
                        receivedLabel.Text = trackingInfoObj.Material_Received_Date.Value.ToShortDateString();
                    }
                }
            }
            if (trackingInfoObj.Disposition_Date.HasValue)
            {
                adviceLinkLabel.Hide();
                adviceLabel.Show();
                dispositionLabel.Show();
                dispositionLinkLabel.Hide();
                string disposition = SobekCM_Library_Settings.Disposition_Term_Past(trackingInfoObj.Disposition_Type).ToUpper();
                if (trackingInfoObj.Disposition_Notes.Trim().Length > 0)
                {
                    dispositionLabel.Text = disposition + " " + trackingInfoObj.Disposition_Date.Value.ToShortDateString() + " - " + trackingInfoObj.Disposition_Notes;
                }
                else
                {
                    dispositionLabel.Text = disposition + " " + trackingInfoObj.Disposition_Date.Value.ToShortDateString();
                }
            }
            else
            {
                adviceLabel.Hide();
                adviceLinkLabel.Show();
                dispositionLabel.Hide();
                dispositionLinkLabel.Show();
            }


            if (trackingInfoObj.Disposition_Advice > 0)
            {
                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;
                }
            }

            if ((!trackingInfoObj.Locally_Archived) && (!trackingInfoObj.Remotely_Archived))
            {
                archivingLabel1.Text = "NOT ARCHIVED";
                archivingLabel2.Text = String.Empty;
            }
            else
            {
                if (trackingInfoObj.Locally_Archived)
                {
                    archivingLabel1.Text = "Locally Stored on CD or Tape";
                    archivingLabel2.Text = trackingInfoObj.Remotely_Archived ? "Archived Remotely (FDA)" : String.Empty;
                }
                else
                {
                    archivingLabel1.Text = "Archived Remotely (FDA)";
                    archivingLabel2.Text = String.Empty;
                }
            }
            if (trackingInfoObj.Tracking_Box.Length > 0)
            {
                trackingBoxLabel.Text = trackingInfoObj.Tracking_Box;
            }


            // Show the history table
            if (historyPanel == null)
            {
                historyPanel = new CustomGrid_Panel
                {
                    Size     = new Size(historyTabPage.Width - 20, historyTabPage.Height - 20),
                    Location = new Point(10, 10)
                };
                historyPanel.Style.Default_Column_Width = 80;
                historyPanel.Style.Default_Column_Color = Color.LightBlue;
                historyPanel.Style.Header_Back_Color    = Color.DarkBlue;
                historyPanel.Style.Header_Fore_Color    = Color.White;
                historyPanel.BackColor   = Color.White;
                historyPanel.BorderStyle = BorderStyle.FixedSingle;
                historyPanel.Anchor      = (((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
                historyTabPage.Controls.Add(historyPanel);
            }

            historyPanel.DataTable = trackingInfo.Tables[1];
            historyPanel.Style.Column_Styles[0].Visible     = false;
            historyPanel.Style.Column_Styles[1].BackColor   = Color.White;
            historyPanel.Style.Column_Styles[1].Width       = 150;
            historyPanel.Style.Column_Styles[2].Width       = 80;
            historyPanel.Style.Column_Styles[2].Header_Text = "Completed";
            historyPanel.Style.Column_Styles[3].Header_Text = "User";
            historyPanel.Style.Column_Styles[3].Width       = 100;
            historyPanel.Style.Column_Styles[4].Header_Text = "Location";
            historyPanel.Style.Column_Styles[5].Width       = 200;
        }