Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        private void TreeComboBox3_OnSelectionChangeCommitted(object sender, System.EventArgs e)
        {
            try
            {
                // Daten holen und prüfen
                ISingleDbObject dbobject = m_MainActivator.DbObject;

                if (dbobject == null || !m_BInitialised || FormTool.GetValueSafe(dbobject, "UID_SDLDomain", "") == "")
                {
                    return;
                }

                // das reicht völlig aus
                dbobject.GetFK("UID_ParentApplicationServer").SetParent(null);

                m_TreeComboBoxUIDParentApplicationServer.WhereClause =
                    !FormTool.CanSee(dbobject, "UID_ApplicationServer", "UID_SDLDomain")
                                    ? "1=2"
                                    :
                    // ReSharper disable once UseStringInterpolation
                    string.Format("{0} and not {1}",
                                  SqlFormatter.UidComparison("UID_SDLDomain", dbobject["UID_SDLDomain"].New.String),
                                  SqlFormatter.InClause("UID_Applicationserver", ValType.String, FormTool.GetChildUuids(Connection,
                                                                                                                        "Applicationserver", "UID_Applicationserver",
                                                                                                                        dbobject["UID_ApplicationServer"].New.String, "UID_ParentApplicationserver")));
            }
            catch (Exception ex)
            {
                // Fehler melden
                HandleException(ex);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        private void MainActivator_OnActivated(object sender, System.EventArgs e)
        {
            try
            {
                m_BInitialised = true;

                // Daten holen und prüfen
                ISingleDbObject dbobject = m_MainActivator.DbObject;

                if (dbobject != null)
                {
                    var SDLDomaiDef = FormTool.GetValueSafe(dbobject, "UID_SDLDomain", "") != "";

                    m_TreeComboBoxUIDSDLDomain.EnabledByUser = !SDLDomaiDef;

                    if (SDLDomaiDef)
                    {
                        m_TreeComboBoxUIDParentApplicationServer.WhereClause = !FormTool.CanSee(dbobject, "UID_ApplicationServer") ? "1=2" :
                                                                               // ReSharper disable once UseStringInterpolation
                                                                               string.Format("{0} and not {1}",
                                                                                             SqlFormatter.UidComparison("UID_SDLDomain", dbobject["UID_SDLDomain"].New.String),
                                                                                             SqlFormatter.InClause("UID_ApplicationServer", ValType.String, FormTool.GetChildUuids(Connection,
                                                                                                                                                                                   "Applicationserver", "UID_Applicationserver",
                                                                                                                                                                                   dbobject["UID_ApplicationServer"].New.String, "UID_ParentApplicationserver")));
                    }
                    else
                    {
                        m_TreeComboBoxUIDParentApplicationServer.WhereClause = SqlFormatter.EmptyClause("UID_SDLDomain", ValType.String);
                    }
                }


                if (m_EditIdentApplicationServer.Enabled && m_EditIdentApplicationServer.Visible)
                {
                    m_EditIdentApplicationServer.Select();
                }
            }
            catch (Exception ex)
            {
                // Fehler melden
                HandleException(ex);
            }
        }