Ejemplo n.º 1
0
        private void BindtvType(string str)
        {
            ViewState["PostID"] = str;
            TrainStandardBLL trainStandardBLL = new TrainStandardBLL();
            TrainTypeBLL     trainTypeBLL     = new TrainTypeBLL();

            IList <TrainType> trainTypeList = trainTypeBLL.GetTrainStandardTypeInfo(Convert.ToInt32(str), 1);

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

                foreach (TrainType trainType in trainTypeList)
                {
                    tvn = new TreeViewNode();
                    RailExam.Model.TrainStandard trainStandard = new RailExam.Model.TrainStandard();
                    trainStandard = trainStandardBLL.GetTrainStandardInfo(Convert.ToInt32(ViewState["PostID"].ToString()),
                                                                          trainType.TrainTypeID);
                    int nStandardID = trainStandard.TrainStandardID;
                    tvn.ID      = nStandardID.ToString();
                    tvn.Value   = nStandardID.ToString();
                    tvn.Text    = trainType.TypeName;
                    tvn.ToolTip = trainType.TypeName;

                    if (trainType.ParentID == 0)
                    {
                        tvTrainType.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            trainStandard = trainStandardBLL.GetTrainStandardInfo(Convert.ToInt32(ViewState["PostID"].ToString()),
                                                                                  trainType.ParentID);
                            int nParentStandardID = trainStandard.TrainStandardID;
                            tvTrainType.FindNodeById(nParentStandardID.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvTrainType.Nodes.Clear();
                            Response.Write("数据错误!");
                            return;
                        }
                    }
                }
            }

            tvTrainType.DataBind();
            tvTrainType.ExpandAll();
        }
Ejemplo n.º 2
0
        private void BindTypeTree(string str)
        {
            TrainTypeBLL objTrainType = new TrainTypeBLL();

            IList <TrainType> train = objTrainType.GetTrainStandardTypeInfo(Convert.ToInt32(ViewState["PostID"].ToString()), 0);

            PostBLL objPostBll = new PostBLL();
            Post    objPost    = objPostBll.GetPost(Convert.ToInt32(ViewState["PostID"].ToString()));

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

                foreach (TrainType traintype in train)
                {
                    if (objPost.Promotion == 0 && traintype.IsPromotion == true)
                    {
                        continue;
                    }
                    tvn              = new TreeViewNode();
                    tvn.ID           = traintype.TrainTypeID.ToString();
                    tvn.Value        = traintype.TrainTypeID.ToString();
                    tvn.Text         = traintype.TypeName;
                    tvn.ToolTip      = traintype.TypeName;
                    tvn.ShowCheckBox = true;

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

            tvTrainType.DataBind();
            tvTrainType.ExpandAll();
        }
Ejemplo n.º 3
0
        private void GetNowType()
        {
            TrainTypeBLL objTrainType = new TrainTypeBLL();

            IList <TrainType> train = objTrainType.GetTrainStandardTypeInfo(Convert.ToInt32(ViewState["PostID"].ToString()), 1);

            ArrayList objList = new ArrayList();

            foreach (TrainType traintype in train)
            {
                objList.Add(traintype.TrainTypeID);
            }

            AddImplateType(objList);
        }
Ejemplo n.º 4
0
        private void BindTypeTree()
        {
            TrainTypeBLL objBll = new TrainTypeBLL();

            IList <TrainType> train = objBll.GetTrainStandardTypeInfo(Convert.ToInt32(ViewState["PostID"].ToString()), 1);

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

                foreach (TrainType traintype in train)
                {
                    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)
                    {
                        tvType.Nodes.Add(tvn);
                    }
                    else
                    {
                        try
                        {
                            tvType.FindNodeById(traintype.ParentID.ToString()).Nodes.Add(tvn);
                        }
                        catch
                        {
                            tvType.Nodes.Clear();
                            Response.Write("数据错误!");
                            return;
                        }
                    }
                }
            }

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