Ejemplo n.º 1
0
        public void FillSametimeListGrid()
        {
            string    SametimeList = "";
            DataTable dt           = new DataTable();

            dt = VSWebBL.DashboardBL.DominoServerHealthBLL.Ins.GetSametimeServerDetails();
            Session["SametimeServerList"] = dt;
            SametimeList = "0";
            DataRow[] foundRows;
            DataRow   statusrow;

            statusrow = statuslist.NewRow();
            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (statuslist.Rows.Count > 0)
                    {
                        foundRows = statuslist.Select("Status = '" + dt.Rows[i]["Status"].ToString() + "'");
                        if (foundRows.Length == 0)
                        {
                            statusrow                = statuslist.Rows.Add();
                            statusrow["Status"]      = dt.Rows[i]["Status"].ToString();
                            statusrow["StatusCount"] = 1;
                            statusrow                = statuslist.NewRow();
                        }
                        else
                        {
                            statusrow = foundRows[0];
                            statusrow["StatusCount"] = Convert.ToInt32(statusrow["StatusCount"].ToString()) + 1;
                        }
                    }
                    else
                    {
                        statusrow                = statuslist.Rows.Add();
                        statusrow["Status"]      = dt.Rows[i]["Status"].ToString();
                        statusrow["StatusCount"] = 1;
                        statusrow                = statuslist.NewRow();
                    }
                }
                SametimeList = dt.Rows.Count.ToString();
            }
            SameTimeGridView.DataSource = dt;
            SameTimeGridView.DataBind();
            DataRow rolerow = srvroles.Rows.Add();

            rolerow["Role"]      = "Sametime";
            rolerow["RoleCount"] = Convert.ToInt32(SametimeList);
        }
Ejemplo n.º 2
0
        public void FillSametimeListGridfromSession()
        {
            DataTable DataServers = new DataTable();

            try
            {
                if (Session["SametimeServerList"] != null && Session["SametimeServerList"] != "")
                {
                    DataServers = Session["SametimeServerList"] as DataTable;
                }
                if (DataServers.Rows.Count > 0)
                {
                    DataServers.PrimaryKey = new DataColumn[] { DataServers.Columns["ID"] };
                }

                SameTimeGridView.DataSource = DataServers;
                SameTimeGridView.DataBind();
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
        }