コード例 #1
0
    /// <summary>
    /// Edits the selected Form
    /// </summary>
    private void EditForm()
    {
        log.Debug("Editing form");
        // Need to get the selected domain
        Domain domain = formListCtl.GetSelectedDomain();

        FormEntryDlg dlg = new FormEntryDlg();

        if (dlg.DoModal(this, domain))
        {
            log.Info("OK pressed on FormEntryDlg");
            if (domain.Dirty)
            {
                if (ConfigurationManager.AppSettings[DISPLAY_SQL_CFG].Equals("true"))
                {
                    BufferDisplayDlg bdDlg = new BufferDisplayDlg();
                    bdDlg.DoModal(this, domain);
                }
                if (ConfigurationManager.AppSettings[UPDATE_DB_CFG].Equals("true"))
                {
                    domain.Save();
                }
                formListCtl.UpdateSelectedLabel();
            }
        }
    }
コード例 #2
0
    /// <summary>
    /// Adds a new Form
    /// </summary>
    private void AddForm()
    {
        log.Debug("Adding new form");
        // Create a new Form domain
        Domain domain = DomainFactory.Create("Form");

        FormEntryDlg dlg = new FormEntryDlg();

        if (dlg.DoModal(this, domain))
        {
            log.Info("OK pressed on FormEntryDlg");
            if (ConfigurationManager.AppSettings[DISPLAY_SQL_CFG].Equals("true"))
            {
                BufferDisplayDlg bdDlg = new BufferDisplayDlg();
                bdDlg.DoModal(this, domain);
            }
            if (ConfigurationManager.AppSettings[UPDATE_DB_CFG].Equals("true"))
            {
                domain.Save();
            }

            formListCtl.AddDomain(domain);
        }
    }