private void webTree_NodeBound(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { //************************************************************* // Copy Item Id to node Tag so that Client script can access it //************************************************************* e.Node.Tag = e.Node.DataKey.ToString(); //************************************************************* // Clean Nodes text (remove common text with parents) //************************************************************* Infragistics.WebUI.UltraWebNavigator.Node n = e.Node; Utils.CleanNodeText(ref n); }
private void treeMenu_NodeClicked(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { if (e.Node.Tag != null && e.Node.Tag is RptViewEntry) { this.txtEntryCodeQuery.Text = ((RptViewEntry)e.Node.Tag).EntryCode; } else { this.txtEntryCodeQuery.Text = ""; } this.gridHelper.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Query); }
protected void webTree_DemandLoad(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { bool showObsolete; bool level1Flag; if (bLinkFrom) { CheckBox cb = (CheckBox)uwToolbar.Items.FromKeyCustom("chkObs").FindControl("chkObsolete"); showObsolete = cb.Checked; } else { showObsolete = true; } if (Ultrawebtoolbar2.Items.FromKeyCustom("LoadLevel1").Visible) { CheckBox checkLoad = (CheckBox)Ultrawebtoolbar2.Items.FromKeyCustom("LoadLevel1").FindControl("chkLoad"); level1Flag = checkLoad.Checked; } else { level1Flag = false; } // Get children //ds = Link.GetTreeView(linkTypeId, Convert.ToByte(bLinkFrom), SessionState.Culture.Code, Convert.ToInt64(e.Node.DataKey), itemId, Convert.ToByte(showObsolete), Convert.ToByte(level1Flag)); //Added by Venkata 07-10-16 ds = GetTreeView(linkTypeId, Convert.ToByte(bLinkFrom), SessionState.Culture.Code, Convert.ToInt64(e.Node.DataKey), itemId, Convert.ToByte(showObsolete), Convert.ToByte(level1Flag)); //end if (ds != null) { if (ds.Tables.Count > 0) { e.Node.DataBind(ds.Tables[0].DefaultView, "Items"); e.Node.Expanded = true; currentNodeId = String.Format("{0}{1}", webTree.UniqueID.Replace("$", ""), e.Node.GetIdString()); Page.DataBind(); if (ds != null) { ds.Dispose(); } } } }
protected void treeDocument_NodeSelectionChanged(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { if (e.Node.Tag != null) { this.txtDocDirQuery.Text = ((DocumentTreeNode)e.Node.Tag).docDir.Dirserial.ToString(); DocumentTreeNode parentNode = (DocumentTreeNode)e.Node.Tag; string title = ""; title = parentNode.docDir.Dirname; while (parentNode.docDir.Pdirserial != 0) { parentNode = (DocumentTreeNode)parentNode.Parent; title = parentNode.docDir.Dirname + "\\" + title; } if (String.IsNullOrEmpty(title)) { title = this.languageComponent1.GetLanguage("documentRoot").ControlText; } else { title = this.languageComponent1.GetLanguage("documentRoot").ControlText + "\\" + title; } this.lblDocDirTitle.Text = title; } else { this.txtDocDirQuery.Text = ""; } //if (_DocumentFacade == null) //{ // _DocumentFacade = new DocumentFacade(this.DataProvider); //} //if (_DocumentFacade.GetDocDirRight(int.Parse(((DocumentTreeNode)e.Node.Tag).docDir.Dirserial.ToString()), this.GetUserCode(), "CHECK")) //{ // cmdCheck.Disabled = false; //} //else //{ // cmdCheck.Disabled = true; //} this.gridHelper.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Query); }
protected void treeDocument_NodeSelectionChanged(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { if (e.Node.Tag != null) { DocumentTreeNode parentNode = (DocumentTreeNode)e.Node.Tag; this.txtDocDirQuery.Text = parentNode.docDir.Dirserial.ToString(); string title = ""; title = parentNode.docDir.Dirname; while (parentNode.docDir.Pdirserial != 0) { parentNode = (DocumentTreeNode)parentNode.Parent; title = parentNode.docDir.Dirname + "\\" + title; } if (String.IsNullOrEmpty(title)) { title = this.languageComponent1.GetLanguage("documentRoot").ControlText; } else { title = this.languageComponent1.GetLanguage("documentRoot").ControlText + "\\" + title; } this.lblDocDirTitle.Text = title; } else { this.txtDocDirQuery.Text = ""; } this.gridHelper.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Query); try { this.drpParentDirCodeEdit.SelectedValue = this.txtDocDirQuery.Text; } catch { this.drpParentDirCodeEdit.SelectedIndex = 0; } }
protected void treeMenu_NodeSelectionChanged(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { if (e.Node.Tag != null) { this.txtMenuCodeQuery.Text = ((MenuTreeNode)e.Node.Tag).MenuWithUrl.MenuCode; } else { this.txtMenuCodeQuery.Text = ""; } this.gridHelper.RequestData(); this.buttonHelper.PageActionStatusHandle(PageActionType.Query); try { this.drpParentMenuCodeEdit.SelectedValue = this.txtMenuCodeQuery.Text; } catch { this.drpParentMenuCodeEdit.SelectedIndex = 0; } }
protected void webTree_NodeBound(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { //if (e.Node.Level == 3) e.Node.Text = "[" + e.Node.DataKey + "] " + e.Node.Text; }
private void webTree_NodeBound(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { //************************************************************* // Flag node if it has childs //************************************************************* try { if (e.Node.DataKey != null) { //Response.Write("<font size=1 face=verdana>Table Count = " + ds.Tables.Count.ToString()); //Response.Write("<br>DataKey = " + e.Node.DataKey.ToString()); DataTable dtChildren = e.Node.DataKey.ToString() == "-1" ? ds.Tables[0] : ds.Tables.Count > 1 ? ds.Tables[1] : ds.Tables[0]; //Response.Write("<br>Rows Count = " + dtChildren.Rows.Count.ToString()); //Response.Write("<br>"); DataRow dr = dtChildren.Select("ItemId = " + e.Node.DataKey.ToString())[0]; e.Node.ShowExpand = Convert.ToInt32(dr["ChildCount"]) > 0; //************************************************************* // if node is project, put in different style //************************************************************* if (Convert.ToBoolean(dr["IsProject"])) { e.Node.CssClass = "hc_pnode"; e.Node.HoverClass = "hc_opnode"; e.Node.HiliteClass = "hc_spnode"; } e.Node.TargetFrame = e.Node.Text; //************************************************************* // Copy Item Id to node Tag so that Client script can access it //************************************************************* e.Node.Tag = e.Node.DataKey.ToString(); if (e.Node.ShowExpand && e.Node.Nodes.Count == 0) { e.Node.Tag += "|needsLoadOnDemand"; Node loadNode = e.Node.Nodes.Add("<img src='/hc_v4/img/ed_wait.gif'/>Loading..."); loadNode.ImageUrl = "/hc_v4/ig/s_blank.gif"; e.Node.Expanded = false; } if (e.Node.Parent != null) { string tag = e.Node.Parent.Tag.ToString(); if (tag.IndexOf("|needsLoadOnDemand") > 0) { e.Node.Parent.Tag = tag.Replace("|needsLoadOnDemand", String.Empty); if (e.Node.Parent.Nodes[0].Text.EndsWith("Loading...")) { e.Node.Parent.Nodes.RemoveAt(0); } } } //************************************************************* // if node has a roll, put image //************************************************************* if (Convert.ToBoolean(dr["HasRoll"])) { e.Node.Text = "<img src='/hc_v4/img/ed_roll.gif'> " + e.Node.Text; } //************************************************************* // if node is country specific //************************************************************* if (Convert.ToBoolean(dr["IsCountrySpecific"])) { e.Node.Text = "<img src='/hc_v4/img/M.gif'> " + e.Node.Text; } // Add status for obsolete and future string status = dr["Status"].ToString(); e.Node.ImageUrl = e.Node.SelectedImageUrl = "/hc_v4/ig/s_" + status + ".gif"; // If level Is Sku level, update Icon int levelId = Convert.ToInt32(dr["LevelId"]); if (levelId == SkuLevel) { e.Node.ImageUrl = "/hc_v4/img/type_" + dr["ItemTypeId"].ToString() + ".png"; if (e.Node.TargetUrl == "1") // Top Value { e.Node.ImageUrl = "/hc_v4/img/type_1.png"; } e.Node.SelectedImageUrl = e.Node.ImageUrl; switch (status.ToLower()) { case ("o"): e.Node.Text = "<font color=gray>[O] </font>" + e.Node.Text; break; case ("f"): e.Node.Text = "<font color=green>[F] </font>" + e.Node.Text; break; case ("e"): e.Node.Text = "<font color=red>[E] </font>" + e.Node.Text; break; } } else { if (levelId > SkuLevel) { e.Node.SelectedImageUrl = e.Node.ImageUrl = "/hc_v4/img/option.png"; } } //************************************************************* // Item deleted //************************************************************* if (Convert.ToInt32(dr["PMDeleted"]) > 0) { e.Node.Style.CustomRules += "text-decoration:line-through;"; } //************************************************************* // Clean Nodes text (remove common text with parents) //************************************************************* Infragistics.WebUI.UltraWebNavigator.Node n = e.Node; //// Moueen Code for SMO #region COMPANY COLUMN if (e.Node.Level == 1) { string company = string.Empty; int defaultCompany = 0; using (Database dbObj = Utils.GetMainDB()) { using (SqlDataReader rs = dbObj.RunSPReturnRS("[GetCompanyInfoFromItemId]", new SqlParameter("@ItemId", e.Node.DataKey), new SqlParameter("@AlwaysDefault", defaultCompany))) { if ((dbObj.LastError == string.Empty) && (rs.HasRows)) { rs.Read(); company = rs["Company_Info"].ToString(); } } } if (!string.IsNullOrEmpty(company)) { e.Node.Text = company + "-" + e.Node.Text; } } #endregion ds.Dispose(); if ((bool)SessionState.User.GetOptionById((int)OptionsEnum.OPT_SHOW_SHRINKED_NAMES).Value) { Trace.Warn("Before Clean = " + n.Text); Utils.CleanNodeText(ref n); Trace.Warn("After Clean = " + n.Text); } } } catch (Exception ex) { Response.Write(ex.ToString()); Response.End(); } }
//Added by Venkata end protected void webTree_NodeBound(object sender, Infragistics.WebUI.UltraWebNavigator.WebTreeNodeEventArgs e) { //************************************************************* // Flag node if it has childs //************************************************************* if (e.Node.DataKey != null) { //Code added for Links Requirement (PR664195) to show/hide obsolete items by Prachi on 12th Dec 2012 bool showObsolete; if (bLinkFrom) { CheckBox cb = (CheckBox)uwToolbar.Items.FromKeyCustom("chkObs").FindControl("chkObsolete"); showObsolete = cb.Checked; } else { showObsolete = true; } //Code added for Links Requirement (PR658940) - to enable the checkbox above the SKU Level by Prachi on 11th Dec 2012 e.Node.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.False; Int64 currentItemId = Convert.ToInt64(e.Node.DataKey); DataTable dtChildren = e.Node.DataKey.ToString() == "-1" ? ds.Tables[0] : ds.Tables.Count > 1 ? ds.Tables[1] : ds.Tables[0]; DataRow dr = dtChildren.Select("ItemId = " + currentItemId.ToString())[0]; // Display or not image to expand node e.Node.ShowExpand = Convert.ToBoolean(dr["HasChild"]); // Update image e.Node.ImageUrl = "/hc_v4/ig/s_l.gif"; Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "scroll", "scroll('" + String.Format("{0}{1}", webTree.UniqueID.Replace("$", ""), e.Node.GetIdString()) + "');", true); // Add checkbox bool isSkuLevel = Convert.ToBoolean(dr["IsSkuLevel"]); bool isMainComponent = Convert.ToBoolean(dr["IsMainComponent"]); int typeId = Convert.ToInt32(dr["TypeId"]); //Code added for Links Requirement (PR664195) to display obsolete icon by Prachi on 12th Dec 2012 bool isObsolete = Convert.ToBoolean(dr["IsObsolete"]); //Code modified for Links Requirement (PR658940) - to enable the checkbox above the SKU Level by Prachi on 11th Dec 2012 - start bool isLinked = Convert.ToBoolean(dr["IsLinked"]); int levelId = Convert.ToInt32(dr["LevelId"]); int limit = configLimit; if (Ultrawebtoolbar2.Items.FromKeyCustom("LoadLevel1").Visible) { CheckBox checkLoad = (CheckBox)Ultrawebtoolbar2.Items.FromKeyCustom("LoadLevel1").FindControl("chkLoad"); //If retrieved Limit is Product Type and User has not checked the "Load from Product Level" checkbox, then consider the limit as the default value if (limit == 1) //For Product Type Level { if (!checkLoad.Checked) { if (bLinkFrom) //Companion { limit = Convert.ToInt32(ApplicationSettings.Parameters["Link_ProductCompanionLimit"].Value); } else //Host { limit = Convert.ToInt32(ApplicationSettings.Parameters["Link_ProductHostLimit"].Value); } } } } if (levelId >= limit) //Code modified for Links Requirement (PR658940) - to enable the checkbox above the SKU Level by Prachi on 11th Dec 2012 - end { e.Node.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.True; //Code added for Links Requirement (PR658940) - to check the nodes if parent node is already checked by Prachi on 9th Jan 2013 - start Node parentNode = e.Node.Parent; if (parentNode.Checked) { e.Node.Checked = true; } //Code added for Links Requirement (PR658940) - to check the nodes if parent node is already checked by Prachi on 9th Jan 2013 - end //Code modified for Links Requirement (PR658940) - to disable the checkbox if the item has already been linked by Prachi on 10th Jan 2013 if (isLinked) { e.Node.Enabled = false; e.Node.Checked = true; e.Node.ShowExpand = false; } // Check if current item is selected item if (currentItemId == itemId) { e.Node.Enabled = false; e.Node.Checked = false; e.Node.Style.CssClass = "hc_error"; e.Node.Style.Font.Bold = true; e.Node.Style.Font.Italic = true; e.Node.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.False; } // If link type is bundle and current SKU is main component if (isMainComponent) { e.Node.Enabled = false; e.Node.Checked = true; e.Node.Style.CssClass = "hc_error"; e.Node.Style.Font.Bold = true; e.Node.Style.Font.Italic = true; e.Node.CheckBox = Infragistics.WebUI.UltraWebNavigator.CheckBoxes.False; } //Code added for Links Requirement (PR664195) - to not allow the user to select obsolete item if selected host/companion is already obsolete by Prachi on 16th Jan 2013 //If selected item on left hand side is obsolete and current item in treeview is also obsolete if (showObsolete) { if (isObsolete && isItemObs) { e.Node.Enabled = false; e.Node.Checked = false; e.Node.ShowExpand = false; } } } //Code added for Links Requirement (PR658940) - to enable the checkbox above the SKU Level by Prachi on 11th Dec 2012 // If level is Sku level, update Icon if (isSkuLevel) { e.Node.ImageUrl = "/hc_v4/img/type_" + typeId.ToString() + ".png"; e.Node.ShowExpand = false; } //Code added for Links Requirement (PR664195) - to display obsolete icon and show/hide obsolete items by Prachi on 12th Dec 2012 if (isObsolete) { if (showObsolete) { e.Node.ImageUrl = e.Node.SelectedImageUrl = "/hc_v4/ig/s_o.gif"; } } } //************************************************************* // Copy Item Id to node Tag so that Client script can access it //************************************************************* e.Node.Tag = e.Node.DataKey.ToString(); //************************************************************* // Clean Nodes text (remove common text with parents) //************************************************************* Infragistics.WebUI.UltraWebNavigator.Node n = e.Node; if ((bool)SessionState.User.GetOptionById((int)OptionsEnum.OPT_SHOW_SHRINKED_NAMES).Value) { Utils.CleanNodeText(ref n); } }