/// <summary> Constructor for a DataGridPrinter object which will be used to
        /// print a DataGrid to a printer.  </summary>
        /// <param name="aGrid"> DataGrid whose <see cref="DataGridTableStyle"/> will be used to
        /// determine the appearance of the printed page.  </param>
        /// <param name="aPrintDocument"> Print document to use while formatting the appearance
        /// of the information on the page </param>
        public CustomGrid_Printer(CustomGrid_Panel aGrid, PrintDocument aPrintDocument)
        {
            // Save the parameters
            TheGrid          = aGrid;
            ThePrintDocument = aPrintDocument;

            // Save the default page settings from the print document
////			PageWidth = ThePrintDocument.DefaultPageSettings.PaperSize.Width;
////			PageHeight = ThePrintDocument.DefaultPageSettings.PaperSize.Height;
////			TopMargin = ThePrintDocument.DefaultPageSettings.Margins.Top;
////			BottomMargin = ThePrintDocument.DefaultPageSettings.Margins.Bottom;
        }
        /// <summary> Constructor for a new instance of the Groups_Needed_Serial_Hierarchy_Form class </summary>
        public Groups_Needed_Serial_Hierarchy_Form()
        {
            InitializeComponent();
            BackColor = Color.FromArgb(240, 240, 240);

            DataTable sourceTable = SobekCM_Database.Newspapers_Without_Serial_Info;

            iconPanel        = new CustomGrid_Panel();
            iconPanel.Anchor = (((((AnchorStyles.Top | AnchorStyles.Bottom)
                                   | AnchorStyles.Left)
                                  | AnchorStyles.Right)));
            iconPanel.BorderStyle     = BorderStyle.FixedSingle;
            iconPanel.DataTable       = null;
            iconPanel.Location        = new Point(16, 16);
            iconPanel.Name            = "itemGridPanel";
            iconPanel.Size            = new Size(mainPanel.Width - 32, mainPanel.Height - 32);
            iconPanel.TabIndex        = 0;
            iconPanel.Double_Clicked += iconPanel_Double_Clicked;

            mainPanel.Controls.Add(iconPanel);


            // Configure some table level style settings
            iconPanel.Style.Default_Column_Width = 85;
            iconPanel.Style.Default_Column_Color = Color.LightBlue;
            iconPanel.Style.Header_Back_Color    = Color.SteelBlue;
            iconPanel.Style.Header_Fore_Color    = Color.White;

            // Use the table from the database as the data source
            iconPanel.DataTable = sourceTable;

            //// Configure some individual columns
            iconPanel.Style.Column_Styles[1].Header_Text = "Group Title";
            iconPanel.Style.Column_Styles[1].BackColor   = Color.White;
            iconPanel.Style.Column_Styles[1].Width       = 450;
        }
        /// <summary> Constructor for a new instance of the Ad_Hoc_Report_Display_Form form </summary>
        /// <param name="Display_Set">Set of titles/items to display within this form</param>
        public Ad_Hoc_Report_Display_Form(DataSet Display_Set)
        {
            InitializeComponent();
            BackColor = Color.FromArgb(240, 240, 240);

            displaySet = Display_Set;

            // Check for values at each hierarchical level and author and publisher
            bool hasLevel1Data    = false;
            bool hasLevel2Data    = false;
            bool hasLevel3Data    = false;
            bool hasAuthorData    = false;
            bool hasPublisherData = false;
            bool hasDateData      = false;

            // Move the date column to the right spot
            Display_Set.Tables[0].Columns["PubDate"].SetOrdinal(8);


            // Get the columns
            DataColumn level1Column    = displaySet.Tables[0].Columns["Level1_Text"];
            DataColumn level2Column    = displaySet.Tables[0].Columns["Level2_Text"];
            DataColumn level3Column    = displaySet.Tables[0].Columns["Level3_Text"];
            DataColumn publisherColumn = displaySet.Tables[0].Columns["Publisher"];
            DataColumn authorColumn    = displaySet.Tables[0].Columns["Author"];
            DataColumn dateColumn      = displaySet.Tables[0].Columns["PubDate"];

            // Step through each row and check for data existence
            foreach (DataRow thisRow in Display_Set.Tables[0].Rows)
            {
                if ((hasLevel1Data) && (hasLevel2Data) && (hasLevel3Data) && (hasPublisherData) && (hasAuthorData) && (hasDateData))
                {
                    break;
                }
                if ((!hasLevel1Data) && (thisRow[level1Column].ToString().Length > 0))
                {
                    hasLevel1Data = true;
                }
                if ((!hasLevel2Data) && (thisRow[level2Column].ToString().Length > 0))
                {
                    hasLevel2Data = true;
                }
                if ((!hasLevel3Data) && (thisRow[level3Column].ToString().Length > 0))
                {
                    hasLevel3Data = true;
                }
                if ((!hasPublisherData) && (thisRow[publisherColumn].ToString().Length > 0))
                {
                    hasPublisherData = true;
                }
                if ((!hasAuthorData) && (thisRow[authorColumn].ToString().Length > 0))
                {
                    hasAuthorData = true;
                }
                if ((!hasDateData) && (thisRow[dateColumn].ToString().Length > 0))
                {
                    hasDateData = true;
                }
            }

            // Create the custom grid
            gridPanel = new CustomGrid_Panel
            {
                Size = new Size(panel1.Width - 2, panel1.Height - 2), Location = new Point(0, 0)
            };

            // Configure some table level style settings
            gridPanel.Style.Default_Column_Width = 80;
            gridPanel.Style.Default_Column_Color = Color.LightBlue;
            gridPanel.Style.Header_Back_Color    = Color.DarkBlue;
            gridPanel.Style.Header_Fore_Color    = Color.White;

            // Set the background and border style
            gridPanel.BackColor   = Color.WhiteSmoke;
            gridPanel.BorderStyle = BorderStyle.FixedSingle;
            gridPanel.Anchor      = (((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
            panel1.Controls.Add(gridPanel);

            gridPanel.DataTable = displaySet.Tables[0];

            gridPanel.Current_Sort_String = "BibID ASC, VID ASC";

            // Configure for this table
            gridPanel.Style.Column_Styles[1].Width     = 50;
            gridPanel.Style.Column_Styles[2].Visible   = false;
            gridPanel.Style.Column_Styles[3].Visible   = false;
            gridPanel.Style.Column_Styles[4].Visible   = false;
            gridPanel.Style.Column_Styles[5].Width     = SMaRT_UserSettings.Ad_Hoc_Report_Form_Title_Width;
            gridPanel.Style.Column_Styles[5].BackColor = Color.White;
            gridPanel.Style.Column_Styles[6].BackColor = Color.White;

            if (!hasAuthorData)
            {
                gridPanel.Style.Column_Styles[6].Width = SMaRT_UserSettings.Ad_Hoc_Report_Form_Author_Width;
            }
            else
            {
                gridPanel.Style.Column_Styles[6].Visible = false;
            }

            gridPanel.Style.Column_Styles[7].BackColor = Color.White;
            if (hasPublisherData)
            {
                gridPanel.Style.Column_Styles[7].Width = SMaRT_UserSettings.Ad_Hoc_Report_Form_Publisher_Width;
            }
            else
            {
                gridPanel.Style.Column_Styles[7].Visible = false;
            }

            gridPanel.Style.Column_Styles[8].BackColor = Color.White;
            if (hasDateData)
            {
                gridPanel.Style.Column_Styles[8].Width = SMaRT_UserSettings.Ad_Hoc_Report_Form_Date_Width;
            }
            else
            {
                gridPanel.Style.Column_Styles[8].Visible = false;
            }

            if (hasLevel1Data)
            {
                gridPanel.Style.Column_Styles[9].Width = SMaRT_UserSettings.Ad_Hoc_Report_Form_Level1_Width;
            }
            else
            {
                gridPanel.Style.Column_Styles[9].Visible = false;
            }

            gridPanel.Style.Column_Styles[9].Text_Alignment = HorizontalAlignment.Left;
            gridPanel.Style.Column_Styles[10].Visible       = false;
            if (hasLevel2Data)
            {
                gridPanel.Style.Column_Styles[11].Width = SMaRT_UserSettings.Ad_Hoc_Report_Form_Level2_Width;
            }
            else
            {
                gridPanel.Style.Column_Styles[11].Visible = false;
            }
            gridPanel.Style.Column_Styles[11].Text_Alignment = HorizontalAlignment.Left;
            gridPanel.Style.Column_Styles[12].Visible        = false;
            if (hasLevel3Data)
            {
                gridPanel.Style.Column_Styles[13].Width = SMaRT_UserSettings.Ad_Hoc_Report_Form_Level3_Width;
            }
            else
            {
                gridPanel.Style.Column_Styles[13].Visible = false;
            }
            gridPanel.Style.Column_Styles[13].Text_Alignment = HorizontalAlignment.Left;
            gridPanel.Style.Column_Styles[14].Visible        = false;
            gridPanel.Style.Column_Styles[15].Visible        = false;
            gridPanel.Style.Column_Styles[16].Visible        = false;
            gridPanel.Style.Column_Styles[17].Visible        = false;
            gridPanel.Style.Column_Styles[18].Visible        = false;

            gridPanel.Style.Column_Styles[20].Visible           = false;
            gridPanel.Style.Column_Styles[21].Header_Text       = "Comments";
            gridPanel.Style.Column_Styles[24].Header_Text       = "Digitized";
            gridPanel.Style.Column_Styles[24].Short_Date_Format = true;
            gridPanel.Style.Column_Styles[25].Header_Text       = "Processed";
            gridPanel.Style.Column_Styles[25].Short_Date_Format = true;
            gridPanel.Style.Column_Styles[26].Header_Text       = "QC'd";
            gridPanel.Style.Column_Styles[26].Short_Date_Format = true;
            gridPanel.Style.Column_Styles[27].Header_Text       = "Online";
            gridPanel.Style.Column_Styles[27].Short_Date_Format = true;
            gridPanel.Style.Column_Styles[38].Visible           = false;

            // Set some sort values
            gridPanel.Style.Column_Styles[9].Ascending_Sort   = "Level1_Index ASC, Level2_Index ASC, Level3_Index ASC";
            gridPanel.Style.Column_Styles[9].Descending_Sort  = "Level1_Index DESC, Level2_Index DESC, Level3_Index DESC";
            gridPanel.Style.Column_Styles[11].Ascending_Sort  = "Level2_Index ASC, Level3_Index ASC";
            gridPanel.Style.Column_Styles[11].Descending_Sort = "Level2_Index DESC, Level3_Index DESC";
            gridPanel.Style.Column_Styles[5].Ascending_Sort   = "SortTitle ASC, Level1_Index ASC, Level2_Index ASC, Level3_Index ASC";
            gridPanel.Style.Column_Styles[5].Descending_Sort  = "SortTitle DESC, Level1_Index DESC, Level2_Index DESC, Level3_Index DESC";
            gridPanel.Style.Column_Styles[8].Ascending_Sort   = "SortDate ASC, SortTitle ASC, Level1_Index ASC, Level2_Index ASC, Level3_Index ASC";
            gridPanel.Style.Column_Styles[8].Descending_Sort  = "SortDate DESC, SortTitle DESC, Level1_Index DESC, Level2_Index DESC, Level3_Index DESC";


            gridPanel.Double_Clicked           += gridPanel_Double_Clicked;
            gridPanel.Clipboard_Copy_Requested += new CustomGrid_Panel_Delegate_Multiple(gridPanel_Clipboard_Copy_Requested);

            // Add the context menu
            gridPanel.Set_Context_Menus(null, contextMenu1);

            // Add the object to print
            gridPrinter = new CustomGrid_Printer(gridPanel, printDocument1);

            // Set the hits value
            hitCountLabel.Text = "Your search resulted in " + number_to_string(displaySet.Tables[0].Rows.Count) + " items in " + number_to_string(displaySet.Tables[1].Rows.Count) + " titles";


            // Set the size correctly
            Size = SMaRT_UserSettings.Ad_Hoc_Report_Form_Size;
            int screen_width  = Screen.PrimaryScreen.WorkingArea.Width;
            int screen_height = Screen.PrimaryScreen.WorkingArea.Height;

            if ((Width > screen_width) || (Height > screen_height) || (SMaRT_UserSettings.Ad_Hoc_Report_Form_Maximized))
            {
                WindowState = FormWindowState.Maximized;
            }

            // GEt the username
            username = Environment.UserName;

            // Set the action on click
            if (SMaRT_UserSettings.Ad_Hoc_Form_Action_On_Click == View_Items_Form_Action_On_Click_Enum.Open_On_Web)
            {
                openItemFromWebMenuItem.Checked = true;
                viewItemFormMenuItem.Checked    = false;
            }
            else
            {
                openItemFromWebMenuItem.Checked = false;
                viewItemFormMenuItem.Checked    = true;
            }
        }
        /// <summary> Constructor for a new instance of the View_Item_Form form </summary>
        /// <param name="ItemID"> Primary key for this item in the SobekCM database </param>
        /// <param name="BibID"> Bibliographic identifier for the title related to this item </param>
        /// <param name="VID"> Volume identifier for this item within the title </param>
        public View_Item_Form(int ItemID, string BibID, string VID)
        {
            InitializeComponent();
            BackColor = Color.FromArgb(240, 240, 240);

            bibid  = BibID;
            vid    = VID;
            itemid = ItemID;

            mainLinkLabel.Text = BibID + ":" + VID;

            show_milestones_worklog();

            // Show the media table
            if (trackingInfo.Tables[0].Rows.Count > 0)
            {
                mediaPanel = new CustomGrid_Panel
                {
                    Size     = new Size(mediaTabPage.Width - 20, mediaTabPage.Height - 20),
                    Location = new Point(10, 10)
                };
                mediaPanel.Style.Default_Column_Width = 80;
                mediaPanel.Style.Default_Column_Color = Color.LightBlue;
                mediaPanel.Style.Header_Back_Color    = Color.DarkBlue;
                mediaPanel.Style.Header_Fore_Color    = Color.White;
                mediaPanel.BackColor   = Color.White;
                mediaPanel.BorderStyle = BorderStyle.FixedSingle;
                mediaPanel.Anchor      = (((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
                mediaTabPage.Controls.Add(mediaPanel);
                mediaPanel.DataTable = trackingInfo.Tables[0];
                mediaPanel.Style.Column_Styles[1].Width     = 400;
                mediaPanel.Style.Column_Styles[1].BackColor = Color.White;
                mediaPanel.Style.Column_Styles[2].Width     = 70;
                mediaPanel.Style.Column_Styles[3].Width     = 70;
                mediaPanel.Style.Column_Styles[4].Width     = 90;
            }
            else
            {
                tabControl1.TabPages.Remove(mediaTabPage);
            }

            // Show the archives table
            if (trackingInfo.Tables[2].Rows.Count > 0)
            {
                archivePanel = new CustomGrid_Panel
                {
                    Size     = new Size(archiveTabPage.Width - 20, archiveTabPage.Height - 20),
                    Location = new Point(10, 10)
                };
                archivePanel.Style.Default_Column_Width = 80;
                archivePanel.Style.Default_Column_Color = Color.LightBlue;
                archivePanel.Style.Header_Back_Color    = Color.DarkBlue;
                archivePanel.Style.Header_Fore_Color    = Color.White;
                archivePanel.BackColor   = Color.White;
                archivePanel.BorderStyle = BorderStyle.FixedSingle;
                archivePanel.Anchor      = (((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
                archiveTabPage.Controls.Add(archivePanel);
                archivePanel.DataTable = trackingInfo.Tables[2];
                archivePanel.Style.Column_Styles[0].Visible     = false;
                archivePanel.Style.Column_Styles[1].Visible     = false;
                archivePanel.Style.Column_Styles[2].Visible     = false;
                archivePanel.Style.Column_Styles[3].Width       = 300;
                archivePanel.Style.Column_Styles[3].BackColor   = Color.White;
                archivePanel.Style.Column_Styles[5].Width       = 140;
                archivePanel.Style.Column_Styles[5].Header_Text = "Last Modified";
                archivePanel.Style.Column_Styles[6].Width       = 140;
                archivePanel.Style.Column_Styles[6].Header_Text = "Date Archived";
            }
            else
            {
                tabControl1.TabPages.Remove(archiveTabPage);
                archiveRetrieveButton.Button_Enabled = false;
            }

            // Show the aggregation membership
            if ((trackingInfo.Tables.Count > 4) && (trackingInfo.Tables[4].Rows.Count > 0))
            {
                aggrPanel = new CustomGrid_Panel
                {
                    Size     = new Size(aggregationsTabPage.Width - 20, aggregationsTabPage.Height - 20),
                    Location = new Point(10, 10)
                };
                aggrPanel.Style.Default_Column_Width = 80;
                aggrPanel.Style.Default_Column_Color = Color.LightBlue;
                aggrPanel.Style.Header_Back_Color    = Color.DarkBlue;
                aggrPanel.Style.Header_Fore_Color    = Color.White;
                aggrPanel.BackColor   = Color.White;
                aggrPanel.BorderStyle = BorderStyle.FixedSingle;
                aggrPanel.Anchor      = (((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right)));
                aggregationsTabPage.Controls.Add(aggrPanel);
                aggrPanel.DataTable = trackingInfo.Tables[4];
                aggrPanel.Style.Column_Styles[0].Width       = 100;
                aggrPanel.Style.Column_Styles[1].Width       = 200;
                aggrPanel.Style.Column_Styles[1].BackColor   = Color.White;
                aggrPanel.Style.Column_Styles[2].Width       = 200;
                aggrPanel.Style.Column_Styles[2].BackColor   = Color.White;
                aggrPanel.Style.Column_Styles[2].Header_Text = "Short Name";
                aggrPanel.Style.Column_Styles[3].Width       = 100;
                aggrPanel.Style.Column_Styles[4].Width       = 65;
                aggrPanel.Style.Column_Styles[4].Header_Text = "Implied?";
                aggrPanel.Style.Column_Styles[5].Width       = 60;
                aggrPanel.Style.Column_Styles[5].Header_Text = "Hidden?";
                aggrPanel.Style.Column_Styles[6].Width       = 60;
                aggrPanel.Style.Column_Styles[6].Header_Text = "Active?";
            }
            else
            {
                tabControl1.TabPages.Remove(aggregationsTabPage);
            }

            // Pull the IP restriction, dark info, etc..
            DataRow volumeInfo = trackingInfo.Tables[3].Rows[0];

            titleLabel.Text = volumeInfo["Title"].ToString();

            authorLabel.Text = volumeInfo["Author"].ToString();
            if (authorLabel.Text.Length == 0)
            {
                authorLabel.Text      = "( none )";
                authorLabel.ForeColor = Color.Gray;
            }
            publisherLabel.Text = volumeInfo["Publisher"].ToString();
            if (publisherLabel.Text.Length == 0)
            {
                publisherLabel.Text      = "( none )";
                publisherLabel.ForeColor = Color.Gray;
            }

            dateLabel.Text = volumeInfo["PubDate"].ToString();
            if (dateLabel.Text.Length == 0)
            {
                dateLabel.Text      = "( none )";
                dateLabel.ForeColor = Color.Gray;
            }

            level1Label.Text = volumeInfo["Level1_Text"].ToString();
            if (level1Label.Text.Length == 0)
            {
                level1Label.Text      = "( none )";
                level1Label.ForeColor = Color.Gray;
            }

            level2Label.Text = volumeInfo["Level2_Text"].ToString();
            if (level2Label.Text.Length == 0)
            {
                level2Label.Text      = "( none )";
                level2Label.ForeColor = Color.Gray;
            }

            level3Label.Text = volumeInfo["Level3_Text"].ToString();
            if (level3Label.Text.Length == 0)
            {
                level3Label.Text      = "( none )";
                level3Label.ForeColor = Color.Gray;
            }

            // Set the restriction info
            int  restriction = Convert.ToInt16(volumeInfo["IP_Restriction_Mask"]);
            bool dark        = Convert.ToBoolean(volumeInfo["Dark"]);

            // Add the directory
            directoryLinkLabel.Text = SobekCM_Library_Settings.Image_Server_Network + bibid.Substring(0, 2) + "\\" + bibid.Substring(2, 2) + "\\" + bibid.Substring(4, 2) + "\\" + bibid.Substring(6, 2) + "\\" + bibid.Substring(8, 2) + "\\" + vid;

            if (dark)
            {
                visibilityPictureBox.Image = imageList1.Images[3];
            }
            else
            {
                if (restriction < 0)
                {
                    visibilityPictureBox.Image = imageList1.Images[0];
                }
                else
                {
                    visibilityPictureBox.Image = restriction == 0 ? imageList1.Images[2] : imageList1.Images[1];
                }
            }

            // Set the form size correctly
            Size = SMaRT_UserSettings.View_Item_Form_Size;
            int screen_width  = Screen.PrimaryScreen.WorkingArea.Width;
            int screen_height = Screen.PrimaryScreen.WorkingArea.Height;

            if ((Width > screen_width) || (Height > screen_height) || (SMaRT_UserSettings.View_Item_Form_Maximized))
            {
                WindowState = FormWindowState.Maximized;
            }

            if (!Windows_Appearance_Checker.is_XP_Theme)
            {
                titleLabel.BackColor     = SystemColors.Control;
                authorLabel.BackColor    = SystemColors.Control;
                publisherLabel.BackColor = SystemColors.Control;
                dateLabel.BackColor      = SystemColors.Control;
                level1Label.BackColor    = SystemColors.Control;
                level2Label.BackColor    = SystemColors.Control;
                level3Label.BackColor    = SystemColors.Control;
            }
        }
        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;
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Results_Form));
     this.mainMenu1       = new System.Windows.Forms.MainMenu(this.components);
     this.menuItem1       = new System.Windows.Forms.MenuItem();
     this.setupMenuItem   = new System.Windows.Forms.MenuItem();
     this.previewMenuItem = new System.Windows.Forms.MenuItem();
     this.printMenuItem   = new System.Windows.Forms.MenuItem();
     this.menuItem5       = new System.Windows.Forms.MenuItem();
     this.saveMenuItem    = new System.Windows.Forms.MenuItem();
     this.exitMenuItem    = new System.Windows.Forms.MenuItem();
     this.actionMenuItem  = new System.Windows.Forms.MenuItem();
     this.detailsMenuItem = new System.Windows.Forms.MenuItem();
     this.helpMenuItem    = new System.Windows.Forms.MenuItem();
     this.aboutMenuItem   = new System.Windows.Forms.MenuItem();
     this.detailsMenuItem_ContextMenuItem  = new System.Windows.Forms.MenuItem();
     this.commentsMenuItem_ContextMenuItem = new System.Windows.Forms.MenuItem();
     this.actionMI_ShowDetails             = new System.Windows.Forms.MenuItem();
     this.contextMenu1        = new System.Windows.Forms.ContextMenu();
     this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
     this.printDocument1      = new System.Drawing.Printing.PrintDocument();
     this.printDialog1        = new System.Windows.Forms.PrintDialog();
     this.pageSetupDialog1    = new System.Windows.Forms.PageSetupDialog();
     this.imageList1          = new System.Windows.Forms.ImageList(this.components);
     this.customGrid_Panel1   = new CustomGrid_Panel();
     this.closeButton         = new System.Windows.Forms.Button();
     this.saveFileDialog1     = new System.Windows.Forms.SaveFileDialog();
     this.printButton         = new System.Windows.Forms.Button();
     this.saveButton          = new System.Windows.Forms.Button();
     this.SuspendLayout();
     //
     // mainMenu1
     //
     this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem1,
         this.actionMenuItem,
         this.helpMenuItem
     });
     //
     // menuItem1
     //
     this.menuItem1.Index = 0;
     this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.setupMenuItem,
         this.previewMenuItem,
         this.printMenuItem,
         this.menuItem5,
         this.saveMenuItem,
         this.exitMenuItem
     });
     this.menuItem1.Text = "File";
     //
     // setupMenuItem
     //
     this.setupMenuItem.Index     = 0;
     this.setupMenuItem.OwnerDraw = true;
     this.setupMenuItem.Text      = "Page Setup";
     this.setupMenuItem.Click    += new System.EventHandler(this.setupMenuItem_Click);
     //
     // previewMenuItem
     //
     this.previewMenuItem.Index     = 1;
     this.previewMenuItem.OwnerDraw = true;
     this.previewMenuItem.Text      = "Print Preview";
     this.previewMenuItem.Click    += new System.EventHandler(this.previewMenuItem_Click);
     //
     // printMenuItem
     //
     this.printMenuItem.Index     = 2;
     this.printMenuItem.OwnerDraw = true;
     this.printMenuItem.Shortcut  = System.Windows.Forms.Shortcut.CtrlP;
     this.printMenuItem.Text      = "Print";
     this.printMenuItem.Click    += new System.EventHandler(this.printMenuItem_Click);
     //
     // menuItem5
     //
     this.menuItem5.Index     = 3;
     this.menuItem5.OwnerDraw = true;
     this.menuItem5.Text      = "-";
     //
     // saveMenuItem
     //
     this.saveMenuItem.Index     = 4;
     this.saveMenuItem.OwnerDraw = true;
     this.saveMenuItem.Text      = "Save";
     this.saveMenuItem.Click    += new System.EventHandler(this.saveMenuItem_Click);
     //
     // exitMenuItem
     //
     this.exitMenuItem.Index     = 5;
     this.exitMenuItem.OwnerDraw = true;
     this.exitMenuItem.Shortcut  = System.Windows.Forms.Shortcut.CtrlX;
     this.exitMenuItem.Text      = "Close";
     this.exitMenuItem.Click    += new System.EventHandler(this.exitMenuItem_Click);
     //
     // actionMenuItem
     //
     this.actionMenuItem.Index = 1;
     this.actionMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.detailsMenuItem
     });
     this.actionMenuItem.Text = "Action";
     //
     // detailsMenuItem
     //
     this.detailsMenuItem.Index     = 0;
     this.detailsMenuItem.OwnerDraw = true;
     this.detailsMenuItem.Text      = "Show MARC";
     this.detailsMenuItem.Click    += new System.EventHandler(this.detailsMenuItem_Click);
     //
     // helpMenuItem
     //
     this.helpMenuItem.Index = 2;
     this.helpMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.aboutMenuItem
     });
     this.helpMenuItem.Text = "Help";
     //
     // aboutMenuItem
     //
     this.aboutMenuItem.Index     = 0;
     this.aboutMenuItem.OwnerDraw = true;
     this.aboutMenuItem.Text      = "About";
     //
     // detailsMenuItem_ContextMenuItem
     //
     this.detailsMenuItem_ContextMenuItem.Index     = 0;
     this.detailsMenuItem_ContextMenuItem.OwnerDraw = true;
     this.detailsMenuItem_ContextMenuItem.Text      = "Show MARC";
     this.detailsMenuItem_ContextMenuItem.Click    += new System.EventHandler(this.detailsMenuItem_Click);
     //
     // commentsMenuItem_ContextMenuItem
     //
     this.commentsMenuItem_ContextMenuItem.Index     = 0;
     this.commentsMenuItem_ContextMenuItem.OwnerDraw = true;
     this.commentsMenuItem_ContextMenuItem.Text      = "Show Comments";
     this.commentsMenuItem_ContextMenuItem.Click    += new System.EventHandler(this.commentsMenuItem_Click);
     //
     // actionMI_ShowDetails
     //
     this.actionMI_ShowDetails.Index     = -1;
     this.actionMI_ShowDetails.OwnerDraw = true;
     this.actionMI_ShowDetails.Text      = "";
     //
     // contextMenu1
     //
     this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.detailsMenuItem_ContextMenuItem,
         this.commentsMenuItem_ContextMenuItem
     });
     //
     // printPreviewDialog1
     //
     this.printPreviewDialog1.AutoScrollMargin  = new System.Drawing.Size(0, 0);
     this.printPreviewDialog1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
     this.printPreviewDialog1.ClientSize        = new System.Drawing.Size(400, 300);
     this.printPreviewDialog1.Document          = this.printDocument1;
     this.printPreviewDialog1.Enabled           = true;
     this.printPreviewDialog1.Icon    = ((System.Drawing.Icon)(resources.GetObject("printPreviewDialog1.Icon")));
     this.printPreviewDialog1.Name    = "printPreviewDialog1";
     this.printPreviewDialog1.Visible = false;
     //
     // printDocument1
     //
     this.printDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printDocument1_PrintPage);
     //
     // printDialog1
     //
     this.printDialog1.Document = this.printDocument1;
     //
     // pageSetupDialog1
     //
     this.pageSetupDialog1.Document = this.printDocument1;
     //
     // imageList1
     //
     this.imageList1.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
     this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
     this.imageList1.Images.SetKeyName(0, "");
     this.imageList1.Images.SetKeyName(1, "");
     this.imageList1.Images.SetKeyName(2, "");
     this.imageList1.Images.SetKeyName(3, "");
     this.imageList1.Images.SetKeyName(4, "");
     //
     // customGrid_Panel1
     //
     this.customGrid_Panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                            | System.Windows.Forms.AnchorStyles.Left)
                                                                           | System.Windows.Forms.AnchorStyles.Right)));
     this.customGrid_Panel1.BorderStyle         = System.Windows.Forms.BorderStyle.FixedSingle;
     this.customGrid_Panel1.Current_Sort_String = "";
     this.customGrid_Panel1.DataTable           = null;
     this.customGrid_Panel1.Location            = new System.Drawing.Point(8, 0);
     this.customGrid_Panel1.Name     = "customGrid_Panel1";
     this.customGrid_Panel1.Size     = new System.Drawing.Size(776, 600);
     this.customGrid_Panel1.TabIndex = 0;
     //
     // closeButton
     //
     this.closeButton.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.closeButton.Location = new System.Drawing.Point(704, 608);
     this.closeButton.Name     = "closeButton";
     this.closeButton.Size     = new System.Drawing.Size(75, 23);
     this.closeButton.TabIndex = 1;
     this.closeButton.Text     = "EXIT";
     this.closeButton.Click   += new System.EventHandler(this.closeButton_Click);
     //
     // saveFileDialog1
     //
     this.saveFileDialog1.Filter = "Comma-seperated Values File (*.csv)|*.csv|Tab-delimited Text File (*.txt)|*.txt|E" +
                                   "xcel Spreadsheet (*.xls)|*.xls";
     this.saveFileDialog1.FilterIndex = 3;
     this.saveFileDialog1.Title       = "Save As";
     //
     // printButton
     //
     this.printButton.Anchor     = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.printButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.printButton.ImageIndex = 2;
     this.printButton.ImageList  = this.imageList1;
     this.printButton.Location   = new System.Drawing.Point(113, 608);
     this.printButton.Name       = "printButton";
     this.printButton.Size       = new System.Drawing.Size(80, 23);
     this.printButton.TabIndex   = 3;
     this.printButton.Text       = "    Print";
     this.printButton.Click     += new System.EventHandler(this.printButton_Click);
     //
     // saveButton
     //
     this.saveButton.Anchor     = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.saveButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.saveButton.ImageIndex = 3;
     this.saveButton.ImageList  = this.imageList1;
     this.saveButton.Location   = new System.Drawing.Point(17, 608);
     this.saveButton.Name       = "saveButton";
     this.saveButton.Size       = new System.Drawing.Size(80, 23);
     this.saveButton.TabIndex   = 4;
     this.saveButton.Text       = "    Save";
     this.saveButton.Click     += new System.EventHandler(this.saveButton_Click);
     //
     // Results_Form
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
     this.BackColor         = System.Drawing.SystemColors.Control;
     this.ClientSize        = new System.Drawing.Size(792, 641);
     this.Controls.Add(this.saveButton);
     this.Controls.Add(this.printButton);
     this.Controls.Add(this.closeButton);
     this.Controls.Add(this.customGrid_Panel1);
     this.Font          = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Menu          = this.mainMenu1;
     this.Name          = "Results_Form";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text          = "DLC Importer - Results Form";
     this.ResumeLayout(false);
 }
Exemplo n.º 7
0
        /// <summary> Constructor for a new instance of the Items_Pending_Online_Complete_Form form </summary>
        public Items_Pending_Online_Complete_Form()
        {
            InitializeComponent();
            BackColor = Color.FromArgb(240, 240, 240);

            DataTable sourceTable = SobekCM_Database.Items_Pending_Online_Complete;

            // Add two columns
            DataColumn accessColumn      = sourceTable.Columns.Add("Access");
            DataColumn aggregationColumn = sourceTable.Columns["AggregationCodes"];
            DataColumn restrictionColumn = sourceTable.Columns["IP_Restriction_Mask"];

            foreach (DataRow thisRow in sourceTable.Rows)
            {
                thisRow[aggregationColumn] = thisRow[aggregationColumn].ToString().Trim().Replace("  ", " ").Replace(" ", ",");

                int access = Convert.ToInt16(thisRow[restrictionColumn]);
                if (access < 0)
                {
                    thisRow[accessColumn] = "private";
                }
                if (access == 0)
                {
                    thisRow[accessColumn] = "public";
                }
                if (access > 0)
                {
                    thisRow[accessColumn] = "restricted";
                }
            }

            iconPanel = new CustomGrid_Panel
            {
                Anchor = (((((AnchorStyles.Top | AnchorStyles.Bottom)
                             | AnchorStyles.Left)
                            | AnchorStyles.Right))),
                BorderStyle = BorderStyle.FixedSingle,
                DataTable   = null,
                Location    = new Point(16, 16),
                Name        = "itemGridPanel",
                Size        = new Size(mainPanel.Width - 32, mainPanel.Height - 32),
                TabIndex    = 0
            };
            iconPanel.Double_Clicked += iconPanel_Double_Clicked;

            mainPanel.Controls.Add(iconPanel);


            // Configure some table level style settings
            iconPanel.Style.Default_Column_Width = 85;
            iconPanel.Style.Default_Column_Color = Color.LightBlue;
            iconPanel.Style.Header_Back_Color    = Color.SteelBlue;
            iconPanel.Style.Header_Fore_Color    = Color.White;

            // Use the table from the database as the data source
            iconPanel.DataTable = sourceTable;

            ////// Configure some individual columns
            iconPanel.Style.Column_Styles[1].Width       = 50;
            iconPanel.Style.Column_Styles[2].Width       = 150;
            iconPanel.Style.Column_Styles[2].Header_Text = "QC Milestone";
            iconPanel.Style.Column_Styles[3].Visible     = false;
            iconPanel.Style.Column_Styles[4].Visible     = false;
            iconPanel.Style.Column_Styles[5].Header_Text = "Pages";
            iconPanel.Style.Column_Styles[5].Width       = 50;
            iconPanel.Style.Column_Styles[6].Width       = 250;
            iconPanel.Style.Column_Styles[6].BackColor   = Color.White;
            iconPanel.Style.Column_Styles[7].Width       = 100;
            iconPanel.Style.Column_Styles[7].BackColor   = Color.White;
            iconPanel.Style.Column_Styles[8].Width       = 120;
            iconPanel.Style.Column_Styles[8].Header_Text = "Aggregations";
        }