Ejemplo n.º 1
0
        private void BindGrid2()
        {
            CoursewareBLL coursewareBLL = new CoursewareBLL();
            IList <RailExam.Model.Courseware> coursewareList = new List <RailExam.Model.Courseware>();

            if (!string.IsNullOrEmpty(Request.QueryString.Get("id")))
            {
                TrainTypeBLL trainTypeBLL = new TrainTypeBLL();
                TrainType    trainType    = trainTypeBLL.GetTrainTypeInfo(Convert.ToInt32(ViewState["TrainAimID"].ToString()));
                coursewareList = coursewareBLL.GetCoursewaresByTrainTypeIDPath(trainType.IDPath, 1);
            }
            else
            {
                coursewareList = coursewareBLL.GetCoursewaresByCoursewareTypeOnline(PrjPub.CurrentLoginUser.StationOrgID,
                                                                                    Convert.ToInt32(ViewState["TrainAimID"].ToString()), "%", true,
                                                                                    5);
            }

            if (coursewareList.Count > 0)
            {
                foreach (RailExam.Model.Courseware courseware in coursewareList)
                {
                    if (courseware.CoursewareName.Length <= 15)
                    {
                        courseware.CoursewareName = "<a onclick=EditCourseware(" + courseware.CoursewareID + ") href=# title=" + courseware.CoursewareName + " > " + courseware.CoursewareName + " </a>";
                    }
                    else
                    {
                        courseware.CoursewareName = "<a onclick=EditCourseware(" + courseware.CoursewareID + ") href=# title=" + courseware.CoursewareName + " > " + courseware.CoursewareName.Substring(0, 15) + "..." + " </a>";
                    }
                }
                gvCourse.DataSource = coursewareList;
                gvCourse.DataBind();
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TrainEmployeeBLL objTrainEmployeeBll = new TrainEmployeeBLL();

            string str = Request.QueryString.Get("id");

            if (str != null && str != "")
            {
                ViewState["TrainTypeID"] = str;
            }
            else
            {
                if (PrjPub.StudentID == null)
                {
                    Response.Write("<script>alert('已超时,请注销后重新登录!');window.close();</script>");
                    return;
                }
                ViewState["TrainTypeID"] = objTrainEmployeeBll.GetTrainEmployeeByEmployeeID(PrjPub.CurrentStudent.EmployeeID).TrainTypeID.ToString();
            }

            if (ViewState["TrainTypeID"].ToString() == "0")
            {
                Response.Write("<script>alert('请选择培训类别!');window.close();</script>");
                return;
            }

            TrainTypeBLL objTrainTypeBll = new TrainTypeBLL();
            TrainType    objTrainType    = objTrainTypeBll.GetTrainTypeInfo(Convert.ToInt32(ViewState["TrainTypeID"].ToString()));

            lblDescription.Text = objTrainType.Description;
            lblMemo.Text        = objTrainType.Memo;

            BindGrid1();
            BindGrid2();
        }
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();

            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.º 4
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.º 5
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.º 6
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.º 7
0
        private void BindTrainTypeTree()
        {
            TrainTypeBLL trainTypeBLL = new TrainTypeBLL();

            IList <TrainType> trainTypeList = trainTypeBLL.GetTrainTypeInfo(0, 0, 0, "", 0, "", "", false, false, "", 0, 4000, "LevelNum, OrderIndex ASC");

            Pub.BuildComponentArtTreeView(tvTrainType, (IList)trainTypeList,
                                          "TrainTypeID", "ParentID", "TypeName", "TypeName", "IDPath", null, null, null);

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

            IList <TrainType> trainTypeList = trainTypeBLL.GetTrainTypeInfo(0, 0, 0, "", 0, "", "",
                                                                            false, false, "", 0, 200,
                                                                            "LevelNum,OrderIndex ASC");

            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 && strflag == "1")
                    {
                        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.º 9
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.º 10
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.º 11
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.º 12
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;
            }
        }
Ejemplo n.º 13
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.º 14
0
        protected void tvTrainTypeChangeCallBack_Callback(object sender, CallBackEventArgs e)
        {
            TrainTypeBLL objTrainType = new TrainTypeBLL();
            TrainType    traintype    = objTrainType.GetTrainTypeInfo(int.Parse(e.Parameters[0]));
            int          cout         = traintype.ParentID == 0 ? tvTrainType.Nodes.Count : tvTrainType.FindNodeById(traintype.ParentID.ToString()).Nodes.Count;

            if (e.Parameters[1] == "MoveUp")
            {
                if (traintype.OrderIndex <= cout && traintype.OrderIndex >= 2)
                {
                    traintype.OrderIndex--;
                    objTrainType.UpdateTrainType(traintype);

                    traintype = objTrainType.GetTrainTypeInfo(int.Parse(tvTrainType.FindNodeById(e.Parameters[0]).PreviousSibling.ID));
                    traintype.OrderIndex++;
                    objTrainType.UpdateTrainType(traintype);
                }
            }
            if (e.Parameters[1] == "MoveDown")
            {
                if (traintype.OrderIndex <= cout - 1 && traintype.OrderIndex >= 1)
                {
                    traintype.OrderIndex++;
                    objTrainType.UpdateTrainType(traintype);

                    traintype = objTrainType.GetTrainTypeInfo(int.Parse(tvTrainType.FindNodeById(e.Parameters[0]).NextSibling.ID));
                    traintype.OrderIndex--;
                    objTrainType.UpdateTrainType(traintype);
                }
            }

            if (e.Parameters[1] == "Insert")
            {
                IList <RailExam.Model.TrainType> objList = objTrainType.GetTrainTypeByWhereClause("1=1", "Train_Type_ID desc");
                hfMaxID.Value = objList[0].TrainTypeID.ToString();
                hfMaxID.RenderControl(e.Output);
            }
            else if (e.Parameters[1] == "Delete")
            {
                hfMaxID.Value = e.Parameters[2];
                hfMaxID.RenderControl(e.Output);
            }

            tvTrainType.Nodes.Clear();
            BindTrainTypeTree();

            tvTrainType.RenderControl(e.Output);
        }
Ejemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }
                if (!string.IsNullOrEmpty(Request.QueryString.Get("id")))
                {
                    ViewState["TrainAimID"] = Request.QueryString.Get("id");
                    TrainTypeBLL trainTypeBLL = new TrainTypeBLL();
                    TrainType    trainType    = trainTypeBLL.GetTrainTypeInfo(Convert.ToInt32(ViewState["TrainAimID"].ToString()));

                    lblDescription.Text = trainType.Description;
                    lblMemo.Text        = trainType.Memo;
                }
                else
                {
                    ViewState["TrainAimID"] = Request.QueryString.Get("id1");
                    PostBLL postBll = new PostBLL();
                    Post    post    = postBll.GetPost(Convert.ToInt32(ViewState["TrainAimID"].ToString()));
                    lblDescription.Text = post.Description;
                    lblMemo.Text        = post.Memo;
                }

                BindGrid1();
                BindGrid2();
            }

            string strRefresh = Request.Form.Get("Refresh");

            if (!string.IsNullOrEmpty(strRefresh))
            {
                BindGrid1();
                BindGrid2();
            }

            //string strDeleteID = Request.Form.Get("DeleteID");
            //if (strDeleteID != null & strDeleteID != "")
            //{
            //    DeleteExercise(strDeleteID);
            //    BindGrid1();
            //    BindGrid2();
            //}
        }
Ejemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string str = Request.QueryString.Get("id");

                TrainStandardBLL objTrainStandardBLL = new TrainStandardBLL();
                int nTypeID = objTrainStandardBLL.GetTrainStandardInfo(Convert.ToInt32(str)).TypeID;

                TrainTypeBLL objTrainTypeBLL = new TrainTypeBLL();
                int          nLevel          = objTrainTypeBLL.GetTrainTypeInfo(nTypeID).LevelNum;

                if (nLevel == 1)
                {
                    Grid1.Visible             = false;
                    btnAddTrainCourse.Visible = false;
                }
                else
                {
                    Grid1.Visible             = true;
                    btnAddTrainCourse.Visible = true;
                }
            }

            string strRefresh = Request.Form.Get("Refresh");

            if (strRefresh != null & strRefresh != "")
            {
                Grid1.DataBind();
            }

            string strDeleteID = Request.Form.Get("DeleteID");

            if (strDeleteID != null & strDeleteID != "")
            {
                DeleteCourse(strDeleteID);
                Grid1.DataBind();
            }

            btnAddTrainCourse.Attributes.Add("onclick", "AddRecord(" + Request.QueryString.Get("id") + ");");
        }
Ejemplo n.º 17
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();
        }
Ejemplo n.º 18
0
        private string GetTrainTypeName(string strName, int nID)
        {
            string str = strName;

            if (nID != 0)
            {
                TrainTypeBLL             objBll = new TrainTypeBLL();
                RailExam.Model.TrainType obj    = objBll.GetTrainTypeInfo(nID);

                if (obj.ParentID != 0)
                {
                    str = GetTrainTypeName("/" + obj.TypeName, obj.ParentID) + strName;
                }
                else
                {
                    str = obj.TypeName + strName;
                }
            }

            return(str);
        }
Ejemplo n.º 19
0
        private string GetTrainTypeName(string strName, int nID)
        {
            string strTrainTypeName = string.Empty;

            if (nID != 0)
            {
                TrainTypeBLL trainTypeBLL = new TrainTypeBLL();
                TrainType    trainType    = trainTypeBLL.GetTrainTypeInfo(nID);

                if (trainType.ParentID != 0)
                {
                    strTrainTypeName = GetTrainTypeName("/" + trainType.TypeName, trainType.ParentID) + strName;
                }
                else
                {
                    strTrainTypeName = trainType.TypeName + strName;
                }
            }

            return(strTrainTypeName);
        }
Ejemplo n.º 20
0
        private string GetType(string strName, int nID)
        {
            string str = "";

            if (nID != 0)
            {
                TrainTypeBLL objTrainTypeBll = new TrainTypeBLL();
                TrainType    objTrainType    = objTrainTypeBll.GetTrainTypeInfo(nID);

                if (objTrainType.ParentID != 0)
                {
                    str = GetType(" - " + objTrainType.TypeName, objTrainType.ParentID) + strName;
                }
                else
                {
                    str = objTrainType.TypeName + strName;
                }
            }

            return(str);
        }
Ejemplo n.º 21
0
        private void BindGrid()
        {
            ArrayList objList = GetNowBookList();

            BookBLL bookBLL = new BookBLL();
            IList <RailExam.Model.Book> AllBookList = bookBLL.GetAllBookInfo(SessionSet.OrganizationID);
            IList <RailExam.Model.Book> NewBookList = new List <RailExam.Model.Book>();

            foreach (RailExam.Model.Book book in AllBookList)
            {
                if (objList.IndexOf(book.bookId.ToString()) == -1)
                {
                    NewBookList.Add(book);
                }
            }

            TrainTypeBLL     trainTypeBLL     = new TrainTypeBLL();
            BookTrainTypeBLL bookTrainTypeBLL = new BookTrainTypeBLL();

            foreach (RailExam.Model.Book book in NewBookList)
            {
                IList <BookTrainType> bookTrainTypeList = bookTrainTypeBLL.GetBookTrainTypeByBookID(book.bookId);
                string strTrainTypeNames = "";
                foreach (BookTrainType bookTrainType in bookTrainTypeList)
                {
                    if (strTrainTypeNames == "")
                    {
                        strTrainTypeNames = strTrainTypeNames + GetTrainTypeName("/" + bookTrainType.TrainTypeName, trainTypeBLL.GetTrainTypeInfo(bookTrainType.TrainTypeID).ParentID);
                    }
                    else
                    {
                        strTrainTypeNames = strTrainTypeNames + "," + GetTrainTypeName("/" + bookTrainType.TrainTypeName, trainTypeBLL.GetTrainTypeInfo(bookTrainType.TrainTypeID).ParentID);
                    }
                }
                book.trainTypeNames = strTrainTypeNames;
            }

            gvBook.DataSource = NewBookList;
            gvBook.DataBind();
        }
Ejemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (fvTrainType.CurrentMode == FormViewMode.Insert)
            {
                if (hfInsert.Value == "-1")
                {
                    ((HiddenField)fvTrainType.FindControl("hfParentId")).Value = Request.QueryString["id"];
                }
                else
                {
                    ((HiddenField)fvTrainType.FindControl("hfParentId")).Value = hfInsert.Value;
                }
            }

            string strDeleteID = Request.Form.Get("DeleteID");

            if (strDeleteID != "" && strDeleteID != null)
            {
                TrainTypeBLL objBll      = new TrainTypeBLL();
                string       strParentID = objBll.GetTrainTypeInfo(Convert.ToInt32(strDeleteID)).ParentID.ToString();
                int          code        = 0;
                objBll.DeleteTrainType(Convert.ToInt32(strDeleteID), ref code);

                if (code != 0)//code=2292
                {
                    SessionSet.PageMessage = "该培训类别已被引用,不能删除!";
                }
                else
                {
                    ClientScript.RegisterStartupScript(GetType(),
                                                       "jsSelectFirstNode",
                                                       @"window.parent.tvTrainTypeChangeCallBack.callback('-1','Delete','" + strParentID + @"','Rebuild');                       
                            if(window.parent.tvTrainType.get_nodes().get_length() > 0)
                            {
                                window.parent.tvTrainType.get_nodes().getNode(0).select();
                            }",
                                                       true);
                }
            }
        }
Ejemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string str = Request.QueryString.Get("id");

                TrainStandardBLL objTrainStandardBLL = new TrainStandardBLL();
                int nTypeID = objTrainStandardBLL.GetTrainStandardInfo(Convert.ToInt32(str)).TypeID;

                TrainTypeBLL objTrainTypeBLL = new TrainTypeBLL();
                int          nLevel          = objTrainTypeBLL.GetTrainTypeInfo(nTypeID).LevelNum;

                if (nLevel == 1)
                {
                    fvTrainStandard.Visible = false;
                }
                else
                {
                    fvTrainStandard.Visible = true;
                }
            }
        }
Ejemplo n.º 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (PrjPub.CurrentStudent != null)
            {
                TrainEmployeeBLL objTrainEmployeeBll = new TrainEmployeeBLL();
                ViewState["TrainTypeID"] = objTrainEmployeeBll.GetTrainEmployeeByEmployeeID(PrjPub.CurrentStudent.EmployeeID).TrainTypeID.ToString();

                if (ViewState["TrainTypeID"].ToString() == "0")
                {
                    lblType.Text = "请选择培训类别";
                }
                else
                {
                    BindGrid1();
                    BindGrid2();
                    //BindGrid3();
                    //BindGrid4();

                    lblType.Text = "";

                    TrainTypeBLL objTrainTypeBll = new TrainTypeBLL();
                    TrainType    objTrainType    = objTrainTypeBll.GetTrainTypeInfo(Convert.ToInt32(ViewState["TrainTypeID"].ToString()));

                    if (objTrainType == null)
                    {
                        lblType.Text = "";
                    }
                    else
                    {
                        lblType.Text = lblType.Text + GetType(" - " + objTrainType.TypeName, objTrainType.ParentID);
                    }
                }
            }
            else
            {
                Response.Redirect("NewStudyInfo.aspx");
            }
        }
Ejemplo n.º 25
0
        private void AddImplateType(ArrayList objList)
        {
            tvTrainType.Nodes.Clear();
            TrainTypeBLL trainTypeBLL = new TrainTypeBLL();

            IList <TrainType> trainTypeList = trainTypeBLL.GetTrainTypeInfo(0, 0, 0, "", 0, "", "", true, false, "", 0, 200, "LevelNum,OrderIndex ASC");

            if (trainTypeList.Count > 0)
            {
                foreach (TrainType trainType in trainTypeList)
                {
                    if (objList.Count > 0)
                    {
                        if (objList.IndexOf(trainType.TrainTypeID) != -1)
                        {
                            continue;
                        }
                    }

                    TrainStandardBLL             trainStandardBLL = new TrainStandardBLL();
                    RailExam.Model.TrainStandard trainStandard    = new RailExam.Model.TrainStandard();

                    trainStandard.PostID       = Convert.ToInt32(ViewState["PostID"].ToString());
                    trainStandard.TypeID       = Convert.ToInt32(trainType.TrainTypeID);
                    trainStandard.TrainTime    = "";
                    trainStandard.TrainContent = "";
                    trainStandard.TrainForm    = "";
                    trainStandard.ExamForm     = "";
                    trainStandard.Description  = "";
                    trainStandard.Memo         = "";

                    trainStandardBLL.AddTrainStandard(trainStandard);
                }
            }

            BindtvType(ViewState["PostID"].ToString());
        }
Ejemplo n.º 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(PrjPub.StudentID))
            {
                Response.Write("<script>alert('您还没有登录,不能查看在线学习信息!');window.close();</script>");
                return;
            }

            TrainEmployeeBLL objTrainEmployeeBll = new TrainEmployeeBLL();

            ViewState["TrainTypeID"] = objTrainEmployeeBll.GetTrainEmployeeByEmployeeID(PrjPub.CurrentStudent.EmployeeID).TrainTypeID.ToString();

            if (ViewState["TrainTypeID"].ToString() == "0")
            {
                lblType.Text = "请选择培训类别";
            }
            else
            {
                BindGrid1();
                BindGrid2();

                lblType.Text = "";

                TrainTypeBLL objTrainTypeBll = new TrainTypeBLL();
                TrainType    objTrainType    = objTrainTypeBll.GetTrainTypeInfo(Convert.ToInt32(ViewState["TrainTypeID"].ToString()));

                if (objTrainType == null)
                {
                    lblType.Text = "";
                }
                else
                {
                    lblType.Text = lblType.Text + GetType(" - " + objTrainType.TypeName, objTrainType.ParentID);
                }
            }
        }
Ejemplo n.º 27
0
        //private void DeleteExercise(string strPaperID)
        //{
        //    TrainTypeExerciseBLL objBll = new TrainTypeExerciseBLL();
        //    objBll.DelTrainTypeExercise(Convert.ToInt32(ViewState["TrainTypeID"].ToString()), Convert.ToInt32(strPaperID));
        //}

        private void BindGrid1()
        {
            BookBLL bookBLL = new BookBLL();
            IList <RailExam.Model.Book> bookList = new List <RailExam.Model.Book>();

            if (!string.IsNullOrEmpty(Request.QueryString.Get("id")))
            {
                TrainTypeBLL trainTypeBLL = new TrainTypeBLL();
                TrainType    trainType    = trainTypeBLL.GetTrainTypeInfo(Convert.ToInt32(ViewState["TrainAimID"].ToString()));
                bookList = bookBLL.GetBookByTrainTypeIDPath(trainType.IDPath);
            }
            else
            {
                bookList = bookBLL.GetEmployeeStudyBookInfoByKnowledgeID(-1, PrjPub.CurrentLoginUser.StationOrgID,
                                                                         Convert.ToInt32(ViewState["TrainAimID"].ToString()), 1, 5,
                                                                         0);
            }

            if (bookList.Count > 0)
            {
                foreach (RailExam.Model.Book book in bookList)
                {
                    if (book.bookName.Length <= 15)
                    {
                        book.bookName = "<a onclick=EditBook(" + book.bookId + ") href=# title=" + book.bookName + " > " + book.bookName + " </a>";
                    }
                    else
                    {
                        book.bookName = "<a onclick=EditBook(" + book.bookId + ") href=# title=" + book.bookName + " > " + book.bookName.Substring(0, 15) + " </a>";
                    }
                }

                gvBook.DataSource = bookList;
                gvBook.DataBind();
            }
        }
Ejemplo n.º 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PrjPub.CurrentLoginUser == null)
                {
                    Response.Redirect("/RailExamBao/Common/Error.aspx?error=Session过期请重新登录本系统!");
                    return;
                }

                hfIsWuhan.Value = PrjPub.IsWuhan().ToString();

                string strBookID = Request.QueryString.Get("id");
                ViewState["BookID"] = strBookID;

                hfMode.Value = Request.QueryString.Get("mode");

                if (strBookID != null && strBookID != "")
                {
                    if (PrjPub.CurrentLoginUser.RoleID == 1)
                    {
                        ImgSelectEmployee.Visible = true;
                    }
                    else
                    {
                        ImgSelectEmployee.Visible = false;
                    }

                    if (hfMode.Value == "ReadOnly")
                    {
                        SaveButton.Visible     = false;
                        CancelButton.Visible   = true;
                        SaveNextButton.Visible = false;
                        SaveExitButton.Visible = false;
                        //ClientScript.RegisterStartupScript(GetType(), "jsHide", "<script>document.all.ImgSelectKnowledge.style.display='none';</script>");
                        //Response.Write("<script>document.all.ImgSelectKnowledge.style.display='none';</script>");
                    }
                    else if (hfMode.Value == "Edit")
                    {
                        btnCover.Visible       = false;
                        btnChapter.Visible     = true;
                        SaveButton.Visible     = true;
                        CancelButton.Visible   = false;
                        SaveExitButton.Visible = false;
                        SaveNextButton.Visible = false;
                    }

                    FillPage(int.Parse(strBookID));
                }
                else
                {
                    if (PrjPub.CurrentLoginUser.RoleID != 1)
                    {
                        ImgSelectEmployee.Visible = false;
                    }
                    SaveButton.Visible        = false;
                    SaveNextButton.Visible    = true;
                    SaveExitButton.Visible    = true;
                    CancelButton.Visible      = false;
                    datePublishDate.DateValue = DateTime.Today.ToString("yyyy-MM-dd");
                    string strKnowledgeID = Request.QueryString.Get("knowledgeId");
                    if (strKnowledgeID != null && strKnowledgeID != string.Empty)
                    {
                        hfKnowledgeID.Value = strKnowledgeID;
                        KnowledgeBLL             objBll = new KnowledgeBLL();
                        RailExam.Model.Knowledge obj    = objBll.GetKnowledge(Convert.ToInt32(strKnowledgeID));
                        txtKnowledgeName.Text      = txtKnowledgeName.Text + GetKnowledgeName("/" + obj.KnowledgeName, obj.ParentId);
                        ImgSelectKnowledge.Visible = false;
                    }

                    ArrayList objOrgList = new ArrayList();
                    if (PrjPub.CurrentLoginUser.SuitRange == 0)
                    {
                        OrganizationBLL orgBll = new OrganizationBLL();
                        txtPublishOrgName.Text = orgBll.GetOrganization(PrjPub.CurrentLoginUser.StationOrgID).ShortName;
                        hfPublishOrgID.Value   = PrjPub.CurrentLoginUser.StationOrgID.ToString();

                        IList <Organization> objOrganizationList =
                            orgBll.GetOrganizationsByWhereClause("ID_Path || '/' like '/1/" + PrjPub.CurrentLoginUser.StationOrgID + "/%' ");
                        foreach (Organization organization in objOrganizationList)
                        {
                            objOrgList.Add(organization.OrganizationId);
                        }
                    }

                    txtAuthors.Text    = PrjPub.CurrentLoginUser.EmployeeName;
                    hfEmployeeID.Value = PrjPub.CurrentLoginUser.EmployeeID.ToString();

                    //txtPublishOrgName.Text = PrjPub.CurrentLoginUser.OrgName;
                    //hfPublishOrgID.Value = PrjPub.CurrentLoginUser.OrgID.ToString();
                    BindOrganizationTree(objOrgList);

                    ArrayList objList = new ArrayList();
                    if (!string.IsNullOrEmpty(Request.QueryString.Get("PostId")))
                    {
                        objList.Add(Convert.ToInt32(Request.QueryString.Get("PostId")));
                    }
                    BindPostTree(objList);

                    ddlTech.SelectedValue = "1";
                }
            }

            if (!string.IsNullOrEmpty(hfTrainTypeID.Value))
            {
                TrainTypeBLL objBll      = new TrainTypeBLL();
                string[]     str         = hfTrainTypeID.Value.Split(',');
                string       strTypeName = "";
                for (int i = 0; i < str.Length; i++)
                {
                    TrainType obj = objBll.GetTrainTypeInfo(Convert.ToInt32(str[i]));
                    if (i == 0)
                    {
                        strTypeName = GetTrainTypeName("/" + obj.TypeName, obj.ParentID);
                    }
                    else
                    {
                        strTypeName = strTypeName + "," + GetTrainTypeName("/" + obj.TypeName, obj.ParentID);
                    }
                }

                txtTrainTypeName.Text = strTypeName;
            }

            if (!string.IsNullOrEmpty(hfPublishOrgID.Value))
            {
                OrganizationBLL orgbll = new OrganizationBLL();
                txtPublishOrgName.Text = orgbll.GetOrganization(Convert.ToInt32(hfPublishOrgID.Value)).ShortName;
            }

            string strRefresh = Request.Form.Get("RefreshCover");

            if (strRefresh != null && strRefresh != "")
            {
                //string strPath = "../Book/" + ViewState["BookID"].ToString() + "/cover.htm";

                //BookBLL objBill = new BookBLL();
                //objBill.UpdateBookUrl(Convert.ToInt32(ViewState["BookID"].ToString()), strPath);

                //string strBookName = objBill.GetBook(Convert.ToInt32(ViewState["BookID"].ToString())).bookName;

                //string srcPath = "../Online/Book/" + ViewState["BookID"].ToString() + "/Cover.htm";
                //string str = File.ReadAllText(Server.MapPath(srcPath), System.Text.Encoding.UTF8);
                //if (str.IndexOf("booktitle") < 0)
                //{
                //    str = "<link href='book.css' type='text/css' rel='stylesheet' />"
                //         + "<div id='booktitle'>" + strBookName + "</div>" + "<br>"
                //         + str;
                //    File.WriteAllText(Server.MapPath(srcPath), str, System.Text.Encoding.UTF8);

                //BookChapterBLL objChapterBll = new BookChapterBLL();
                //objChapterBll.GetIndex(ViewState["BookID"].ToString());

                //SystemLogBLL objLogBll = new SystemLogBLL();
                //objLogBll.WriteLog("编辑教材《" + strBookName + "》前言");

                //FillPage(Convert.ToInt32(ViewState["BookID"].ToString()));
            }
        }
        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.º 30
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();
        }