private string DoAction()
        {
            string comment = this.txtTeacherComment.InnerText;
            string score   = this.txtTeacherScore.Value;

            if (comment == "")
            {
                return("请添加指导教师的评语");
            }
            if (score == "")
            {
                return("请添加指导教师的评分");
            }
            int sc = int.Parse(score);

            // long Topic_relation_id = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + studentID).Topic_relation_id;
            var comment_model = new BLL.CCOM.Comment().GetModel(" Topic_relation_id=" + relationID);

            if (comment_model != null)
            {
                comment_model.Teacher_comment = comment;
                comment_model.Teacher_score   = sc;
                if (!new BLL.CCOM.Comment().Update(comment_model))
                {
                    return("更新评语异常");
                }
            }
            else
            {
                Model.CCOM.Comment com_model = new Model.CCOM.Comment();
                com_model.Teacher_comment   = comment;
                com_model.Teacher_score     = sc;
                com_model.Topic_relation_id = relationID;
                if (new BLL.CCOM.Comment().Add(com_model) == 0)
                {
                    return("添加评语异常");
                }
            }

            return("");
        }
Example #2
0
        private string DoAction()
        {
            var group_model = new BLL.CCOM.Reply_group().GetModel(" Group_id=" + Group_id);
            //var leader_model = new BLL.CCOM.View_User().GetModel(" User_id=" + group_model.User_id);
            string score = this.txtScore.Value;

            if (GetAdminInfo_CCOM().User_id != group_model.User_id)
            {
                if (score == "")
                {
                    return("请添加给定的成绩");
                }
                int sc            = int.Parse(score);
                var student_model = new BLL.CCOM.Reply_student().GetModel(" Group_id=" + Group_id + "and User_id=" + UserID);
                var comment_model = new BLL.CCOM.Reply_commission().GetModel(" Group_id=" + Group_id + "and User_id=" + GetAdminInfo_CCOM().User_id);
                var mark_model    = new BLL.CCOM.Mark_table().GetModel(" Rs_id=" + student_model.Rs_id + " and Rc_id=" + comment_model.Rc_id);
                if (mark_model != null)
                {
                    mark_model.Score     = sc;
                    mark_model.Mark_date = DateTime.Now;
                    if (!new BLL.CCOM.Mark_table().Update(mark_model))
                    {
                        return("更新成绩异常");
                    }
                }
                else
                {
                    Model.CCOM.Mark_table mk_model = new Model.CCOM.Mark_table();
                    mk_model.Rc_id     = comment_model.Rc_id;
                    mk_model.Rs_id     = student_model.Rs_id;
                    mk_model.Score     = sc;
                    mk_model.Mark_date = DateTime.Now;
                    if (new BLL.CCOM.Mark_table().Add(mk_model) == 0)
                    {
                        return("添加成绩异常");
                    }
                }
            }
            else
            {
                string problem = this.txtProblem.InnerText;
                string comment = this.txtReviewComment.InnerText;
                if (problem == "")
                {
                    return("请添加答辩中提出的主要问题及回答的简要情况");
                }
                if (comment == "")
                {
                    return("请添加答辩委员会(小组)的评语");
                }
                if (score == "")
                {
                    return("请添加给定的成绩");
                }
                int sc = int.Parse(score);

                long Topic_relation_id = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + UserID).Topic_relation_id;
                var  comment_model     = new BLL.CCOM.Comment().GetModel(" Topic_relation_id=" + Topic_relation_id);
                if (comment_model != null)
                {
                    comment_model.problem         = problem;
                    comment_model.Comment_content = comment;
                    comment_model.Reply_score     = sc;
                    if (!new BLL.CCOM.Comment().Update(comment_model))
                    {
                        return("更新评语异常");
                    }
                }
                else
                {
                    Model.CCOM.Comment com_model = new Model.CCOM.Comment();
                    com_model.problem           = problem;
                    com_model.Comment_content   = comment;
                    com_model.Reply_score       = sc;
                    com_model.Topic_relation_id = Topic_relation_id;
                    if (new BLL.CCOM.Comment().Add(com_model) == 0)
                    {
                        return("添加评语异常");
                    }
                }
            }


            return("");
        }