Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ViewState["mode"] = Request.QueryString.Get("mode");
                hfMode.Value      = ViewState["mode"].ToString();


                string PaperCategoryID = Request.QueryString.Get("PaperCategoryIDPath");
                if (!string.IsNullOrEmpty(PaperCategoryID))
                {
                    string[] str1 = PaperCategoryID.Split(new char[] { '/' });

                    int nID = int.Parse(str1[str1.LongLength - 1].ToString());


                    hfPaperCategoryID.Value = nID.ToString();
                    PaperCategoryBLL pcl = new PaperCategoryBLL();

                    RailExam.Model.PaperCategory pc = pcl.GetPaperCategory(nID);

                    txtCategoryName.Text = pc.CategoryName;
                }


                string strPaperStrategyID = Request.QueryString.Get("id");
                if (!string.IsNullOrEmpty(strPaperStrategyID))
                {
                    FillPage(int.Parse(strPaperStrategyID));
                }
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }
                ViewState["mode"] = Request.QueryString.Get("mode");
                hfMode.Value      = ViewState["mode"].ToString();
                string PaperCategoryID = Request.QueryString.Get("PaperCategoryIDPath");
                if (!string.IsNullOrEmpty(PaperCategoryID))
                {
                    string[] str1 = PaperCategoryID.Split(new char[] { '/' });

                    int nID = int.Parse(str1[str1.LongLength - 1].ToString());


                    hfCategoryId.Value = nID.ToString();
                    PaperCategoryBLL pcl = new PaperCategoryBLL();

                    RailExam.Model.PaperCategory pc = pcl.GetPaperCategory(nID);

                    txtCategoryName.Text = pc.CategoryName;
                }
                string strPaperID = Request.QueryString.Get("id");
                if (!string.IsNullOrEmpty(strPaperID))
                {
                    FillPage(int.Parse(strPaperID));
                }
            }
        }
Esempio n. 3
0
        private void BindPaperCategoryTree()
        {
            PaperCategoryBLL paperCategoryBLL = new PaperCategoryBLL();

            //IList<RailExam.Model.PaperCategory> paperCategoryList = PaperCategoryBLL.GetPaperCategories();
            IList <RailExam.Model.PaperCategory> paperCategoryList = paperCategoryBLL.GetPaperCategories();

            Pub.BuildComponentArtTreeView(tvPaperCategory, (IList)paperCategoryList, "PaperCategoryId",
                                          "ParentId", "CategoryName", "CategoryName", "IdPath", null, null, null);

            //tvPaperCategory.ExpandAll();
        }
Esempio n. 4
0
        private void BindPaperCategoryTree()
        {
            //string strCategoryID = Request.QueryString.Get("Op");

            PaperCategoryBLL paperCategoryBLL = new PaperCategoryBLL();

            //IList<RailExam.Model.PaperCategory> PaperCategoryList = PaperCategoryBLL.GetPaperCategories(int.Parse(strCategoryID));//选择考试试卷 PaperCategoryId=3
            IList <RailExam.Model.PaperCategory> paperCategoryList = paperCategoryBLL.GetPaperCategories();

            Pub.BuildComponentArtTreeView(tvPaperCategory, (IList)paperCategoryList, "PaperCategoryId",
                                          "ParentId", "CategoryName", "CategoryName", "IdPath", null, null, null);

            //tvPaperCategory.ExpandAll();
        }
Esempio n. 5
0
        public bool tvPaperCategoryNodeMove(int PaperCategoryId, string direction)
        {
            PaperCategoryBLL paperCategoryBLL = new PaperCategoryBLL();

            if (direction.ToUpper() == "UP")
            {
                return(paperCategoryBLL.MoveUp(PaperCategoryId));
            }
            else if (direction.ToUpper() == "DOWN")
            {
                return(paperCategoryBLL.MoveDown(PaperCategoryId));
            }
            else
            {
                SessionSet.PageMessage = "未知移动方向!";
            }

            return(false);
        }
Esempio n. 6
0
        private void BindPaperCategoryTree()
        {
            PaperCategoryBLL paperCategoryBLL = new PaperCategoryBLL();

            IList <RailExam.Model.PaperCategory> paperCategoryList = paperCategoryBLL.GetPaperCategories();

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

                foreach (PaperCategory paperCategory in paperCategoryList)
                {
                    tvn         = new TreeViewNode();
                    tvn.ID      = paperCategory.PaperCategoryId.ToString();
                    tvn.Value   = paperCategory.PaperCategoryId.ToString();
                    tvn.Text    = paperCategory.CategoryName;
                    tvn.ToolTip = paperCategory.CategoryName;

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

            TreeView1.DataBind();
            TreeView1.ExpandAll();
        }