Exemple #1
0
        public void insert()
        {
            //获取评定及成绩
            double score         = Convert.ToDouble(Request["score"]);
            string investigation = Request["investigation"];
            string practice      = Request["practice"];
            string solveProblem  = Request["solveProblem"];
            string workAttitude  = Request["workAttitude"];
            string quality       = Request["quality"];
            string evaluate      = Request["evaluate"];
            string innovate      = Request["innovate"];
            string crossTea      = Request["crossTea"];
            //添加评定及成绩
            Student student = new Student();
            Plan    plan    = new Plan();

            try
            {
                student.StuAccount       = stuAccount;
                plan.PlanId              = planId;
                scoreModel.student       = student;
                scoreModel.plan          = plan;
                scoreModel.guideScore    = score;
                scoreModel.investigation = investigation;
                scoreModel.practice      = practice;
                scoreModel.solveProblem  = solveProblem;
                scoreModel.workAttitude  = workAttitude;
                scoreModel.paperDesign   = quality;
                scoreModel.innovate      = innovate;
                scoreModel.evaluate      = evaluate;
                //添加交叉指导教师
                CrossBll    crossBll    = new CrossBll();
                PathBll     pathBll     = new PathBll();
                TitleRecord titleRecord = new TitleRecord();
                Cross       cross       = new Cross();
                Path        path        = new Path();
                Teacher     teacher     = new Teacher();
                titleRecord.TitleRecordId = titleRecordId;
                cross.titleRecord         = titleRecord;
                teacher.TeaAccount        = crossTea;
                cross.teacher             = teacher;

                path.titleRecord = titleRecord;
                path.state       = 3;
                path.type        = 0;
                Result state = pathBll.updateState(path);
                if (state == Result.更新成功)
                {
                    Result recordState = titlebll.updateState(titleRecord.TitleRecordId);
                    if (recordState == Result.更新成功)
                    {
                        Result result = crossBll.Insert(cross);
                        if (result == Result.添加成功)
                        {
                            StudentBll studentBll = new StudentBll();
                            Student    stu        = studentBll.GetModel(stuAccount);
                            TeacherBll teacherBll = new TeacherBll();
                            Teacher    tea        = teacherBll.GetModel(crossTea);
                            LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师指定 - " + stuAccount + " - " + stu.RealName + " - 学生的交叉指导教师 - " + teacher + " - " + tea.TeaName);
                            Result row = sbll.insertInstructorsComments(scoreModel);
                            if (row == Result.添加成功)
                            {
                                LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师添加 - " + stuAccount + " - " + stu.RealName + " - 学生的指导成绩及评定");
                                Response.Write("提交成功");
                                Response.End();
                            }
                            else
                            {
                                Response.Write("提交失败");
                                Response.End();
                            }
                        }
                        else
                        {
                            Response.Write("提交失败");
                            Response.End();
                        }
                    }
                    else
                    {
                        Response.Write("提交失败");
                        Response.End();
                    }
                }
                else
                {
                    Response.Write("提交失败");
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(this.GetType(), ex);
            }
        }