Ejemplo n.º 1
0
        private void BindTrainTypeTree()
        {
            TrainTypeBLL objTrainType = new TrainTypeBLL();

            IList <TrainType> train = objTrainType.GetTrainTypes();

            //Pub.BuildComponentArtTreeView(TreeView2, (IList)train, "TrainTypeID", "ParentID", "TypeName", "TypeName", "IDPath", null, null, null);
            //TreeView2.ExpandAll();

            if (train.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (RailExam.Model.TrainType obj in train)
                {
                    if (obj.LevelNum == 1)
                    {
                        tvn         = new TreeViewNode();
                        tvn.ID      = obj.TrainTypeID.ToString();
                        tvn.Value   = obj.IDPath.ToString();
                        tvn.Text    = obj.TypeName;
                        tvn.ToolTip = obj.TypeName;

                        if (obj.ParentID == 0)
                        {
                            TreeView2.Nodes.Add(tvn);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void BindTrainTypeTree()
        {
            TrainTypeBLL objTrainType = new TrainTypeBLL();

            IList <TrainType> train = objTrainType.GetTrainTypes();

            Pub.BuildComponentArtTreeView(tvTrainType, (IList)train, "TrainTypeID", "ParentID", "TypeName", "TypeName", "TrainTypeID", null, null, null);
        }
Ejemplo n.º 3
0
        private void BindTrainTypeTree()
        {
            TrainTypeBLL objTrainType = new TrainTypeBLL();

            IList <TrainType> train = objTrainType.GetTrainTypes();

            Pub.BuildComponentArtTreeView(TreeView2, (IList)train, "TrainTypeID", "ParentID", "TypeName", "TypeName", "IDPath", null, null, null);
            //TreeView2.ExpandAll();
        }
Ejemplo n.º 4
0
        private void BindTrainTypeTree()
        {
            TrainTypeBLL trainTypeBLL = new TrainTypeBLL();

            IList <TrainType> trainTypes = trainTypeBLL.GetTrainTypes();

            Pub.BuildComponentArtTreeView(tvTrainType, (IList)trainTypes, "TrainTypeID", "ParentID", "TypeName", "TypeName",
                                          "IDPath", null, null, null);
        }
Ejemplo n.º 5
0
        private void BindTrainTypeTree()
        {
            //ArrayList objList = GetTypeList();

            TrainTypeBLL      trainTypeBLL = new TrainTypeBLL();
            IList <TrainType> trainTypes   = trainTypeBLL.GetTrainTypes();

            string strID = Request.QueryString["id"];

            string[] strIDS = { };
            if (!string.IsNullOrEmpty(strID))
            {
                strIDS = strID.Split(',');
            }

            if (trainTypes.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (TrainType trainType in trainTypes)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = trainType.TrainTypeID.ToString();
                    tvn.Value   = trainType.TrainTypeID.ToString();
                    tvn.Text    = trainType.TypeName;
                    tvn.ToolTip = trainType.TypeName;

                    if (trainType.ParentID == 0)
                    {
                        tvTrainType.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvTrainType.FindNodeById(trainType.ParentID.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvTrainType.Nodes.Clear();
                            SessionSet.PageMessage = "Êý¾Ý´íÎó£¡";
                            return;
                        }
                    }
                }
            }

            tvTrainType.DataBind();
            //tvTrainType.ExpandAll();
        }
Ejemplo n.º 6
0
        private void BindTrainTypeTree()
        {
            TrainTypeBLL trainTypeBLL = new TrainTypeBLL();

            IList <TrainType> trainTypeList = trainTypeBLL.GetTrainTypes();

            if (trainTypeList.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (TrainType trainType in trainTypeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = trainType.TrainTypeID.ToString();
                    tvn.Value   = trainType.IDPath;
                    tvn.Text    = trainType.TypeName;
                    tvn.ToolTip = trainType.TypeName;
                    tvn.Attributes.Add("isTrainType", "true");
                    tvn.ImageUrl           = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Knowledge.gif";
                    tvn.ContentCallbackUrl = "../Common/GetTrainTypeBook.aspx?id=" + trainType.IDPath;

                    if (trainType.ParentID == 0)
                    {
                        tvView.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvView.FindNodeById(trainType.ParentID.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvView.Nodes.Clear();

                            SessionSet.PageMessage = "Êý¾Ý´íÎó£¡";
                            return;
                        }
                    }
                }
            }

            tvView.SelectedNode = tvView.Nodes[0];

            if (tvView.Nodes.Count > 0)
            {
                tvView.Nodes[0].Expanded = true;
            }
        }
        private void BindTrainTypeTree()
        {
            TrainTypeBLL trainTypeBLL = new TrainTypeBLL();

            IList <TrainType> trainTypeList = trainTypeBLL.GetTrainTypes();

            if (trainTypeList.Count > 0)
            {
                TreeViewNode tvn     = null;
                string       strflag = Request.QueryString.Get("flag");

                foreach (TrainType trainType in trainTypeList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = trainType.TrainTypeID.ToString();
                    tvn.Value   = trainType.IDPath;
                    tvn.Text    = trainType.TypeName;
                    tvn.ToolTip = trainType.TypeName;
                    tvn.Attributes.Add("isTrainType", "true");
                    tvn.ImageUrl = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Knowledge.gif";

                    if (strflag != null)
                    {
                        if (strflag == "2")
                        {
                            string strPostID = Request.QueryString.Get("PostID");
                            string strOrgID  = Request.QueryString.Get("OrgID");
                            string strLeader = Request.QueryString.Get("Leader");
                            string strTech   = Request.QueryString.Get("Tech");
                            tvn.ContentCallbackUrl = "~/Common/GetTrainTypeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&flag=2&id=" + trainType.TrainTypeID + "&OrgID=" + strOrgID + "&PostID=" + strPostID + "&Leader=" + strLeader + "&Tech=" + strTech;
                        }
                        else
                        {
                            tvn.ContentCallbackUrl = "~/Common/GetTrainTypeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&flag=1&id=" + trainType.IDPath;
                        }
                    }
                    else
                    {
                        tvn.ContentCallbackUrl = "~/Common/GetTrainTypeBook.aspx?itemTypeID=" + ViewState["ItemType"].ToString() + "&id=" + trainType.IDPath;
                    }

                    if (trainType.ParentID == 0)
                    {
                        tvBookChapter.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvBookChapter.FindNodeById(trainType.ParentID.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvBookChapter.Nodes.Clear();
                            SessionSet.PageMessage = "Êý¾Ý´íÎó£¡";
                            return;
                        }
                    }
                }
            }
            //tvBookChapter.DataBind();
            //tvBookChapter.ExpandAll();
        }
Ejemplo n.º 8
0
        //private ArrayList GetTypeList()
        //{
        //    ArrayList objList = new ArrayList();
        //    string str = Request.QueryString.Get("id");
        //    string[] strType = str.Split(',');

        //    for(int i=0; i< strType.Length; i++)
        //    {
        //        objList.Add(strType[i].ToString());
        //    }

        //    return objList;
        //}

        private void BindTrainTypeTree()
        {
            //ArrayList objList = GetTypeList();

            TrainTypeBLL      trainTypeBLL = new TrainTypeBLL();
            IList <TrainType> trainTypes   = new List <TrainType>();

            if (!string.IsNullOrEmpty(Request.QueryString.Get("type")))
            {
                trainTypes = trainTypeBLL.GetTrainTypeByWhereClause("id_path || '/' like '/363/%'", "LEVEL_NUM, ORDER_INDEX ASC");
            }
            else
            {
                trainTypes = trainTypeBLL.GetTrainTypes();
            }

            string strID = Request.QueryString["id"];

            string[] strIDS = { };
            if (!string.IsNullOrEmpty(strID))
            {
                strIDS = strID.Split(',');
            }

            if (trainTypes.Count > 0)
            {
                TreeViewNode tvn = null;

                foreach (TrainType trainType in trainTypes)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = trainType.TrainTypeID.ToString();
                    tvn.Value   = trainType.TrainTypeID.ToString();
                    tvn.Text    = trainType.TypeName;
                    tvn.ToolTip = trainType.TypeName;

                    IList <TrainType> trainTypes1 = trainTypeBLL.GetTrainTypeByParentId(trainType.TrainTypeID);

                    if (trainTypes1.Count == 0)
                    {
                        tvn.ShowCheckBox = true;
                    }

                    foreach (string strOrgID in strIDS)
                    {
                        if (strOrgID == trainType.TrainTypeID.ToString() && tvn.ShowCheckBox)
                        {
                            tvn.Checked = true;
                        }
                    }

                    //if(objList.IndexOf(tvn.ID) != -1)
                    //{
                    //    tvn.Checked = true;
                    //}

                    if (trainType.ParentID == 0)
                    {
                        tvTrainType.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvTrainType.FindNodeById(trainType.ParentID.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvTrainType.Nodes.Clear();
                            SessionSet.PageMessage = "数据错误!";
                            return;
                        }
                    }
                }
            }

            tvTrainType.DataBind();
            //tvTrainType.ExpandAll();
        }