コード例 #1
0
        private void search_and_create_report()
        {
            SobekCM_Search_Object newSearch = sobekCM_Item_Discovery_Panel1.Current_Search;

            if ((lastSearch == null) || (lastResults == null) || (!newSearch.Equals(lastSearch)))
            {
                Cursor      = Cursors.WaitCursor;
                lastResults = newSearch.Perform_Tracking_Search();
                Cursor      = Cursors.Default;

                if (lastResults == null)
                {
                    return;
                }

                if (!newSearch.Equals(lastSearch))
                {
                    lastSearch = newSearch;

                    // Since this is a new search, save the last used parameters
                    SMaRT_UserSettings.Discovery_Panel_Search_Term1 = lastSearch.First_Term;
                    SMaRT_UserSettings.Discovery_Panel_Search_Term2 = lastSearch.Second_Term;
                    SMaRT_UserSettings.Discovery_Panel_Search_Term3 = lastSearch.Third_Term;
                    SMaRT_UserSettings.Discovery_Panel_Search_Term4 = lastSearch.Fourth_Term;
                    SMaRT_UserSettings.Save();
                }
            }


            Ad_Hoc_Report_Display_Form showForm = new Ad_Hoc_Report_Display_Form(lastResults);

            Hide();
            showForm.ShowDialog();
            Show();
        }
コード例 #2
0
        private void okButton_Button_Pressed(object sender, EventArgs e)
        {
            string username = userNameTextBox.Text.Replace("\\", "").Replace("/", "").Replace(".", "").Replace(",", "").Replace("&", "").Replace(":", "").Replace("@", "").Trim();
            string email    = emailTextBox.Text.Trim();
            string note     = notesTextBox.Text.Trim();

            // Ensure the required data is present
            if ((username.Length == 0) || (email.Length == 0))
            {
                MessageBox.Show("Username and email are both required fields.      ", "Missing Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            // Save the user's preferences
            SMaRT_UserSettings.Email_Address = email;
            SMaRT_UserSettings.User_Name     = username;
            SMaRT_UserSettings.Save();

            // Add this request to the database
            bool result = SobekCM_Database.Tivoli_Request_File(bibid, vid, "*", username.Replace(" ", ""), email, note);

            if (result)
            {
                MessageBox.Show("Request submitted.   You should receive an email when the retrieval is complete.    ", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Close();
            }
            else
            {
                MessageBox.Show("Error requesting the files from the archives.   ", "Error Encountered", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private void viewItemFormToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openItemFromWebMenuItem.Checked = false;
            viewItemFormMenuItem.Checked    = true;

            SMaRT_UserSettings.Ad_Hoc_Form_Action_On_Click = View_Items_Form_Action_On_Click_Enum.Show_Form;
            SMaRT_UserSettings.Save();
        }
コード例 #4
0
        protected override void OnClosing(CancelEventArgs e)
        {
            if (WindowState != FormWindowState.Maximized)
            {
                SMaRT_UserSettings.View_Item_Form_Size      = Size;
                SMaRT_UserSettings.View_Item_Form_Maximized = false;
            }
            else
            {
                SMaRT_UserSettings.View_Item_Form_Maximized = true;
            }

            SMaRT_UserSettings.Save();
        }
コード例 #5
0
        protected override void OnClosing(CancelEventArgs e)
        {
            // Save the window state and/or size
            if (WindowState != FormWindowState.Maximized)
            {
                SMaRT_UserSettings.Tracking_Box_Report_Form_Size      = Size;
                SMaRT_UserSettings.Tracking_Box_Report_Form_Maximized = false;
            }
            else
            {
                SMaRT_UserSettings.Tracking_Box_Report_Form_Maximized = true;
            }

            SMaRT_UserSettings.Save();
        }
コード例 #6
0
        protected override void OnClosing(CancelEventArgs e)
        {
            // Save the window state and/or size
            if (WindowState != FormWindowState.Maximized)
            {
                SMaRT_UserSettings.Ad_Hoc_Report_Form_Size      = Size;
                SMaRT_UserSettings.Ad_Hoc_Report_Form_Maximized = false;
            }
            else
            {
                SMaRT_UserSettings.Ad_Hoc_Report_Form_Maximized = true;
            }

            // Save the column widths
            if (gridPanel != null)
            {
                SMaRT_UserSettings.Ad_Hoc_Report_Form_Title_Width = gridPanel.Style.Column_Styles[5].Width;
                if (gridPanel.Style.Column_Styles[6].Visible)
                {
                    SMaRT_UserSettings.Ad_Hoc_Report_Form_Author_Width = gridPanel.Style.Column_Styles[6].Width;
                }
                if (gridPanel.Style.Column_Styles[7].Visible)
                {
                    SMaRT_UserSettings.Ad_Hoc_Report_Form_Publisher_Width = gridPanel.Style.Column_Styles[7].Width;
                }
                if (gridPanel.Style.Column_Styles[8].Visible)
                {
                    SMaRT_UserSettings.Ad_Hoc_Report_Form_Date_Width = gridPanel.Style.Column_Styles[8].Width;
                }
                if (gridPanel.Style.Column_Styles[9].Visible)
                {
                    SMaRT_UserSettings.Ad_Hoc_Report_Form_Level1_Width = gridPanel.Style.Column_Styles[9].Width;
                }
                if (gridPanel.Style.Column_Styles[12].Visible)
                {
                    SMaRT_UserSettings.Ad_Hoc_Report_Form_Level2_Width = gridPanel.Style.Column_Styles[12].Width;
                }
                if (gridPanel.Style.Column_Styles[14].Visible)
                {
                    SMaRT_UserSettings.Ad_Hoc_Report_Form_Level3_Width = gridPanel.Style.Column_Styles[14].Width;
                }
            }

            SMaRT_UserSettings.Save();
        }
コード例 #7
0
        private void print_grid_style_report(bool All_Rows)
        {
            // Save the flag
            gridPrinterShowAllRows = All_Rows;

            try
            {
                // If there are too many rows, ask for confirmation
                if ((gridPanel.View_Count > 500) && (All_Rows))
                {
                    DialogResult result = MessageBox.Show("You are about to print a report with " + gridPanel.View_Count + " rows.\n\nAre you sure you want to do this?", "Large Print Job Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (result != DialogResult.Yes)
                    {
                        return;
                    }
                }

                if ((gridPanel.Selected_Row_Count > 500) && (!All_Rows))
                {
                    DialogResult result = MessageBox.Show("You are about to print a report with " + gridPanel.Selected_Row_Count + " rows.\n\nAre you sure you want to do this?", "Large Print Job Warning!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (result != DialogResult.Yes)
                    {
                        return;
                    }
                }

                // Print this report
                gridPrinter.Prepare_To_Print();
                pageSetupDialog1.PageSettings.Landscape = SMaRT_UserSettings.Item_Grid_Print_Landscape;
                if (printDialog1.ShowDialog() == DialogResult.OK)
                {
                    SMaRT_UserSettings.Item_Grid_Print_Landscape = pageSetupDialog1.PageSettings.Landscape;
                    SMaRT_UserSettings.Save();
                    printDocument1.Print();
                }
            }
            catch
            {
                MessageBox.Show("Error encountered while printing!       ", "I/O Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }