コード例 #1
0
        public void FillServersListGridfromSession()
        {
            DataTable DataServers = new DataTable();

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

                SharePointHealthGridView.DataSource = DataServers;
                SharePointHealthGridView.DataBind();
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
        }
コード例 #2
0
        protected void SharePointHealthGridView_SelectionChanged(object sender, EventArgs e)
        {
            if (SharePointHealthGridView.Selection.Count > 0)
            {
                if (Session["UserFullName"] != null)
                {
                    List <object> fieldValues = SharePointHealthGridView.GetSelectedFieldValues(new string[] { "redirectto" });
                    //7/22/2014 NS commented the line below, uncommented the following line - the page would auto redirect on each refresh
                    //Response.Redirect(fieldValues[0].ToString());

                    //Mukund: VSPLUS-844, Page redirect on callback
                    try
                    {
                        DevExpress.Web.ASPxWebControl.RedirectOnCallback(fieldValues[0].ToString());
                        Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback
                    }
                    catch (Exception ex)
                    {
                        Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                        //throw ex;
                    }
                }
            }
        }
コード例 #3
0
        public void FillServersListGrid()
        {
            DataTable memorydt = new DataTable();
            DataTable dt2      = new DataTable();

            memorydt = VSWebBL.DashboardBL.SharepointDetailsBL.Ins.GetSharePointServerDetails();
            dt2      = VSWebBL.DashboardBL.SharepointDetailsBL.Ins.GetSharePointServerHealthRoles();
            Session["SharePointServerList"] = memorydt;


            string Farmscount = memorydt.AsEnumerable().Select(s => s.Field <string>("Farm")).Distinct().Where(s => s.Contains(',') == false).ToList().Count.ToString();

            string serverscount = memorydt.Rows.Count.ToString();

            ASPxLabel143.Text = serverscount + " " + "Servers in " + Farmscount + " " + "Farms";
            //ServerList.Text = "0";
            //10/15/2014 NS added for VE-133
            DataRow rolerow;

            DataRow[] foundRows;
            DataRow   Memoryrow;

            rolerow   = srvroles.NewRow();
            Memoryrow = Spacelist.NewRow();
            if (dt2 != null && dt2.Rows.Count > 0)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    if (srvroles.Rows.Count > 0)
                    {
                        foundRows = srvroles.Select("Role = '" + dt2.Rows[i]["RoleName"].ToString() + "'");
                        if (foundRows.Length == 0)
                        {
                            rolerow              = srvroles.Rows.Add();
                            rolerow["Role"]      = dt2.Rows[i]["RoleName"].ToString();
                            rolerow["RoleCount"] = 1;
                            rolerow              = srvroles.NewRow();
                        }
                        else
                        {
                            rolerow = foundRows[0];
                            rolerow["RoleCount"] = Convert.ToInt32(rolerow["RoleCount"].ToString()) + 1;
                        }
                    }
                    else
                    {
                        rolerow              = srvroles.Rows.Add();
                        rolerow["Role"]      = dt2.Rows[i]["RoleName"].ToString();
                        rolerow["RoleCount"] = 1;
                        rolerow              = srvroles.NewRow();
                    }
                }
            }
            //if (memorydt != null && memorydt.Rows.Count > 0)
            //{
            //    for (int i = 0; i < memorydt.Rows.Count; i++)
            //    {
            //        if (Spacelist.Rows.Count > 0)
            //        {
            //            foundRows = Spacelist.Select("Memory = '" + memorydt.Rows[i]["ContentMemory"].ToString() + "'");
            //            if (foundRows.Length == 0)
            //            {
            //                Memoryrow = Spacelist.Rows.Add();
            //                Memoryrow["Memory"] = memorydt.Rows[i]["ContentMemory"].ToString() + "MB";
            //                Memoryrow["MemoryCount"] = 1;
            //                Memoryrow = Spacelist.NewRow();
            //            }
            //            else
            //            {
            //                Memoryrow = foundRows[0];
            //                Memoryrow["MemoryCount"] = Convert.ToInt32(Memoryrow["MemoryCount"].ToString() + "MB") + 1;
            //            }
            //        }
            //        else
            //        {
            //            Memoryrow = Spacelist.Rows.Add();
            //            Memoryrow["Memory"] = memorydt.Rows[i]["ContentMemory"].ToString() + "MB";
            //            Memoryrow["MemoryCount"] = 1;
            //            Memoryrow = Spacelist.NewRow();
            //        }
            //    }
            //}

            SharePointHealthGridView.DataSource = memorydt;


            SharePointHealthGridView.DataBind();
        }