private void FillFormTypesAndSavedSearches() { dropFormTypes.Items.Clear(); DropSavedSearches.Items.Clear(); var dal = new SECFormsManager(); var dal2 = new SavedSearchManager(); var table = dal.GetFormTypes(); dropFormTypes.Items.Add("(all)"); foreach (var rowFt in table) { dropFormTypes.Items.Add(rowFt.formtype); } var table2 = dal2.GetSearches(SearchType); DropSavedSearches.DataSource = table2; DropSavedSearches.DataTextField = table2.descriptionColumn.ColumnName; DropSavedSearches.DataValueField = table2.descriptionColumn.ColumnName; DropSavedSearches.DataBind(); var table3 = dal2.GetSearches(AutoSaveSearchType); foreach (var searchRow in table3) { searchRow.description = searchRow.description.ToLower(); } DropSavedSearches2.DataSource = table3; DropSavedSearches2.DataTextField = table3.descriptionColumn.ColumnName; DropSavedSearches2.DataValueField = table3.descriptionColumn.ColumnName; DropSavedSearches2.DataBind(); }
private void LoadSearch(string description, string searchType) { var dal = new SavedSearchManager(); var table = dal.GetSearches(searchType); var row = table.FindBydescriptiontype(description, searchType); if (row == null) { return; } TextSearchForms.Text = row.param1; TextSearchPars.Text = row.param2; DropSort.SelectedValue = row.param3; TextFormTypes.Text = row.param4 == string.Empty ? "%" : row.param4; try { CheckCompany.Checked = !row.Isoptional5Null() ? (row.optional5.ToLower() == "true") : false; } catch { CheckCompany.Checked = false; } TextBoxCompany.Text = !row.Isoptional6Null() ? row.optional6 : string.Empty; txtSaveName.Text = description; }
private void SaveSearch(string description, string searchType) { var dal = new SavedSearchManager(); var table = dal.GetSearches(searchType); var srchRow = table.FindBydescriptiontype(description, SearchType); if (null == srchRow) { table.AddtblCOI_savedSearchRow(description, searchType, TextSearchForms.Text, TextSearchPars.Text, DropSort.SelectedValue, TextFormTypes.Text, null, null, DateTime.Now, null, null, CheckCompany.Checked, false); } else { srchRow.param1 = TextSearchForms.Text; srchRow.param2 = TextSearchPars.Text; srchRow.param3 = DropSort.SelectedValue; srchRow.param4 = TextFormTypes.Text; srchRow.optional5 = CheckCompany.Checked.ToString(); srchRow.optional6 = TextBoxCompany.Text; } dal.Save(table); FillFormTypesAndSavedSearches(); }