public ReportsWorkItemController(WorkItem workItem) : base(workItem) { // We need to pull the publisher filter list from the database SettingsDAO lwDataAccess = new SettingsDAO(); _publisherFilter = lwDataAccess.GetPublisherFilter(); }
public AdministrationWorkItemController(WorkItem workItem) : base(workItem) { this.workItem = workItem as AdministrationWorkItem; // We need to pull the publisher filter list from the database SettingsDAO lwDataAccess = new SettingsDAO(); _publisherFilter = lwDataAccess.GetPublisherFilter(); }
private void FormFilterPublishers_Load(object sender, EventArgs e) { Application.UseWaitCursor = false; string publisherName = ""; lbFilteredPublishers.EndUpdate(); lbAvailablePublishers.EndUpdate(); lbFilteredPublishers.Items.Clear(); lbAvailablePublishers.Items.Clear(); // Get the list of publishers currently in the filter list SettingsDAO lwDataAccess = new SettingsDAO(); string publisherFilter = lwDataAccess.GetPublisherFilter(); List <String> listFilterPublishers = new List <string>(); listFilterPublishers.AddRange(publisherFilter.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); // Recover a complete list of all publsiher names DataTable dtAvailablePublishers = new ApplicationsDAO().GetAllPublisherNames(); // add <unidentified> publisher if not present if (dtAvailablePublishers.Select("_PUBLISHER = '" + DataStrings.UNIDENIFIED_PUBLISHER + "'").Length == 0) { DataRow uidRow = dtAvailablePublishers.NewRow(); uidRow["_PUBLISHER"] = DataStrings.UNIDENIFIED_PUBLISHER; dtAvailablePublishers.Rows.Add(uidRow); } // Add the publisher to the appropriate list foreach (DataRow row in dtAvailablePublishers.Rows) { publisherName = row[0].ToString(); if (!listFilterPublishers.Contains(publisherName)) { lbAvailablePublishers.Items.Add(publisherName); } else { lbFilteredPublishers.Items.Add(publisherName); } } lbFilteredPublishers.EndUpdate(); lbAvailablePublishers.EndUpdate(); }
private void bnSetPublisher_Click(object sender, EventArgs e) { FormSelectPublisher selectPublisher = new FormSelectPublisher(true); if (selectPublisher.ShowDialog() == DialogResult.OK) { tbPublisher.Text = selectPublisher.SelectedPublisher; // Ensure that this publisher is in the publisher filter otherwise this application could disapp[ear SettingsDAO lwDataAccess = new SettingsDAO(); string publisherFilter = lwDataAccess.GetPublisherFilter(); if ((publisherFilter != "") && (!publisherFilter.Contains(tbPublisher.Text))) { publisherFilter = publisherFilter + ";" + tbPublisher.Text; lwDataAccess.SetPublisherFilter(publisherFilter); } } }