Exemple #1
0
    public void SingRoom()
    {
        if (Request.Form["ExamRoomName"] != null)
        {
            string roomName     = Request.Form["ExamRoomName"].ToString();
            string positoing    = Request.Form["ExamRoomPosition"].ToString().Trim();
            string otherTeacher = Request.Form["OtherTeacher"].ToString().Trim();
            if (roomName.Trim() == "" || positoing.Trim() == "" || otherTeacher.Trim() == "")
            {
                infoAlert("请输入考场信息!");
            }

            if (examBll.JudeExamRoomName(nowExam.ExamId.ToString(), roomName, tId))
            {
                alert("该考场名称已被登记", "SingInExamRoom.aspx");
                return;
            }
            if (examBll.JudeExamPosition(nowExam.ExamId.ToString().Trim(), positoing, tId))
            {
                alert("该考场地址已被登记", "SingInExamRoom.aspx");
                return;
            }
            else
            {
                Invigilate newInvigilate = new Invigilate()
                {
                    TId              = tId,
                    ExamId           = nowExam.ExamId,
                    ExamRoomName     = roomName,
                    ExamRoomPosition = positoing,
                    OtherTeacher     = otherTeacher
                };
                int res = examBll.SaveInvigilate(newInvigilate);
                if (res > 0)
                {
                    SuAlert("登记成功");
                    BindData();
                }
                else
                {
                    errAlert("失败");
                    BindData();
                }
            }
        }
    }