public static DialogResult ShowSelection(String FormName, String FilterName = null, List <String> Filters = null)
        {
            IPopupForm selection = null;

            selection = Activator.CreateInstance(Type.GetType("Jk_Accounting_Software.External.Popup." + FormName)) as IPopupForm;

            if (selection == null)
            {
                IMessageHandler.Inform(ISystemMessages.NoFormFound(FormName));
                return(DialogResult.Cancel);
            }

            try
            {
                IAppHandler.StartBusy("Opening filter selection");

                selection.StartPosition = FormStartPosition.CenterScreen;
                selection.Text          = IAppHandler.ApplicationText;
                selection.LoadData();
                selection.LoadFilter(FilterName, Filters);
            }
            finally
            {
                IAppHandler.EndBusy("Opening filter selection");
            }
            return(selection.ShowDialog(IAppHandler.FindActiveForm()));
        }
Exemplo n.º 2
0
        private void btnFilter_Click(object sender, EventArgs e)
        {
            List <String> filters = new List <String>();

            filters.Add("(All)");
            filters.Add("Asset");
            filters.Add("Liability");
            filters.Add("Equity");
            filters.Add("Income");
            filters.Add("Expense");

            if (IPopupForm.ShowSelection("EReportFilterSelectionForm", "Type", filters) == DialogResult.OK)
            {
                GenerateReport();
                btnFilter.Checked = true;
            }

            btnRemoveFilter.Enabled = btnFilter.Checked;
        }