protected void PopulateCategories(TreeNode node) { group = new Groups(1); DataTable dt = group.GetChild(node.Value); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { TreeNode newNode = new TreeNode(); newNode.Text = dr["ptitle"].ToString(); newNode.Value = dr["pid"].ToString(); bool kiemtra = group.CheckChild(dr["pid"].ToString()); if (kiemtra) { newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.SelectExpand; } else { newNode.PopulateOnDemand = false; newNode.SelectAction = TreeNodeSelectAction.Select; } node.ChildNodes.Add(newNode); } } }
protected void BildRoot(TreeView treeview) { DataTable dt = group.GetChild(string.Empty); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { TreeNode newNode = new TreeNode(); newNode.Text = dr["ptitle"].ToString(); newNode.Value = dr["pid"].ToString(); bool kiemtra = group.CheckChild(dr["pid"].ToString()); if (kiemtra) { newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.SelectExpand; } else { newNode.PopulateOnDemand = false; newNode.SelectAction = TreeNodeSelectAction.Select; } treeview.Nodes.Add(newNode); } } else { treeview1.Visible = false; } }
protected void PopulateCategories(TreeNode node) { string sgroup = "," + groupid + ","; group = new Groups(); DataTable dt = group.GetChildGroup(node.Value); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { TreeNode newNode = new TreeNode(); string sid = dr["pid"].ToString(); newNode.Text = dr["ptitle"].ToString(); newNode.Value = sid; if (sgroup.IndexOf("," + sid + ",") > -1) { newNode.Checked = true; } bool kiemtra = group.CheckChild(dr["pid"].ToString()); if (kiemtra) { newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; } else { newNode.PopulateOnDemand = false; newNode.SelectAction = TreeNodeSelectAction.None; } node.ChildNodes.Add(newNode); } } }
protected void PopulateCategories(TreeNode node) { string sgroup = "," + groupid + ","; group = new Groups(); DataTable dt = null; dt = group.GetChildNews(node.Value); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { TreeNode newNode = new TreeNode(); string sid = dr["pid"].ToString(); newNode.Text = dr["ptitle"].ToString(); newNode.Value = sid; if (sgroup.IndexOf("," + sid + ",") > -1) { newNode.Checked = true; } bool kiemtra = group.CheckChild(dr["pid"].ToString()); if (kiemtra) { newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.SelectExpand; } else { newNode.PopulateOnDemand = false; newNode.SelectAction = TreeNodeSelectAction.Select; } if (Membertask.IsAdministrator()) { node.ChildNodes.Add(newNode); } else { int Checkp = group.CheckP(dr["pid"].ToString(), Session["ID"].ToString()); if (Checkp == 1) { node.ChildNodes.Add(newNode); } else { } } } } }
protected void BildRoot(TreeView treeview) { string sgroup = "," + groupid + ","; DataTable dt = group.GetChildGroup(string.Empty); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { string sid = dr["pid"].ToString(); TreeNode newNode = new TreeNode(); newNode.Text = dr["ptitle"].ToString(); newNode.Value = sid; if (sgroup.IndexOf("," + sid + ",") > -1) { newNode.Checked = true; } bool kiemtra = group.CheckChild(dr["pid"].ToString()); if (kiemtra) { newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.Expand; } else { newNode.PopulateOnDemand = false; newNode.SelectAction = TreeNodeSelectAction.None; } treeview.Nodes.Add(newNode); } } else { treeview1.Visible = false; } }
protected void BildRoot(TreeView treeview) { string sgroup = "," + groupid + ","; DataTable dt = null; dt = group.GetChildNews(string.Empty); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { string sid = dr["pid"].ToString(); TreeNode newNode = new TreeNode(); newNode.Text = dr["ptitle"].ToString(); newNode.Value = sid; if (sgroup.IndexOf("," + sid + ",") > -1) { newNode.Checked = true; } //if (Membertask.IsAdministrator()) //{ bool kiemtra = group.CheckChild(dr["pid"].ToString()); if (kiemtra) { newNode.PopulateOnDemand = true; newNode.SelectAction = TreeNodeSelectAction.SelectExpand; } else { newNode.PopulateOnDemand = false; newNode.SelectAction = TreeNodeSelectAction.Select; } treeview.Nodes.Add(newNode); //} //else //{ // int Checkp = group.CheckP(dr["pid"].ToString(), Session["ID"].ToString()); // if (Checkp == 1) // { // bool kiemtra = group.CheckChild(dr["pid"].ToString()); // if (kiemtra) // { // newNode.PopulateOnDemand = true; // newNode.SelectAction = TreeNodeSelectAction.SelectExpand; // } // else // { // newNode.PopulateOnDemand = false; // newNode.SelectAction = TreeNodeSelectAction.Select; // } // treeview.Nodes.Add(newNode); // } // else // { // } //} } } else { treeview1.Visible = false; } }