Example #1
0
        private void vRefreshServidores()
        {
            System.Windows.Forms.ListViewItem lviHost;
            m_lvServidores.Items.Clear();
            mdlDataBaseAccess.clsDataBaseAccess cls_dba_ConnectionDB = new mdlDataBaseAccess.clsDataBaseAccessSqlServer(ref m_cls_ter_TratadorErro, m_strHost, m_strPort, m_strDataBaseName, m_strUser, m_strPassword);

            cls_dba_ConnectionDB.DBPort         = m_strPort;
            cls_dba_ConnectionDB.DBDataBaseName = m_strDataBaseName;
            cls_dba_ConnectionDB.DBUser         = m_strUser;
            cls_dba_ConnectionDB.DBPassword     = m_strPassword;

            string[] astrComputers = cls_dba_ConnectionDB.astrComputersAvailables();
            string[] astrServers   = cls_dba_ConnectionDB.astrServersAvailables(astrComputers);
            string[] astrDataBases = cls_dba_ConnectionDB.astrDataBaseAvailables(astrServers);

            // Computers
            foreach (string strComputer in astrComputers)
            {
                lviHost           = m_lvServidores.Items.Add(strComputer);
                lviHost.ForeColor = m_clrComputer;

                // DataBases
                foreach (string strDataBase in astrDataBases)
                {
                    if (strDataBase == strComputer)
                    {
                        lviHost.ForeColor = m_clrDataBase;
                        break;
                    }
                }

                // Servers
                if (lviHost.ForeColor == m_clrComputer)
                {
                    foreach (string strServer in astrServers)
                    {
                        if (strServer == strComputer)
                        {
                            lviHost.ForeColor = m_clrServer;
                            break;
                        }
                    }
                }
            }

            if (m_formFAguarde != null)
            {
                m_formFAguarde.Close();
                m_formFAguarde = null;
            }
        }
Example #2
0
 private void m_llbServidores_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
 {
     m_formFAguarde = new frmFAguarde();
     m_thrAguarde   = new System.Threading.Thread(new System.Threading.ThreadStart(vRefreshServidores));
     m_thrAguarde.Start();
     vInitializeFormAguarde(ref m_formFAguarde);
     m_formFAguarde.ShowDialog();
     if (m_thrAguarde != null)
     {
         if (m_thrAguarde.IsAlive)
         {
             m_thrAguarde.Abort();
         }
         m_thrAguarde = null;
     }
 }
Example #3
0
 private void vInitializeFormAguarde(ref frmFAguarde formFAguarde)
 {
     formFAguarde.eCallCarregaCor += new mdlDataBaseConfig.frmFAguarde.delCallCarregaCor(formFAguarde_eCallCarregaCor);
 }