Exemple #1
0
        /// <summary>
        /// Edit an exclusion item.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>
        /// <history>
        /// [Curtis_Beard]		03/07/2012	ADD: 3131609, exclusions
        /// [Curtis_Beard]	   11/11/2014	CHG: use FilterItem, pass all current FilterItems to add/edit form
        /// </history>
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (lstExclusions.SelectedItems.Count > 0)
            {
                // get currently selected exclusion
                var item = lstExclusions.SelectedItems[0].Tag as FilterItem;
                item.Enabled = lstExclusions.SelectedItems[0].Checked;

                var dlg = new frmAddEditExclusions(GetCurrentFilterItems(), item);
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    item = dlg.CurrentItem;
                    var listItem = GetListViewItem(item);
                    lstExclusions.SelectedItems[0].Checked = item.Enabled;
                    lstExclusions.SelectedItems[0].Tag     = item;

                    lstExclusions.SelectedItems[0].SubItems[1].Text = listItem.SubItems[1].Text;
                    lstExclusions.SelectedItems[0].SubItems[2].Text = listItem.SubItems[2].Text;
                    lstExclusions.SelectedItems[0].SubItems[3].Text = listItem.SubItems[3].Text;
                    lstExclusions.SelectedItems[0].SubItems[4].Text = listItem.SubItems[4].Text;

                    SetButtonState();
                }
            }

            this.DialogResult = DialogResult.None;
        }
Exemple #2
0
        /// <summary>
        /// Add a new exclusion item.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>
        /// <history>
        /// [Curtis_Beard]		03/07/2012	ADD: 3131609, exclusions
        /// [Curtis_Beard]	   11/11/2014	CHG: use FilterItem, pass all current FilterItems to add/edit form
        /// </history>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var dlg = new frmAddEditExclusions(GetCurrentFilterItems(), null);

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                // create new entry
                lstExclusions.Items.Add(GetListViewItem(dlg.CurrentItem));

                SetButtonState();
            }

            this.DialogResult = DialogResult.None;
        }
Exemple #3
0
        /// <summary>
        /// Add a new exclusion item.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>
        /// <history>
        /// [Curtis_Beard]		03/07/2012	ADD: 3131609, exclusions
        /// [Curtis_Beard]	   11/11/2014	CHG: use FilterItem, pass all current FilterItems to add/edit form
        /// </history>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var dlg = new frmAddEditExclusions(GetCurrentFilterItems(), null);
             if (dlg.ShowDialog(this) == DialogResult.OK)
             {
            // create new entry
            lstExclusions.Items.Add(GetListViewItem(dlg.CurrentItem));

            SetButtonState();
             }

             this.DialogResult = DialogResult.None;
        }
Exemple #4
0
        /// <summary>
        /// Edit an exclusion item.
        /// </summary>
        /// <param name="sender">system parameter</param>
        /// <param name="e">system parameter</param>
        /// <history>
        /// [Curtis_Beard]		03/07/2012	ADD: 3131609, exclusions
        /// [Curtis_Beard]	   11/11/2014	CHG: use FilterItem, pass all current FilterItems to add/edit form
        /// </history>
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (lstExclusions.SelectedItems.Count > 0)
             {
            // get currently selected exclusion
            var item = lstExclusions.SelectedItems[0].Tag as FilterItem;
            item.Enabled = lstExclusions.SelectedItems[0].Checked;

            var dlg = new frmAddEditExclusions(GetCurrentFilterItems(), item);
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
               item = dlg.CurrentItem;
               var listItem = GetListViewItem(item);
               lstExclusions.SelectedItems[0].Checked = item.Enabled;
               lstExclusions.SelectedItems[0].Tag = item;

               lstExclusions.SelectedItems[0].SubItems[1].Text = listItem.SubItems[1].Text;
               lstExclusions.SelectedItems[0].SubItems[2].Text = listItem.SubItems[2].Text;
               lstExclusions.SelectedItems[0].SubItems[3].Text = listItem.SubItems[3].Text;
               lstExclusions.SelectedItems[0].SubItems[4].Text = listItem.SubItems[4].Text;

               SetButtonState();
            }
             }

             this.DialogResult = DialogResult.None;
        }