Beispiel #1
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();
    }