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();
        }
Example #2
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            string str = ViewState["PostID"].ToString();

            foreach (TreeViewNode node in tvTrainType.Nodes)
            {
                if (node.Checked == true)
                {
                    TrainStandardBLL objTrainStandard = new TrainStandardBLL();
                    IList <RailExam.Model.TrainStandard> objTrainStandardList =
                        objTrainStandard.GetTrainStandardInfo(0, Convert.ToInt32(str), Convert.ToInt32(node.Value), "", "", "", "", "", "", 0, 200, "");

                    if (objTrainStandardList.Count == 0)
                    {
                        RailExam.Model.TrainStandard obj = new RailExam.Model.TrainStandard();

                        obj.PostID       = Convert.ToInt32(str);
                        obj.TypeID       = Convert.ToInt32(node.Value);
                        obj.TrainTime    = "";
                        obj.TrainContent = "";
                        obj.TrainForm    = "";
                        obj.ExamForm     = "";
                        obj.Description  = "";
                        obj.Memo         = "";

                        objTrainStandard.AddTrainStandard(obj);
                    }
                }

                if (node.Nodes.Count > 0)
                {
                    foreach (TreeViewNode childnode in node.Nodes)
                    {
                        if (childnode.Checked == true)
                        {
                            TrainStandardBLL objTrainStandard = new TrainStandardBLL();
                            IList <RailExam.Model.TrainStandard> objTrainStandardList =
                                objTrainStandard.GetTrainStandardInfo(0, Convert.ToInt32(str), Convert.ToInt32(childnode.Value), "", "", "", "", "", "", 0, 200, "");

                            if (objTrainStandardList.Count == 0)
                            {
                                RailExam.Model.TrainStandard obj = new RailExam.Model.TrainStandard();

                                obj.PostID       = Convert.ToInt32(str);
                                obj.TypeID       = Convert.ToInt32(childnode.Value);
                                obj.TrainTime    = "";
                                obj.TrainContent = "";
                                obj.TrainForm    = "";
                                obj.ExamForm     = "";
                                obj.Description  = "";
                                obj.Memo         = "";

                                objTrainStandard.AddTrainStandard(obj);
                            }
                        }
                    }
                }
            }
            Response.Write("<script>window.opener.form1.Refresh.value='" + str + "' ;window.opener.form1.submit();window.close();</script>");
        }
Example #3
0
        private void GetPost()
        {
            TrainStandardBLL objTrainStandardBll = new TrainStandardBLL();

            RailExam.Model.TrainStandard objTrainStandard =
                objTrainStandardBll.GetTrainStandardInfo(Convert.ToInt32(ViewState["StandardID"].ToString()));

            ViewState["PostID"] = objTrainStandard.PostID;
            lblTitle1.Text      = objTrainStandard.PostName + "岗位相关教材";
        }
Example #4
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") + ");");
        }
Example #5
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;
                }
            }
        }