Пример #1
0
 protected void CollapseAllButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (CollapseAllButton.Text == "Collapse All")
         {
             ServersTreeList.CollapseAll();
             CollapseAllButton.Image.Url = "~/images/icons/add.png";
             CollapseAllButton.Text      = "Expand All";
         }
         else
         {
             ServersTreeList.ExpandAll();
             CollapseAllButton.Image.Url = "~/images/icons/forbidden.png";
             CollapseAllButton.Text      = "Collapse All";
         }
     }
     catch (Exception ex)
     {
         //Log.Entry.Ins.Write(Server.MapPath("~/LogFiles/"), "VSPlusLog.txt", DateTime.Now.ToString() + " Error in Page: " +
         //    Request.Url.AbsolutePath + ", Method: " + System.Reflection.MethodBase.GetCurrentMethod().Name +
         //    ", Error: " + ex.ToString());
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
         throw ex;
     }
 }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            errorDiv.Style.Value = "display: none";

            if (Request.QueryString["EventKey"] != null && Request.QueryString["EventKey"] != "")
            {
                flag          = "update";
                EventKey      = Convert.ToInt16(Request.QueryString["EventKey"].ToString());
                Session["ID"] = EventKey;
                if (!IsPostBack)
                {
                    Session["key"] = null;
                    fillData(EventKey);
                }
            }
            else
            {
                flag = "insert";
            }

            if (!IsPostBack)
            {
                //if (flag == "update")
                //    fillData(EventKey);
                FillDELSGrid();
                fillServersTreeList();
                ServersTreeList.CollapseAll();
                if (Session["UserPreferences"] != null)
                {
                    DataTable UserPreferences = (DataTable)Session["UserPreferences"];
                    foreach (DataRow dr in UserPreferences.Rows)
                    {
                        if (dr[1].ToString() == "DELS_Edit|DELSGridView")
                        {
                            DELSGridView.SettingsPager.PageSize = Convert.ToInt32(dr[2]);
                        }
                    }
                }
            }
            else
            {
                FillDELSGridfromSession();
                fillServersTreefromSession();
                ServersTreeList.CollapseAll();
            }
        }
Пример #3
0
 protected void CollapseAllSrvButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (CollapseAllSrvButton.Text == "Collapse All")
         {
             ServersTreeList.CollapseAll();
             CollapseAllSrvButton.Image.Url = "~/images/icons/add.png";
             CollapseAllSrvButton.Text      = "Expand All";
         }
         else
         {
             ServersTreeList.ExpandAll();
             CollapseAllSrvButton.Image.Url = "~/images/icons/forbidden.png";
             CollapseAllSrvButton.Text      = "Collapse All";
         }
     }
     catch (Exception ex)
     {
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
     }
 }
Пример #4
0
        public void fillServersTreeList()
        {
            try
            {
                ServersTreeList.CollapseAll();
                CollapseAllSrvButton.Image.Url = "~/images/icons/add.png";
                CollapseAllSrvButton.Text      = "Expand All";
                if (Session["DataServers"] == null)
                {
                    DataTable DataServersTree = VSWebBL.ConfiguratorBL.ELSBL.Ins.GetServersFromProcedure();
                    Session["DataServers"] = DataServersTree;
                }
                ServersTreeList.DataSource = (DataTable)Session["DataServers"];
                ServersTreeList.DataBind();

                DataTable dtSel = VSWebBL.ConfiguratorBL.ELSBL.Ins.GetSelectedServers(EventKey);
                if (dtSel.Rows.Count > 0)
                {
                    TreeListNodeIterator iterator = ServersTreeList.CreateNodeIterator();
                    TreeListNode         node;
                    for (int i = 0; i < dtSel.Rows.Count; i++)
                    {
                        if (Convert.ToInt32(dtSel.Rows[i]["ServerID"]) == 0 && Convert.ToInt32(dtSel.Rows[i]["LocationID"]) == 0)
                        {
                            //select all
                            while (true)
                            {
                                node = iterator.GetNext();
                                if (node == null)
                                {
                                    break;
                                }
                                node.Selected = true;
                            }
                        }
                        else if (Convert.ToInt32(dtSel.Rows[i]["ServerID"]) == 0 && (Convert.ToInt32(dtSel.Rows[i]["LocationID"]) != 0))
                        {
                            //parent selected
                            while (true)
                            {
                                node = iterator.GetNext();
                                if (node == null)
                                {
                                    break;
                                }
                                if ((Convert.ToInt32(dtSel.Rows[i]["LocationID"]) == Convert.ToInt32(node.GetValue("actid"))) && node.GetValue("tbl").ToString() == "Locations")
                                {
                                    node.Selected = true;
                                }
                                else if (node.GetValue("LocId").ToString() != "")
                                {
                                    if ((Convert.ToInt32(dtSel.Rows[i]["LocationID"]) == Convert.ToInt32(node.GetValue("LocId"))) && node.GetValue("tbl").ToString() != "Locations")
                                    {
                                        node.Selected = true;
                                    }
                                }
                            }
                        }
                        else if (Convert.ToInt32(dtSel.Rows[i]["ServerID"]) != 0 && (Convert.ToInt32(dtSel.Rows[i]["LocationID"]) != 0))
                        {
                            //specific selected
                            while (true)
                            {
                                node = iterator.GetNext();
                                if (node == null)
                                {
                                    break;
                                }
                                if ((Convert.ToInt32(dtSel.Rows[i]["ServerID"]) == Convert.ToInt32(node.GetValue("actid"))) &&
                                    node.GetValue("tbl").ToString() != "Locations")
                                {
                                    node.Selected = true;
                                }
                            }
                        }
                        iterator.Reset();
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
            }
        }