Example #1
0
        /// <summary>
        /// The ButtonAdd_Click method.
        /// </summary>
        /// <param name="sender">The <paramref name="sender"/> parameter.</param>
        /// <param name="args">The <paramref name="args"/> parameter.</param>
        private void ButtonAdd_Click(object sender, EventArgs args)
        {
            // Show the ModifyReportTemplateForm dialog.
            using (var modifyReportTemplateForm = new ModifyReportTemplateForm())
            {
                if (modifyReportTemplateForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            // Refresh the items in the list view.
            PopulateReportTemplates();
        }
Example #2
0
        /// <summary>
        /// The ButtonModify_Click method.
        /// </summary>
        /// <param name="sender">The <paramref name="sender"/> parameter.</param>
        /// <param name="args">The <paramref name="args"/> parameter.</param>
        private void ButtonModify_Click(object sender, EventArgs args)
        {
            if (lvTemplates.SelectedItems.Count == 0 || !(lvTemplates.SelectedItems[0].Tag is ReportTemplate selectedTemplate))
            {
                return;
            }

            // Show the ModifyReportTemplateForm dialog.
            using (var modifyReportTemplateForm = new ModifyReportTemplateForm(selectedTemplate))
            {
                if (modifyReportTemplateForm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            // Refresh the items in the list view.
            PopulateReportTemplates();
        }