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(); }
private void listView1_DoubleClick(object sender, EventArgs e) { if ( listView1.SelectedItems.Count == 1 ) { string box = listView1.SelectedItems[0].Text; SobekCM_Search_Object search = new SobekCM_Search_Object(SMaRT_UserSettings.Discovery_Panel_Search_Term1, SMaRT_UserSettings.Discovery_Panel_Search_Term2, SMaRT_UserSettings.Discovery_Panel_Search_Term3, SMaRT_UserSettings.Discovery_Panel_Search_Term4); bool found_bib = false; if (search.First_Term == SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box) { search.First_Value = box; found_bib = true; } if ((!found_bib) && (search.Second_Term == SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box)) { search.Second_Value = box; found_bib = true; } if ((!found_bib) && (search.Third_Term == SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box)) { search.Third_Value = box; found_bib = true; } if ((!found_bib) && (search.Fourth_Term == SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box)) { search.Fourth_Value = box; found_bib = true; } if (!found_bib) { search.Fourth_Value = box; search.Fourth_Term = SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box; } // Show the ad hoc reporting form Ad_Hoc_Reporting_Query_Form showForm = new Ad_Hoc_Reporting_Query_Form(search, null); Hide(); showForm.ShowDialog(); // Refresh the tracking box list listView1.Items.Clear(); List<string> trackingBoxes = SobekCM_Database.All_Tracking_Boxes; foreach (string thisBox in trackingBoxes) { listView1.Items.Add(thisBox); } Show(); } }
private void listView1_DoubleClick(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 1) { string box = listView1.SelectedItems[0].Text; SobekCM_Search_Object search = new SobekCM_Search_Object(SMaRT_UserSettings.Discovery_Panel_Search_Term1, SMaRT_UserSettings.Discovery_Panel_Search_Term2, SMaRT_UserSettings.Discovery_Panel_Search_Term3, SMaRT_UserSettings.Discovery_Panel_Search_Term4); bool found_bib = false; if (search.First_Term == SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box) { search.First_Value = box; found_bib = true; } if ((!found_bib) && (search.Second_Term == SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box)) { search.Second_Value = box; found_bib = true; } if ((!found_bib) && (search.Third_Term == SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box)) { search.Third_Value = box; found_bib = true; } if ((!found_bib) && (search.Fourth_Term == SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box)) { search.Fourth_Value = box; found_bib = true; } if (!found_bib) { search.Fourth_Value = box; search.Fourth_Term = SobekCM_Search_Object.SobekCM_Term_Enum.Tracking_Box; } // Show the ad hoc reporting form Ad_Hoc_Reporting_Query_Form showForm = new Ad_Hoc_Reporting_Query_Form(search, null); Hide(); showForm.ShowDialog(); // Refresh the tracking box list listView1.Items.Clear(); List <string> trackingBoxes = SobekCM_Database.All_Tracking_Boxes; foreach (string thisBox in trackingBoxes) { listView1.Items.Add(thisBox); } Show(); } }
/// <summary> Constructor for a new instance of the Ad_Hoc_Reporting_Query_Form form </summary> /// <param name="Initial_Search"> Initial search to display in this form </param> /// <param name="Initial_DataSet"> Initial dataset to display, which matches the intial search </param> public Ad_Hoc_Reporting_Query_Form(SobekCM_Search_Object Initial_Search, DataSet Initial_DataSet) { InitializeComponent(); BackColor = Color.FromArgb(240, 240, 240); sobekCM_Item_Discovery_Panel1.Finish_Loading_Data(); sobekCM_Item_Discovery_Panel1.Current_Search = Initial_Search; // Save these last values lastSearch = Initial_Search; lastResults = Initial_DataSet; }
/// <summary> Constructor for a new instance of the Ad_Hoc_Reporting_Query_Form form </summary> /// <param name="Initial_Search"> Initial search to display in this form </param> /// <param name="Initial_DataSet"> Initial dataset to display, which matches the intial search </param> public Ad_Hoc_Reporting_Query_Form( SobekCM_Search_Object Initial_Search, DataSet Initial_DataSet ) { InitializeComponent(); BackColor = Color.FromArgb(240, 240, 240); sobekCM_Item_Discovery_Panel1.Finish_Loading_Data(); sobekCM_Item_Discovery_Panel1.Current_Search = Initial_Search; // Save these last values lastSearch = Initial_Search; lastResults = Initial_DataSet; }
/// <summary> Constructor for a new instance of the View_Items_Form class </summary> public Item_Discovery_Form() { InitializeComponent(); // Load the last settings for the item discovery panel SobekCM_Search_Object sobekCmSearchObject1 = new SobekCM_Search_Object(SMaRT_UserSettings.Discovery_Panel_Search_Term1, SMaRT_UserSettings.Discovery_Panel_Search_Term2, SMaRT_UserSettings.Discovery_Panel_Search_Term3, SMaRT_UserSettings.Discovery_Panel_Search_Term4); sobekCM_Item_Discovery_Panel1.Current_Search = sobekCmSearchObject1; BackColor = Color.FromArgb(240, 240, 240); // Set the data for the panel sobekCM_Item_Discovery_Panel1.Finish_Loading_Data(); // Set some personalization and customization for the SobekCM Instance Name Text = SobekCM_Library_Settings.System_Abbreviation + " Item Discovery Form"; mainLabel.Text = "View " + SobekCM_Library_Settings.System_Abbreviation + " Items"; openWebContextMenuItem.Text = "Open Item/Group in " + SobekCM_Library_Settings.System_Abbreviation; filterSearchPanel.BackColor = Color.FromArgb(238, 238, 238); instructionLabel.Text = "Select search criteria below and press SEARCH.\n\nTo browse by collection or institution, select the code and press SEARCH. "; // Set the correct search precision sobekCM_Item_Discovery_Panel1.Search_Precision = SMaRT_UserSettings.Search_Precision; switch (SMaRT_UserSettings.Search_Precision) { case Search_Precision_Type_Enum.Contains: precisionExactMenuItem.Checked = true; precisionStandardMenuItem.Checked = false; break; case Search_Precision_Type_Enum.Synonmic_Form: precisionThesaurusMenuItem.Checked = true; precisionStandardMenuItem.Checked = false; break; } // Set the preferences for single group result sets switch (SMaRT_UserSettings.Item_Discovery_Form_Single_Result_Action) { case Single_Result_Action_Enum.Show_In_Grid: displayInThisFormMenuItem.Checked = true; automaticallyOpenInItemGroupFormMenuItem.Checked = false; break; case Single_Result_Action_Enum.Show_Details_For_Single_Item: displayInThisFormMenuItem.Checked = false; automaticallyOpenInItemGroupFormMenuItem.Checked = true; break; } // Set the correct landscape setting pageSetupDialog1.PageSettings.Landscape = SMaRT_UserSettings.Title_Grid_Print_Landscape; // Set the action on click if (SMaRT_UserSettings.Item_Discovery_Form_Action_On_Click == View_Items_Form_Action_On_Click_Enum.Open_On_Web) { openItemGroupOnWebMenuItem.Checked = true; viewItemGroupFormMenuItem.Checked = false; } else { openItemGroupOnWebMenuItem.Checked = false; viewItemGroupFormMenuItem.Checked = true; } // Set the size correctly Size = SMaRT_UserSettings.Item_Discovery_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.Item_Discovery_Form_Maximized )) WindowState = FormWindowState.Maximized; // GEt the username username = Environment.UserName; }
private void sobekCM_Item_Discovery_Panel1_Search_Requested() { lastSearch = sobekCM_Item_Discovery_Panel1.Current_Search; // 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(); Cursor = Cursors.WaitCursor; DataSet resultSet = lastSearch.Perform_Tracking_Search(); Cursor = Cursors.Default; if (resultSet == null) Clear_Items(false); else Show_Items(resultSet, String.Empty); sobekCM_Item_Discovery_Panel1.Invalidate(true); }
/// <summary> Constructor for a new instance of the SobekCM_Item_Discovery_Panel user control </summary> public SobekCM_Item_Discovery_Panel( ) { InitializeComponent(); // Get the list of all terms Array termEnumValues = Enum.GetValues(typeof(SobekCM_Search_Object.SobekCM_Term_Enum)); object[] terms = new object[termEnumValues.Length]; for (int i = 0; i < termEnumValues.Length; i++) { terms[i] = termEnumValues.GetValue(i).ToString().Replace("_", " "); } // Get the list of all links Array linkEnumValues = Enum.GetValues(typeof(SobekCM_Search_Object.SobekCM_Link_Enum)); object[] links = new object[linkEnumValues.Length]; for (int i = 0; i < linkEnumValues.Length; i++) { links[i] = linkEnumValues.GetValue(i).ToString().Replace("_", " ").ToLower(); } // Populate all the terms termComboBox1.Items.AddRange(terms); termComboBox2.Items.AddRange(terms); termComboBox3.Items.AddRange(terms); termComboBox4.Items.AddRange(terms); // Populate all the links linkComboBox2.Items.AddRange(links); linkComboBox3.Items.AddRange(links); linkComboBox4.Items.AddRange(links); searchPrecision = Search_Precision_Type_Enum.Inflectional_Form; Current_Search = new SobekCM_Search_Object(Settings.SMaRT_UserSettings.Discovery_Panel_Search_Term1, Settings.SMaRT_UserSettings.Discovery_Panel_Search_Term2, Settings.SMaRT_UserSettings.Discovery_Panel_Search_Term3, Settings.SMaRT_UserSettings.Discovery_Panel_Search_Term4); if (!Windows_Appearance_Checker.is_XP_Theme) { institutionRadioButton.FlatStyle = FlatStyle.Flat; allRadioButton.FlatStyle = FlatStyle.Flat; collectionRadioButton.FlatStyle = FlatStyle.Flat; institutionComboBox.FlatStyle = FlatStyle.Flat; collectionComboBox.FlatStyle = FlatStyle.Flat; linkComboBox2.FlatStyle = FlatStyle.Flat; linkComboBox3.FlatStyle = FlatStyle.Flat; linkComboBox4.FlatStyle = FlatStyle.Flat; termComboBox1.FlatStyle = FlatStyle.Flat; termComboBox2.FlatStyle = FlatStyle.Flat; termComboBox3.FlatStyle = FlatStyle.Flat; termComboBox4.FlatStyle = FlatStyle.Flat; searchTextBox1.BorderStyle = BorderStyle.FixedSingle; searchTextBox2.BorderStyle = BorderStyle.FixedSingle; searchTextBox3.BorderStyle = BorderStyle.FixedSingle; searchTextBox4.BorderStyle = BorderStyle.FixedSingle; isXp = true; } else { isXp = false; } }
/// <summary> Constructor for a new instance of the SobekCM_Item_Discovery_Panel user control </summary> public SobekCM_Item_Discovery_Panel( ) { InitializeComponent(); // Get the list of all terms Array termEnumValues = Enum.GetValues(typeof(SobekCM_Search_Object.SobekCM_Term_Enum)); object[] terms = new object[termEnumValues.Length]; for (int i = 0; i < termEnumValues.Length; i++) { terms[i] = termEnumValues.GetValue(i).ToString().Replace("_"," "); } // Get the list of all links Array linkEnumValues = Enum.GetValues(typeof(SobekCM_Search_Object.SobekCM_Link_Enum)); object[] links = new object[linkEnumValues.Length]; for (int i = 0; i < linkEnumValues.Length; i++) { links[i] = linkEnumValues.GetValue(i).ToString().Replace("_", " ").ToLower(); } // Populate all the terms termComboBox1.Items.AddRange(terms); termComboBox2.Items.AddRange(terms); termComboBox3.Items.AddRange(terms); termComboBox4.Items.AddRange(terms); // Populate all the links linkComboBox2.Items.AddRange(links); linkComboBox3.Items.AddRange(links); linkComboBox4.Items.AddRange(links); searchPrecision = Search_Precision_Type_Enum.Inflectional_Form; Current_Search = new SobekCM_Search_Object(Settings.SMaRT_UserSettings.Discovery_Panel_Search_Term1, Settings.SMaRT_UserSettings.Discovery_Panel_Search_Term2, Settings.SMaRT_UserSettings.Discovery_Panel_Search_Term3, Settings.SMaRT_UserSettings.Discovery_Panel_Search_Term4); if (!Windows_Appearance_Checker.is_XP_Theme) { institutionRadioButton.FlatStyle = FlatStyle.Flat; allRadioButton.FlatStyle = FlatStyle.Flat; collectionRadioButton.FlatStyle = FlatStyle.Flat; institutionComboBox.FlatStyle = FlatStyle.Flat; collectionComboBox.FlatStyle = FlatStyle.Flat; linkComboBox2.FlatStyle = FlatStyle.Flat; linkComboBox3.FlatStyle = FlatStyle.Flat; linkComboBox4.FlatStyle = FlatStyle.Flat; termComboBox1.FlatStyle = FlatStyle.Flat; termComboBox2.FlatStyle = FlatStyle.Flat; termComboBox3.FlatStyle = FlatStyle.Flat; termComboBox4.FlatStyle = FlatStyle.Flat; searchTextBox1.BorderStyle = BorderStyle.FixedSingle; searchTextBox2.BorderStyle = BorderStyle.FixedSingle; searchTextBox3.BorderStyle = BorderStyle.FixedSingle; searchTextBox4.BorderStyle = BorderStyle.FixedSingle; isXp = true; } else isXp = false; }
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(); }
private void viewAdHocReportMenuItem_Click(object sender, EventArgs e) { SobekCM_Search_Object search = new SobekCM_Search_Object(SMaRT_UserSettings.Discovery_Panel_Search_Term1, SMaRT_UserSettings.Discovery_Panel_Search_Term2, SMaRT_UserSettings.Discovery_Panel_Search_Term3, SMaRT_UserSettings.Discovery_Panel_Search_Term4); bool found_bib = false; if (search.First_Term == SobekCM_Search_Object.SobekCM_Term_Enum.BibID) { search.First_Value = bibid; found_bib = true; } if ((!found_bib) && (search.Second_Term == SobekCM_Search_Object.SobekCM_Term_Enum.BibID)) { search.Second_Value = bibid; found_bib = true; } if ((!found_bib) && (search.Third_Term == SobekCM_Search_Object.SobekCM_Term_Enum.BibID)) { search.Third_Value = bibid; found_bib = true; } if ((!found_bib) && (search.Fourth_Term == SobekCM_Search_Object.SobekCM_Term_Enum.BibID)) { search.Fourth_Value = bibid; found_bib = true; } if (!found_bib) { search.Second_Value = bibid; search.Second_Term = SobekCM_Search_Object.SobekCM_Term_Enum.BibID; } // Show the ad hoc reporting form Ad_Hoc_Reporting_Query_Form showForm = new Ad_Hoc_Reporting_Query_Form(search, null); Hide(); showForm.ShowDialog(); Show(); }