Ejemplo n.º 1
0
        protected void RadTreeViewChucNang_Nodeclick(object sender, RadTreeNodeEventArgs e)
        {
            Int32 idNhomQuyen = Int32.Parse(RadTreeViewNhomQuyen.SelectedNode.Value);
            Int32 idChucNang  = Int32.Parse(RadTreeViewChucNang.SelectedNode.Value);

            LoadQuyen(idNhomQuyen, idChucNang);
        }
Ejemplo n.º 2
0
 protected void RadTreeView1_NodeExpand(object o, RadTreeNodeEventArgs e)
 {
     //if (e.NodeClicked.Nodes.Count == 0)
     //{
     //    //BindDirectory(e.NodeClicked.Value, e.NodeClicked.Nodes);
     //}
 }
Ejemplo n.º 3
0
        protected void PageTreeview_NodeDataBound(object sender, RadTreeNodeEventArgs e)
        {
            CmsSitePath path = (CmsSitePath)e.Node.DataItem;

            if (path.IsDirectory)
            {
                if (path.Depth == 1)
                {
                    e.Node.Expanded = true;
                    e.Node.Text = RootNodeValue;
                }

                e.Node.ContextMenuID = "DirectoryContextMenu";
                e.Node.ImageUrl = "~/Images/Vista/folder.png";
                e.Node.Category = CmsSiteMap.NodeTypes.Directory.ToString();
            }
            else
            {
                e.Node.AllowDrop = false;
                e.Node.ContextMenuID = "PageContextMenu";
                e.Node.ImageUrl = "~/Images/Vista/aspx.png";
                e.Node.Category = CmsSiteMap.NodeTypes.Page.ToString();
            }
            e.Node.ToolTip = e.Node.GetFullPath("/");
        }
Ejemplo n.º 4
0
        protected void Tree_NodeDataBound(object sender, RadTreeNodeEventArgs e)
        {
            if (e == null)
            {
                return;
            }

            object obj = DataBinder.Eval(e.Node.DataItem, "EntityNodeTypeId");

            if (!Support.IsNullOrDBNull(obj))
            {
                e.Node.Category = ((Guid)obj).ToString("N");
                if (this.EntityCustomNodeTypes[((Guid)obj).ToString("N")] == null)
                {
                    e.Node.ContextMenuID = "EmptyMenu";
                }
                else
                {
                    e.Node.ContextMenuID = "Menu" + e.Node.Category;
                }
            }
            else
            {
                e.Node.ContextMenuID = "Menu" + Guid.Empty.ToString("N");
            }
        }
Ejemplo n.º 5
0
 //选择往来单位分类树节点
 protected void RT_CompanyClass_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Node.Value))
     {
         RGCussent.Rebind();
     }
 }
Ejemplo n.º 6
0
        protected void radPublicationCategoryTreeView_NodeExpand(object sender, RadTreeNodeEventArgs e)
        {
            var categories = GetCategories(SiteID, Guid.Parse(e.Node.Value));

            foreach (var categoryItem in categories)
            {
                RadTreeNode node = new RadTreeNode();
                node.Value = categoryItem.Id.ToString();
                node.Text  = categoryItem.Title;
                node.Attributes.Add("Type", "Folder");
                node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                e.Node.Nodes.Add(node);
            }

//            var publications = dataManager.Publication.SelectByCategoryId(Guid.Parse(e.Node.Value)).Where(a => a.StatusID == (int)PublicationStatus.Published);
            var publications = dataManager.Publication.SelectByCategoryId(Guid.Parse(e.Node.Value));

            foreach (var publicationItem in publications)
            {
                RadTreeNode node = new RadTreeNode();
                node.Value    = publicationItem.ID.ToString();
                node.Text     = publicationItem.Title;
                node.ImageUrl = "~/App_Themes/Default/images/icoHelp.png";
                node.Attributes.Add("Type0", "Publication");
                node.Attributes.Add("Type", "Publication");
                e.Node.Nodes.Add(node);
            }
        }
 /// <summary>
 /// 点击事件公开
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void tvGoodsClass_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (TreeNodeClick != null)
     {
         TreeNodeClick(this, e);
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Handles the NodeDataBound event of the CategoriesCheckBoxTreeView control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="Telerik.Web.UI.RadTreeNodeEventArgs"/> instance containing the event data.</param>
 private void CategoriesCheckBoxTreeView_NodeDataBound(object sender, RadTreeNodeEventArgs e)
 {
     if (this.Categories != null & this.Categories.Contains(e.Node.Value))
     {
         e.Node.Checked = true;
     }
 }
Ejemplo n.º 9
0
        protected void CategoryTree_Menu_CategorySelected(object sender, RadTreeNodeEventArgs e)
        {
            ProductList_List.CategoryID = CategoryTree_Menu.Selected_CategoryID;
            //ProductList_List.ProductEdit_URL = "ProductEditor.aspx";

            MultiView_Product.SetActiveView(View_Product_List);
        }
Ejemplo n.º 10
0
        protected override void OnNodeDataBound(RadTreeNodeEventArgs e)
        {
            base.OnNodeDataBound(e);

            RadTreeNode node = e.Node;
            DataRowView data = (DataRowView)node.DataItem;

            String itemType = data["ItemType"] == DBNull.Value ? null : (String)data["ItemType"];

            if (String.Compare(itemType, "Menu", true) == 0)
            {
                node.ImageUrl = "~/Media/Icons/menu.gif";
                node.Checkable = true;
                node.Expanded = false;
            }
            else if (String.Compare(itemType, "MenuSection", true) == 0)
            {
                node.ImageUrl = "~/Media/Icons/point-triangle.gif";
                node.Checkable = false;
                node.Expanded = true;
            }
            else if (String.Compare(itemType, "MenuItem", true) == 0)
            {
                node.ImageUrl = "~/Media/Icons/point-circle.gif";
                node.Checkable = false;
            }
        }
Ejemplo n.º 11
0
 public void Tree_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (SelectedNodeChanged != null)
     {
         SelectedNodeChanged(this, new EventArgs());
     }
 }
Ejemplo n.º 12
0
    void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        var item = e.Node as RadTreeNode;

        if (item.Level == 1)
        {
            RadPane_Nav.ContentUrl = "";
        }
        else if (item.Level==2)  // 如果使用了 AjaxManager,此处无法用 ID来标识对象,就是内置的 Level也行
        {

            // 组合文件路径
            //item.FullPath
            //"Telerik Controls/Single/RadAsyncUpload"

            //Request.Url.AbsoluteUri
            //"http://localhost:5656/Telerik/TelerikMain.aspx"

            string nav_url = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/")) + item.FullPath.Substring(item.FullPath.IndexOf("/"))+".aspx";
            RadPane_Nav.ContentUrl = nav_url;

            // 不能用 ClientScript.RegisterStartupScript来注册客户端脚本对象
            //ClientScript.RegisterStartupScript(this.GetType(), "smmmmmm1", "alert('oj');", true);
            // 可以用 RadAjaxManager的 ResponseScripts对象进行注册
            //RadAjaxManager1.ResponseScripts.Add("alert('ok')");
        }
    }
Ejemplo n.º 13
0
        // Load Page
        protected void RadTreeView_WebSite_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            _selected_pageindexid             = e.Node.Value;
            ViewState["Selected_PageIndexID"] = _selected_pageindexid;

            OnPageIndexSelected(sender, e);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Handles the OnNodeDataBound event of the rtvRequirements control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.RadTreeNodeEventArgs"/> instance containing the event data.</param>
        protected void rtvRequirements_OnNodeDataBound(object sender, RadTreeNodeEventArgs e)
        {
            var requirement = (tbl_Requirement)e.Node.DataItem;

            e.Node.Text    = string.Format("Требование №{0} от {1} ({2})", requirement.Number, requirement.CreatedAt.ToString("dd.MM.yyyy"), requirement.ShortDescription);
            e.Node.Checked = ParentRequirementId == requirement.ID;
        }
 protected void rtvCatList_NodeClick(object o, RadTreeNodeEventArgs e)
 {
     tblEdit.Visible = true;
     BindingData(Convert.ToInt32(rtvCatList.SelectedNode.Value));
     btnSave.Visible   = false;
     btnUpdate.Visible = true;
 }
Ejemplo n.º 16
0
 protected void RadTreeView_WebSite_NodeExpand(object sender, RadTreeNodeEventArgs e)
 {
     if (e.Node.Nodes.Count == 0)
     {
         PopulateNodeOnDemand(e);
     }
 }
Ejemplo n.º 17
0
        protected void RadTreeView_Category_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            _selected_categoryid             = e.Node.Value;
            ViewState["Selected_CategoryID"] = _selected_categoryid;

            OnCategorySelected(sender, e);
        }
Ejemplo n.º 18
0
        protected void RtvCompanyCussentNodeClick(object sender, RadTreeNodeEventArgs e)
        {
            if (R_StartTime.DbSelectedDate == null)
            {
                StartTime = DateTime.MinValue;
                EndTime   = DateTime.MinValue;
            }
            else
            {
                if (R_StartTime.SelectedDate != null)
                {
                    StartTime = R_StartTime.SelectedDate.Value;
                    if (R_EndTime.SelectedDate != null)
                    {
                        EndTime = R_EndTime.DbSelectedDate == null ? DateTime.Now : R_EndTime.SelectedDate.Value;
                    }
                }
            }
            OrderNof    = !string.IsNullOrEmpty(TB_OrderNo.Text) ? TB_OrderNo.Text : string.Empty;
            SStockType  = Convert.ToInt32(RCB_SalesType.SelectedValue);
            WarehouseId = new Guid(RCB_Warehouse.SelectedValue);
            CompanyId   = new Guid(RTVCompanyCussent.SelectedNode.Value);
            //if (RTVCompanyCussent.SelectedNode.ToolTip.Equals("BusinessRelatedUnits"))
            //{

            //}
            //else
            //{
            //    HostingCompanyId = new Guid(RTVCompanyCussent.SelectedNode.Value);
            //    CompanyId = Guid.Empty;
            //}
            StockGrid.Rebind();
        }
Ejemplo n.º 19
0
 protected void RtCompanyClassNodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Node.Value))
     {
         RG_CheckInfo.Rebind();
     }
 }
Ejemplo n.º 20
0
        protected void RadTreeView1_Nodeclick(object sender, RadTreeNodeEventArgs e)
        {
            var dt = new object();

            if (e.Node.Level.Equals(0))
            {
                dt = _entities.GetCVUngVienByIDTuyendung(Int32.Parse(e.Node.Value));
            }
            else
            {
                dt = _entities.GetCVUngVienByVongTuyendung(Int32.Parse(e.Node.Value));
            }

            RadGrid1.DataSource = dt;
            RadGrid1.DataBind();

            if (RadGrid1.Items.Count > 0)
            {
                RadGrid1.Items[0].Selected = true;
                GridDataItem item       = RadGrid1.Items[0];
                Int32        IDNhanVien = Int32.Parse(item["IDNhanVien"].Text);
                FillCurrentEmployeeDetail(IDNhanVien);
                RadContextMenu1.Items.FindItemByValue("xoa").Enabled = true;
                RadContextMenu1.Items.FindItemByValue("sua").Enabled = true;
                CheckPermis();
            }
            else
            {
                RadContextMenu1.Items.FindItemByValue("xoa").Enabled = false;
                RadContextMenu1.Items.FindItemByValue("sua").Enabled = false;
            }
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Handles the NodeClick event of the treeCategories control
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">instance containing the event data.</param>
        protected void treeCategories_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            int faqCategoryId = Convert.ToInt32(e.Node.Value);

            EditCategory(faqCategoryId);
            cmdDelete.Visible = true;
        }
Ejemplo n.º 22
0
        protected void RadTreeView1_Nodeclick(object sender, RadTreeNodeEventArgs e)
        {
            var dt = new object();

            if (RadTreeView1.SelectedNode.Level != 0)
            {
                dt = _entities.GetHopDongByIDPhongBan(Int32.Parse(e.Node.Value));
            }
            else
            {
                dt = _entities.GetAllHopDong();
            }
            RadGrid1.DataSource = dt;
            RadGrid1.DataBind();

            if (RadGrid1.Items.Count > 0)
            {
                RadGrid1.Items[0].Selected = true;
                GridDataItem item = RadGrid1.Items[0];
                Int32        IDHD = Int32.Parse(item["IDHopDongLD"].Text);
                Session["idHD"] = IDHD;
                FillCurrentDetail(IDHD);
                RadContextMenu1.Items.FindItemByValue("xoa").Enabled = true;
                RadContextMenu1.Items.FindItemByValue("sua").Enabled = true;
            }
            else
            {
                RadContextMenu1.Items.FindItemByValue("xoa").Enabled = false;
                RadContextMenu1.Items.FindItemByValue("sua").Enabled = false;
            }
        }
Ejemplo n.º 23
0
 public void Tree_NodeClick (object sender, RadTreeNodeEventArgs e)
 {
     if (SelectedNodeChanged != null)
     {
         SelectedNodeChanged(this, new EventArgs());
     }
 }
Ejemplo n.º 24
0
            private void TreeNodeChecked(object sender, RadTreeNodeEventArgs e)
            {
                RadTreeNode node   = e.Node;
                int         termId = int.Parse(node.Value);

                if (node.Checked)
                {
                    //Add Term
                    foreach (Term term in Terms)
                    {
                        if (term.TermId == termId)
                        {
                            SelectedTerms.Add(term);
                            break;
                        }
                    }
                }
                else
                {
                    //Remove Term
                    foreach (Term term in SelectedTerms)
                    {
                        if (term.TermId == termId)
                        {
                            SelectedTerms.Remove(term);
                            break;
                        }
                    }
                }

                //Rebind
                _tree.DataBind();
            }
Ejemplo n.º 25
0
 /// <summary>
 /// Handles the NodeClick event of the rtvLocations control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RadTreeNodeEventArgs"/> instance containing the event data.</param>
 protected void rtvLocations_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (LocationChanged != null)
     {
         LocationChanged();
     }
 }
Ejemplo n.º 26
0
        protected void TreeViewLocationRad_NodeExpand(object sender, RadTreeNodeEventArgs e)
        {
            e.Node.Nodes.Clear();

            var parentId = long.Parse(e.Node.Value);

            if (e.Node.Level < 3)
            {
                var childNodes = _locationManager.GetQuery(p => p.IsActive && p.ParentLocationID == parentId && p.IsDeleted == false);

                var treeNodeExpandMode = e.Node.Level == 3 - 1 ? TreeNodeExpandMode.ClientSide : TreeNodeExpandMode.ServerSide;

                foreach (var item in childNodes)
                {
                    var node = new RadTreeNode
                    {
                        Text       = item.Title,
                        Value      = item.LocationID.ToString(),
                        ExpandMode = treeNodeExpandMode
                    };
                    var tmpParent = long.Parse(node.Value);
                    //node.ToolTip =
                    node.Category =
                        _locationManager.GetQuery(p => p.IsActive && p.ParentLocationID == tmpParent && p.IsDeleted == false).
                        Count().ToString();

                    e.Node.Nodes.Add(node);
                }
                e.Node.ExpandMode = TreeNodeExpandMode.ClientSide;
            }
            else
            {
                e.Node.Expanded = false;
            }
        }
Ejemplo n.º 27
0
 void _TreeView_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (TreeViewNodeSelected != null)
     {
         TreeViewNodeSelected(sender, e);
     }
 }
Ejemplo n.º 28
0
        //选择商品分类树节点
        protected void TvGoodsClassNodeClick(object sender, RadTreeNodeEventArgs e)
        {
            var classId = new Guid(e.Node.Value);

            if (!IsInster)
            {
                NonceGoodsClassInfo = new GoodsClassInfo();
                if (classId != Guid.Empty)
                {
                    var goodsClassInfo = _goodsCenterSao.GetClassDetail(classId);
                    if (goodsClassInfo.GoodsClassFieldList == null)
                    {
                        goodsClassInfo.GoodsClassFieldList = new List <Guid>();
                    }
                    NonceGoodsClassInfo = goodsClassInfo;
                    if (goodsClassInfo.GoodsClassFieldList.Count > 0)
                    {
                        GoodsClassFieldIdList = goodsClassInfo.GoodsClassFieldList;
                    }
                }
            }
            else
            {
                NonceGoodsClassInfo = new GoodsClassInfo {
                    ClassId = Guid.NewGuid(), ParentClassId = classId, ClassName = String.Empty
                };
            }
        }
 protected void tvCat_NodeDataBound(object sender, RadTreeNodeEventArgs e)
 {
     if (IsShowNodeId)
     {
         CategoryDto dataItem = e.Node.DataItem as CategoryDto;
         e.Node.Text = string.Format("{0} ({1})", dataItem.Name, dataItem.Id);
     }
 }
Ejemplo n.º 30
0
    protected void RadTreeView1_NodeBound(object o, RadTreeNodeEventArgs e)
    {
        ProductManager manager     = new ProductManager(this);
        ProductPart    productPart = manager.GetProductPart(Convert.ToInt32(e.Node.Value));

        e.Node.Text    += " (" + productPart.Quantity + ")";
        e.Node.Expanded = true;
    }
Ejemplo n.º 31
0
 protected void radTrvFunction_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     string redirectPage = e.Node.Value;
     if (!String.IsNullOrEmpty(redirectPage))
     {
         Response.Redirect(redirectPage);
     }
 }    
Ejemplo n.º 32
0
 protected void radPublicationCategoryTreeView_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (e.Node.Attributes["Type0"] == "Publication" || e.Node.Attributes["Type"] == "Publication")
     {
         Guid publicationId = Guid.Parse(e.Node.Value);
         _showPublication(publicationId);
     }
 }
Ejemplo n.º 33
0
        protected void trSupervisorChart_OnNodeClick(object sender, RadTreeNodeEventArgs e)
        {
            LinqDataSourceUser.WhereParameters.Clear();
            LinqDataSourceUser.WhereParameters.Add("Id", DbType.Int32, e.Node.Value);
            LinqDataSourceUser.Where = "UserId == @Id";

            RadGridInfo.DataBind();
        }
 protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
 {
     e.Node.ToolTip = e.Node.Text;
     if (e.Node.Text.Length > 50 - e.Node.Level)
     {
         e.Node.Text = e.Node.Text.Substring(0, 47 - e.Node.Level) + "...";
     }
 }
Ejemplo n.º 35
0
 //选择往来单位分类树节点
 protected void RT_CompanyClass_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Node.Value))
     {
         CompanyID = new Guid(e.Node.Value);
         RG_Power.Rebind();
     }
 }
 /// <summary>
 /// Populates the node on demand.
 /// </summary>
 /// <param name="e">The <see cref="Telerik.Web.UI.RadTreeNodeEventArgs"/> instance containing the event data.</param>
 /// <param name="expandMode">The expand mode.</param>
 protected void PopulateNodeOnDemand(object sender,RadTreeNodeEventArgs e)
 {
     /// "-" is used in values. So for nodes having "-" in data, is failing. To Avoid "#" is uses instead
     string[] strValue = e.Node.Value.Split("#".ToCharArray());
     int intHierarchy = 0;
     int.TryParse(strValue[1], out intHierarchy);
     intHierarchy++;
     BindChildNodes(strValue[0],intHierarchy.ToString() , e.Node);
 }
Ejemplo n.º 37
0
    protected void rtvSiteMaps_NodeExpand(object sender, RadTreeNodeEventArgs e)
    {
        parentId = Convert.ToInt32(e.Node.Value);
        rtvSiteMaps.DataBind();

        List<RadTreeNode> list = rtvSiteMaps.Nodes.Cast<RadTreeNode>().ToList();
        foreach (RadTreeNode node in list)
            e.Node.Nodes.Add(node);
    }
Ejemplo n.º 38
0
    public void Tree_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        // Fire SelectedNodeChanged. This is a bit of a cheat since we don't really know that
        // the node has changed when the user clicks on a node - but the same behavior needs
        // to be triggered anyway.

        if (this.SelectedNodeChanged != null)
        {
            SelectedNodeChanged (this, new EventArgs());
        }
    }
    public void Tree_SelectedNodeChanged (object sender, RadTreeNodeEventArgs args)
    {

        this.DropGeographies.Text = SelectedGeography.Name;
        this.DropGeographies.Items[0].Text = SelectedGeography.Name;
        this.DropGeographies.Items[0].Value = SelectedGeography.Identity.ToString();
        this.DropGeographies.Items[0].Selected = true;
        if (selectedNodeChanged != null)
        {
            selectedNodeChanged(sender, args);
        }
    }
Ejemplo n.º 40
0
 protected void groupTree_OnNodeClick(object sender, RadTreeNodeEventArgs e)
 {
     e.Node.Selected = true;
     pop.Visible = e.Node.Nodes.Count == 0;
     pop.Attributes["onclick"] = string.Format("popupPush('../Popup/PublishPush?{0}');",e.Node.Value);
     result.DataSource =
         HomoryContext.Value.Resource.Where(o => o.UserId == CurrentUser.Id && o.State == State.启用)
             .ToList()
             .Where(o => o.ResourceCatalog.Count(p => p.CatalogId == CatalogId && p.State == State.启用) > 0)
             .ToList();
     result.DataBind();
 }
        protected void rtvCompetencyValue_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            var humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployee(Company.CompanyId,
                                                            Convert.ToInt32(rtvCompetencyValue.SelectedValue));

            if (employee == null)
                return;

            pnlPurchaseCeilingValue.Visible = Convert.ToInt32(rtvCompetencyValue.SelectedValue) > 0;
            rbtCentralBuyer.Checked = employee.CentralBuyer ?? false;
        }
Ejemplo n.º 42
0
    protected void menu_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        RadTreeNode parent = menu.FindNodeByValue(JobEnum.NumericSettings.ToString());
        if (parent == null)
            return;
        
        RadTreeNode restartNode = parent.Nodes.FindNodeByValue(JobEnum.RestartServer.ToString());
        if (restartNode == null)
            return;

        ISession session = (ISession)Context.Items[Constant.NHibernateSessionSign];
        ServicesList.ConfigurationService.RestartServer(this.CurrentPlayer, session);
    }
Ejemplo n.º 43
0
    protected void rtvSitePages_NodeDataBound(object sender, RadTreeNodeEventArgs e)
    {
        var page = e.Node.DataItem as WebPage;

        //e.Node.FindControl<HtmlAnchor>("lnkSiteMaps").HRef = "WebPage.aspx?PageId=" + page.WebPageId;

        var lnkSiteMaps = e.Node.FindControl<HtmlAnchor>("lnkSiteMaps");
        lnkSiteMaps.Attributes["onclick"] = "top.$.lightbox('Site/WebPage.aspx?PageId=" + page.WebPageId + "&lightbox[iframe]=true');";
        lnkSiteMaps.Style.Add(HtmlTextWriterStyle.Color, page.IsPublished ? "default" : "grey");

        var lnkExternal = e.Node.FindControl<HtmlAnchor>("lnkExternal");
        lnkExternal.Attributes["class"] += page.IsPublished ? " webLink" : " draft";
        lnkExternal.Title = page.IsPublished ? "Publicado" : "Rascunho";

        if (page.WebPages.Count() > 0)
            e.Node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
    }
Ejemplo n.º 44
0
 protected void tree_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     tree.CollapseAllNodes();
     if (e.Node.Level == 0 && e.Node.Nodes.Count > 0)
     {
         e.Node.Nodes[0].Selected = true;
         e.Node.Nodes[0].ExpandParentNodes();
         e.Node.Nodes[0].ExpandChildNodes();
         e.Node.Nodes[0].Expanded = true;
     }
     else
     {
         e.Node.Selected = true;
         e.Node.ExpandParentNodes();
         e.Node.ExpandChildNodes();
         e.Node.Expanded = true;
     }
     view.Rebind();
 }
 protected void StandardsFilterRadTree_NodeDataBound(object sender, RadTreeNodeEventArgs e)
 {
     var node = e.Node;
     
     if(node.ParentNode == null)
     {
         node.CssClass = "RadTreeView_Thinkgate_TreeView_ParentNode";
         var link = (ImageButton)node.FindControl("editLink");
         if (link != null)
         {
             var dataRowView = (DataRowView)node.DataItem;
             HyperLink tempLink = new HyperLink();
             tempLink.NavigateUrl = "~/Controls/Standards/StandardsFilterEdit.aspx?filterName=";
             string linkURL = tempLink.ResolveClientUrl(tempLink.NavigateUrl) + dataRowView["Name"];
             link.OnClientClick = "customDialog({url: '" + linkURL + "', title: 'Edit Standard Filter',maximize: true}); return false;";
             link.Visible = true;
             link.Attributes["style"] = "cursor:pointer;";
         }
     }
 }
Ejemplo n.º 46
0
    protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        FileStream liveStream = null;

        try
        {
          //if (e.Node.NavigateUrl.Length == 0)
          if (e.Node.ImageUrl.Length == 0)
          {
        liveStream = new FileStream(e.Node.Value, FileMode.Open,
                                         FileAccess.Read);

        byte[] buffer = new byte[(int)liveStream.Length];
        liveStream.Read(buffer, 0, (int)liveStream.Length);
        liveStream.Close();

        //An empty buffer will throw an exception when doing the binary write so fill with 1
        if (buffer.Length == 0)
          buffer = new byte[1];

        Response.Clear();
        Response.ContentType = "application/octet-stream";
        Response.AddHeader("Content-Length", buffer.Length.ToString());
        Response.AddHeader("Content-Disposition", "attachment; filename=" +
                           e.Node.Text);
        Response.BinaryWrite(buffer);
        Response.End();
          }
        }
        catch (Exception ex)
        {
        }
        finally
        {
          if (liveStream != null)
          {
        liveStream.Dispose();
        liveStream = null;
          }
        }
    }
Ejemplo n.º 47
0
        protected void treeView1_NodeMouseClick(object sender, RadTreeNodeEventArgs e)
        {
            lblThongbao.Text = "";
            DataTable dt_Item_LXN = new DataTable();
            int id = Convert.ToInt32(rtvCtChung.SelectedNode.Value);
            dt_Item_LXN = _pxnBso.Get_Item_LXN(id);
            txtTenLXN.Text = dt_Item_LXN.Rows[0]["TenLoaiXN"].ToString().Trim();
            txtIndex.Text = dt_Item_LXN.Rows[0]["Index"].ToString().Trim();
            hdfId_Cha.Value = dt_Item_LXN.Rows[0]["ID_Cha"].ToString().Trim();
            hdfID.Value = dt_Item_LXN.Rows[0]["ID"].ToString().Trim();


            if (hdfId_Cha.Value.Trim() == "0")
            {
                hpl_AddChild.Visible = true;
            }
            else
            {
                hpl_AddChild.Visible = false;
            }
        }
Ejemplo n.º 48
0
 protected void treeX_OnNodeClick(object sender, RadTreeNodeEventArgs e)
 {
     e.Node.Selected = true;
     e.Node.Expanded = true;
     view.Rebind();
 }
Ejemplo n.º 49
0
 protected void tree_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     tree.CollapseAllNodes();
     e.Node.Selected = true;
     e.Node.ExpandParentNodes();
     e.Node.Expanded = true;
     AutoGenerateGrades();
     grid.Rebind();
     gridX.Rebind();
     LoadCharging();
     BindTreeX();
     view.Rebind();
 }
Ejemplo n.º 50
0
 protected void CtlPagesNodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (e.Node.Attributes["isPortalRoot"] != null && Boolean.Parse(e.Node.Attributes["isPortalRoot"]))
     {
         pnlDetails.Visible = false;
         pnlBulk.Visible = false;
     }
     else
     {
         var tabid = Convert.ToInt32(e.Node.Value);
         BindTab(tabid);
     }
 }
Ejemplo n.º 51
0
 protected void CtlPagesNodeExpand(object sender, RadTreeNodeEventArgs e)
 {
     AddChildNodes(e.Node);
 }
        protected void trFunction_NodeCheck(object sender, RadTreeNodeEventArgs e)
        {
            if (bProcessing ) return;
            RadTreeNode currentNode = default(RadTreeNode);
            RadTreeNode parentNode = default(RadTreeNode);
            //RadTreeNode objTreeNode = default(RadTreeNode);
            try {
            currentNode = e.Node;
            parentNode = currentNode.ParentNode;
            bProcessing = true;
            //  đặt không xử lý sự kiện AfterCheck nữa
            if (currentNode.Checked) {
            // check tat ca cac nut con
            foreach (RadTreeNode objTreeNode in currentNode.Nodes) {
                objTreeNode.Checked = true;
                CheckNodeCon(objTreeNode);
            }
            if ((parentNode != null)) {
                bool checkAll = false;
                // xet tat ca cac nut ngang hang voi currentNode
                foreach ( RadTreeNode objTreeNode in parentNode.Nodes) {
                    if (objTreeNode.Checked == true) {
                        checkAll = true;
                        break; // TODO: might not be correct. Was : Exit For
                    }
                }
                //While Not currentNode Is Nothing
                //    If currentNode.Checked = False Then
                //        checkAll = False
                //        Exit While
                //    Else
                //        currentNode = currentNode.NextNode
                //    End If
                //End While
                while ((parentNode != null)) {
                    parentNode.Checked = checkAll;
                    parentNode = parentNode.ParentNode;
                }

            }
            } else {
            //bo check tat ca cac nut con
            foreach (RadTreeNode objTreeNode in currentNode.Nodes)
            {
                objTreeNode.Checked = false;
                UnCheckNodeCon(objTreeNode);
            }
            if ((parentNode != null)) {
                bool checkAll = false;
                while ((currentNode != null)) {
                    if (currentNode.Checked == true) {
                        checkAll = true;
                        break; // TODO: might not be correct. Was : Exit While
                    }
                    currentNode = currentNode.Next;
                }
                currentNode = e.Node;
                while ((currentNode != null)) {
                    if (currentNode.Checked == true) {
                        checkAll = true;
                        break; // TODO: might not be correct. Was : Exit While
                    }
                    currentNode = currentNode.Prev;
                }
                //Dim UnCheckAll As Boolean = False
                //For Each objTreeNode In parentNode.Nodes   ' xet tat ca cac nut ngang hang voi currentNode
                //    If objTreeNode.Checked Then
                //        UnCheckAll = True
                //        Exit For
                //    End If
                //Next
                parentNode.Checked = checkAll;
            }
            //If Not (parentNode Is Nothing) Then parentNode.Checked = False
            }
            bProcessing = false;
            } catch (Exception ex) {

            bProcessing = false;
            }
        }
 protected void trFunction_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (trFunction.SelectedNodes.Count == 0) return;
     CheckDepartment(gridGroup.SelectedValue.ToString(),trFunction.SelectedValue.ToString());
     trDepartment.ExpandAllNodes();
 }
Ejemplo n.º 54
0
        /// <summary>
        /// Load Files of Selected Folder
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RadTreeNodeEventArgs" /> instance containing the event data.</param>
        private void FoldersTree_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            var newDir = this.FoldersTree.SelectedNode.Value;

            this.lblCurrentDir.Text = !newDir.EndsWith("\\") ? string.Format("{0}\\", newDir) : newDir;

            this.ShowFilesIn(newDir);

            // Reset selected file
            this.SetDefaultLinkTypeText();

            this.FileId.Text = null;
            this.lblFileName.Text = null;

            // Expand Sub folders (if) exists
            this.FoldersTree.SelectedNode.Expanded = true;
        }
Ejemplo n.º 55
0
        /// <summary>
        /// Show Preview of the Page links
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RadTreeNodeEventArgs"/> instance containing the event data.</param>
        private void TreeTabs_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            if (this.dnntreeTabs.SelectedNode == null)
            {
                return;
            }

            this.SetDefaultLinkTypeText();

            var tabController = new TabController();

            var selectTab = tabController.GetTab(
                int.Parse(this.dnntreeTabs.SelectedValue), this._portalSettings.PortalId, true);

            string sFileName;
            string sDomainName = string.Format("http://{0}", Globals.GetDomainName(this.Request, true));

            // Add Language Parameter ?!
            var localeSelected = this.LanguageRow.Visible && this.LanguageList.SelectedIndex > 0;

            if (this.chkHumanFriendy.Checked)
            {
                sFileName = localeSelected
                                ? Globals.FriendlyUrl(
                                    selectTab,
                                    string.Format(
                                        "{0}&language={1}",
                                        Globals.ApplicationURL(selectTab.TabID),
                                        this.LanguageList.SelectedValue),
                                    this._portalSettings)
                                : Globals.FriendlyUrl(
                                    selectTab, Globals.ApplicationURL(selectTab.TabID), this._portalSettings);

                // Relative Url
                sFileName = Globals.ResolveUrl(Regex.Replace(sFileName, sDomainName, "~", RegexOptions.IgnoreCase));

                this.rblLinkType.Items[0].Text = Regex.Replace(
                    this.rblLinkType.Items[0].Text,
                    "/Images/MyImage.jpg",
                    Globals.ResolveUrl(Regex.Replace(sFileName, sDomainName, "~", RegexOptions.IgnoreCase)),
                    RegexOptions.IgnoreCase);

                // Absolute Url
                this.rblLinkType.Items[1].Text = Regex.Replace(
                    this.rblLinkType.Items[1].Text,
                    "http://www.MyWebsite.com/Images/MyImage.jpg",
                    Regex.Replace(sFileName, sDomainName, string.Format("{0}", sDomainName), RegexOptions.IgnoreCase),
                    RegexOptions.IgnoreCase);
            }
            else
            {
                string locale = localeSelected ? string.Format("language/{0}/", this.LanguageList.SelectedValue) : string.Empty;

                // Relative Url
                this.rblLinkType.Items[0].Text = Regex.Replace(
                    this.rblLinkType.Items[0].Text,
                    "/Images/MyImage.jpg",
                    Globals.ResolveUrl(string.Format("~/tabid/{0}/{1}Default.aspx", selectTab.TabID, locale)),
                    RegexOptions.IgnoreCase);

                // Absolute Url
                this.rblLinkType.Items[1].Text = Regex.Replace(
                    this.rblLinkType.Items[1].Text,
                    "http://www.MyWebsite.com/Images/MyImage.jpg",
                    string.Format("{2}/tabid/{0}/{1}Default.aspx", selectTab.TabID, locale, sDomainName),
                    RegexOptions.IgnoreCase);
            }

            /////

            var secureLink = Globals.LinkClick(
                selectTab.TabID.ToString(), int.Parse(this.request.QueryString["tabid"]), Null.NullInteger);

            if (secureLink.Contains("&language"))
            {
                secureLink = secureLink.Remove(secureLink.IndexOf("&language"));
            }

            this.rblLinkType.Items[2].Text =
                this.rblLinkType.Items[2].Text.Replace(@"/LinkClick.aspx?fileticket=xyz", secureLink);

            var absoluteUrl = string.Format(
                "{0}://{1}{2}",
                HttpContext.Current.Request.Url.Scheme,
                HttpContext.Current.Request.Url.Authority,
                secureLink);

            this.rblLinkType.Items[3].Text =
                this.rblLinkType.Items[3].Text.Replace(
                    @"http://www.MyWebsite.com/LinkClick.aspx?fileticket=xyz", absoluteUrl);

            if (this.currentSettings.UseAnchorSelector)
            {
                this.FindAnchorsOnTab(selectTab);
            }

            this.Page.ClientScript.RegisterStartupScript(
                this.GetType(),
                string.Format("hideLoadingScript{0}", Guid.NewGuid()),
                "jQuery('#panelLoading').hide();",
                true);
        }
        protected void resourceFiles_NodeExpand(object sender, RadTreeNodeEventArgs e)
        {
            RadTreeNode node = default(RadTreeNode);
            switch (e.Node.Value)
            {
                case "Local Resources":
                    node = new RadTreeNode();
                    node.Text = "Admin";
                    node.Value = Server.MapPath("~/Admin");
                    node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                    e.Node.Nodes.Add(node);
                    node = new RadTreeNode();
                    node.Text = "Controls";
                    node.Value = Server.MapPath("~/Controls");
                    node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                    e.Node.Nodes.Add(node);
                    node = new RadTreeNode();
                    node.Text = "DesktopModules";
                    node.Value = Server.MapPath("~/DesktopModules");
                    node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                    e.Node.Nodes.Add(node);
                    node = new RadTreeNode();
                    node.Text = "Install";
                    node.Value = Server.MapPath("~/Install");
                    node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                    e.Node.Nodes.Add(node);
                    node = new RadTreeNode();
                    node.Text = "Providers";
                    node.Value = Server.MapPath("~/Providers");
                    node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                    e.Node.Nodes.Add(node);

                    node = new RadTreeNode();
                    node.Text = "HostSkins";
                    node.Value = Path.Combine(Globals.HostMapPath, "Skins");
                    node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                    e.Node.Nodes.Add(node);

                    string portalSkinFolder = Path.Combine(PortalSettings.HomeDirectoryMapPath, "Skins");
                    if (Directory.Exists(portalSkinFolder) && (PortalSettings.ActiveTab.ParentId == PortalSettings.AdminTabId))
                    {
                        node = new RadTreeNode();
                        node.Text = "PortalSkins";
                        node.Value = Path.Combine(PortalSettings.HomeDirectoryMapPath, "Skins");
                        node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                        e.Node.Nodes.Add(node);
                    }
                    break;
                case "Global Resources":
                    node = new RadTreeNode();
                    node.Text = "Exceptions";
                    node.Value = Server.MapPath("~/App_GlobalResources/Exceptions");
                    e.Node.Nodes.Add(node);
                    node = new RadTreeNode();
                    node.Text = Path.GetFileNameWithoutExtension(Localization.GlobalResourceFile);
                    node.Value = Server.MapPath(Localization.GlobalResourceFile);
                    e.Node.Nodes.Add(node);
                    node = new RadTreeNode();
                    node.Text = Path.GetFileNameWithoutExtension(Localization.SharedResourceFile);
                    node.Value = Server.MapPath(Localization.SharedResourceFile);
                    e.Node.Nodes.Add(node);
                    node = new RadTreeNode();
                    node.Text = "Template";
                    node.Value = Server.MapPath("~/App_GlobalResources/Template");
                    e.Node.Nodes.Add(node);
                    node = new RadTreeNode();
                    node.Text = "WebControls";
                    node.Value = Server.MapPath("~/App_GlobalResources/WebControls");
                    e.Node.Nodes.Add(node);
                    break;
                default:
                    foreach (string folder in Directory.GetDirectories(e.Node.Value))
                    {
                        var folderInfo = new DirectoryInfo(folder);
                        node = new RadTreeNode();
                        node.Value = folderInfo.FullName;
                        node.Text = folderInfo.Name;
                        node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;

                        if (folderInfo.GetFiles("*.resx").Length > 0 || folderInfo.GetDirectories().Length > 0)
                        {
                            e.Node.Nodes.Add(node);
                        }
                    }

                    // split filenames at dots,
                    // only accept filenames with 3 elements or less, that means these types of filenames:
                    // SharedResources.resx and HtmlModule.ascx.resx
                    // explicitly ignore these filenames:
                    // EditHtml.ascx.Host.resx, EditHtml.ascx.[culture].Host.resx and , EditHtml.ascx.[culture].Portal-n.resx,
                    // SharedResources.[culture].Host.resx and SharedResources.culture.Portal-n.resx
                    foreach (var fileInfo in from file in Directory.GetFiles(e.Node.Value, "*.resx") select new FileInfo(file) into fileInfo let s = fileInfo.Name.Split('.') where s.Length <= 3 select fileInfo)
                    {
                        node = new RadTreeNode { Value = fileInfo.FullName, Text = fileInfo.Name.Replace(".resx", "") };
                        e.Node.Nodes.Add(node);
                    }

                    break;
            }

            e.Node.Expanded = true;
        }
 protected void resourceFiles_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     try
     {
         if (e.Node.Nodes.Count == 0)
         {
             SelectedResourceFile = e.Node.Value;
             try
             {
                 BindGrid(true);
             }
             catch
             {
                 UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("Save.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning);
             }
         }
         //Module failed to load
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
 protected void RadTreeView1_NodeBound(object o, RadTreeNodeEventArgs e)
 {
     ProductManager manager = new ProductManager(this);
     ProductPart productPart = manager.GetProductPart(Convert.ToInt32(e.Node.Value));
     e.Node.Text += " (" + productPart.Quantity + ")";
     e.Node.Expanded = true;
 }
Ejemplo n.º 59
0
 protected void RadTreeView1_NodeExpand(object sender, RadTreeNodeEventArgs e)
 {
     PopulateDirNode(e.Node.Value, e.Node);
 }
Ejemplo n.º 60
0
 protected void trDepartment_NodeClick(object sender, RadTreeNodeEventArgs e)
 {
     if (trDepartment.SelectedNodes.Count == 0) return;
     LoadEmployeeFollowDepart(Convert.ToInt32(trDepartment.SelectedValue),Convert.ToInt16(chkNhanVien.Checked.GetHashCode()));
 }