Exemplo n.º 1
0
        private void LoadClusters()
        {
            DataSet ds = oCSMConfig.Gets(intRequest);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int     intConfig = Int32.Parse(dr["id"].ToString());
                DataSet dsConfig  = oCSMConfig.Get(intConfig);
                if (dsConfig.Tables[0].Rows.Count > 0)
                {
                    if (dsConfig.Tables[0].Rows[0]["local_nodes"].ToString() != "1")
                    {
                        strAttributes += "alert('You have not configured the LOCAL NODES for Config \"" + dsConfig.Tables[0].Rows[0]["name"].ToString() + "\"\\n\\nPlease click \"Edit\" from the configuration list to modify this configuration');return false;";
                    }
                }
            }
            rptCSM.DataSource = oCSMConfig.Gets(intRequest);
            rptCSM.DataBind();
            foreach (RepeaterItem ri in rptCSM.Items)
            {
                ((LinkButton)ri.FindControl("btnDelete")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
            }
            lblNone.Visible = (rptCSM.Items.Count == 0);
        }
Exemplo n.º 2
0
        private void LoadDevices()
        {
            DataSet dsClusters = oCluster.Gets(intRequest);

            foreach (DataRow drCluster in dsClusters.Tables[0].Rows)
            {
                AddDevice("Cluster Node", drCluster["name"].ToString(), drCluster["nodes"].ToString(), Int32.Parse(drCluster["id"].ToString()), 0, 0);
                try
                {
                    int intCount = Int32.Parse(drCluster["nodes"].ToString());
                    if (intCount > 0)
                    {
                        AddDevice("Cluster Node", drCluster["name"].ToString(), drCluster["nodes"].ToString(), Int32.Parse(drCluster["id"].ToString()), 0, 0);
                    }
                }
                catch { }
            }
            DataSet dsConfigs = oCSMConfig.Gets(intRequest);

            foreach (DataRow drConfig in dsConfigs.Tables[0].Rows)
            {
                AddDevice("CSM Config", drConfig["name"].ToString(), drConfig["servers"].ToString(), 0, Int32.Parse(drConfig["id"].ToString()), 0);
                try
                {
                    int intCount = Int32.Parse(drConfig["servers"].ToString());
                    if (intCount > 0)
                    {
                        AddDevice("CSM Config", drConfig["name"].ToString(), drConfig["servers"].ToString(), 0, Int32.Parse(drConfig["id"].ToString()), 0);
                    }
                }
                catch { }
            }
            if (strDevices == "")
            {
                for (int ii = 1; ii <= intTotalCount; ii++)
                {
                    AddDevice("Server", "---", ii.ToString(), 0, 0, ii);
                }
            }
        }