Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //初始化一级知识点Id
            if (Request.QueryString["id"] != null)
            {
                int firstId = int.Parse(Request.QueryString["id"]);
                FirstId        = firstId;
                FirstPointName = pointService.GetFirstPoint(FirstId).FirstPointName;
            }

            if (FirstId == 0)
            {
                Response.Redirect("PointInfo.aspx");
            }

            BindSecondPoint(FirstId);
        }
        if (FirstId == 0)
        {
            Response.Redirect("PointInfo.aspx");
        }
        // alert(FirstId.ToString());
    }
Ejemplo n.º 2
0
    public void BindPoitn()
    {
        List <ExamPoint>  exam_temp = new List <ExamPoint>();
        List <FirstPoint> first     = pointBll.GetFirstPoint();

        if (first != null)
        {
            foreach (var item in first)
            {
                ExamPoint examPoint = new ExamPoint();
                examPoint.firstPoint = item;
                examPoint.IsAllChose = pointBll.SecondHaveAllChose(int.Parse(item.FirstPointId.ToString()));

                List <secondPont> second = pointBll.GetSecondPoint_Plus(int.Parse(item.FirstPointId.ToString()));
                if (second != null)
                {
                    foreach (var subItem in second)
                    {
                        examPoint.secondPoints.Add(subItem);
                    }
                    exam_temp.Add(examPoint);
                }
            }
            ExamPoint_S = exam_temp;
        }
    }
Ejemplo n.º 3
0
    //删除一级知识点
    protected void delete_btn_Click(object sender, EventArgs e)
    {
        int res = 0;

        for (int i = 0; i < Repeater1.Items.Count; i++)
        {
            CheckBox ck = (CheckBox)Repeater1.Items[i].FindControl("CheckBox1");
            if (ck.Checked == true)
            {
                int firstdId = int.Parse(((Label)Repeater1.Items[i].FindControl("idLabel")).Text.ToString());
                if (firstdId != 0)
                {
                    if (pointService.HasSecond(firstdId))
                    {
                        alert(pointService.GetFirstPoint(firstdId).FirstPointName
                              + " 存在二级知识点, 无法删除");
                        return;
                    }
                    else
                    {
                        res = pointService.DeleteFirst(firstdId);
                        if (res == 0)
                        {
                            alert("删除失败");
                            return;
                        }
                    }
                }
            }
        }
        if (res == 1)
        {
            alert("删除成功");
        }
        BindFirstPoint();
    }