protected String GetScore(long userId) { var model = new BLL.CCOM.Comput_score().GetModel(1); try { int score_t = 0, score_s = 0, score_c = 0; decimal score = 0; var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + userId); Model.CCOM.Comment model_c = new BLL.CCOM.Comment().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); Model.CCOM.Software_accept model_s = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); score_t = (int)model_c.Teacher_score; score_c = (int)model_c.Reply_score; score_s = (int)model_s.Conclusion; if (model.Ratio_software == 0) { score = score_t * model.Ratio_teacher + (int)((score_s < score_c ? score_s : score_c) * model.Ratio_review); } else { score = score_t * model.Ratio_teacher + (int)((score_s > score_c ? score_s : score_c) * model.Ratio_review); } return(score.ToString()); } catch { return("--"); } }
protected String GetCommentScore(long userId, int type) { int score; try { var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + userId); var model = new BLL.CCOM.Comment().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); if (type == 1) { score = (int)model.Teacher_score; } else { float sc = GetUser_CommentScore(userId); if (sc != -1) { return(sc.ToString()); } else { return("--"); } } } catch { return("--"); } return(score.ToString()); }
protected int ShowInfo() { Model.CCOM.User_information model = GetAdminInfo_CCOM(); long _id = model.User_id; int score_t = -1, score_c = -1, score_s = -1; BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = user_bll.GetModel(_id); if (user_model == null) { InnerRedirect(MyEnums.RediirectErrorEnum.ParameterError); } var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + _id); if (relation_model == null) { return(-1); } var comment_model = new BLL.CCOM.Comment().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); try { score_t = (int)comment_model.Teacher_score; } catch { score_t = -1; } try { score_c = (int)comment_model.Reply_score; } catch { score_c = -1; } try { var soft_model = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); score_s = (int)soft_model.Conclusion; } catch { score_s = -1; } if (score_c >= 0 && score_s >= 0 && score_t >= 0) { return(1); } else { return(0); } }
public void ShowInfo() { // Model.CCOM.View_User user_model = new BLL.CCOM.View_User().GetModel(" User_id=" + UserID); 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); 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); // PageTitle = user_model.User_realname + "的答辩评语表"; this.txtTeacherComment.Disabled = true; this.txtTeacherScore.Disabled = true; string score = "--"; if (comment_model != null) { score = comment_model.Reply_score.ToString(); } reviewTr = "<tr><td class=\"firstTab\">" + leader_model.User_realname + "</td><td class=\"otherTab\">" + GetTitle(leader_model.User_id) + "</td><td class=\"otherTab\">主席</td><td class=\"otherTab\">" + score + "</td></tr>"; var rcs = new BLL.CCOM.Reply_commission().GetModelList(" Group_id=" + Group_id); foreach (var rc in rcs) { var u_model = new BLL.CCOM.View_User().GetModel(" User_id=" + rc.User_id); var mark_table_model = new BLL.CCOM.View_Mark_table().GetModel(" Teacher_id=" + rc.User_id + " and Student_id=" + UserID); score = "--"; if (mark_table_model != null) { score = mark_table_model.Score.ToString(); } reviewTr += "<tr><td class=\"firstTab\">" + u_model.User_realname + "</td><td class=\"otherTab\">" + GetTitle(u_model.User_id) + "</td><td class=\"otherTab\">成员</td><td class=\"otherTab\">" + score + "</td></tr>"; } if (comment_model != null) { this.txtTeacherComment.InnerText = comment_model.Teacher_comment; this.txtTeacherScore.Value = comment_model.Teacher_score.ToString(); this.txtProblem.InnerText = comment_model.problem; this.txtReviewComment.InnerText = comment_model.Comment_content; this.txtScore.Value = comment_model.Reply_score.ToString(); } if (GetAdminInfo_CCOM().User_id != leader_model.User_id) { var mark_table_model = new BLL.CCOM.View_Mark_table().GetModel(" Teacher_id=" + GetAdminInfo_CCOM().User_id + "and student_id=" + UserID); score = ""; if (mark_table_model != null) { score = mark_table_model.Score.ToString(); } this.txtScore.Value = score; this.txtProblem.Disabled = true; this.txtReviewComment.Disabled = true; } }
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(""); }
/// <summary> /// 取得用户口头答辩成绩 /// 返回-1表示没有该生对应的口头答辩成绩 /// </summary> public float GetUser_CommentScore(long userid) { var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + userid + " and Accept_state=1"); if (relation_model == null) { return(-1); } var comment_model = new BLL.CCOM.Comment().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); if (comment_model == null) { return(-1); } if (comment_model.Reply_score == null) { return(-1); } int score = (int)comment_model.Reply_score; int number = 1; var reply_students = new BLL.CCOM.Reply_student().GetModelList(" User_id=" + userid); foreach (var reply_student in reply_students) { long group_id = reply_student.Group_id; if (new BLL.CCOM.Reply_group().GetModel(group_id).Group_type == 0)//筛选出口头答辩组 { var mark_scores = new BLL.CCOM.Mark_table().GetModelList(" Rs_id=" + reply_student.Rs_id); foreach (var mark_score in mark_scores) { if (mark_score.Score != null) { score += (int)mark_score.Score; number++; } } } } return(score / number); }
protected void ShowInfo() { int score_t = -1, score_c = -1, score_s = -1; BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = user_bll.GetModel(_id); if (user_model == null) { InnerRedirect(MyEnums.RediirectErrorEnum.ParameterError); } //真实姓名 if (user_model.User_realname == null) { txt_User_realname.Text = "请填写真实姓名"; } else { this.txt_User_realname.Text = user_model.User_realname; } this.txt_User_number.Text = user_model.User_number; var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + _id); if (relation_model == null) { return; } var comment_model = new BLL.CCOM.Comment().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); try { score_t = (int)comment_model.Teacher_score; this.txtTeacherScore.Text = comment_model.Teacher_score.ToString(); } catch { this.txtTeacherScore.Text = "未评分"; } try { score_c = (int)comment_model.Reply_score; float sc = GetUser_CommentScore(_id); if (sc != -1) { this.txtCommentScore.Text = sc.ToString(); } else { this.txtCommentScore.Text = "未评分"; } this.lblComment.HRef = "CommentPage.aspx?userId=" + DESEncrypt.Encrypt(_id.ToString()); } catch { this.txtCommentScore.Text = "未评分"; } try { var soft_model = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); score_s = (int)soft_model.Conclusion; this.txtScoftwareScore.Text = soft_model.Conclusion.ToString(); this.lblSoft.HRef = "SoftwarePage.aspx?userId=" + DESEncrypt.Encrypt(_id.ToString()); } catch { this.txtScoftwareScore.Text = "未评分"; } if (score_c >= 0 && score_s >= 0 && score_t >= 0) { var model = new BLL.CCOM.Comput_score().GetModel(1); decimal score = 0; if (model.Ratio_software == 0) { score = score_t * model.Ratio_teacher + (int)((score_s < score_c ? score_s : score_c) * model.Ratio_review); } else { score = score_t * model.Ratio_teacher + (int)((score_s > score_c ? score_s : score_c) * model.Ratio_review); } this.txtScore.Text = score.ToString(); } }
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(""); }
protected String GetStudentStatus(long userId, long Group_id) { Model.CCOM.Reply_group model = new BLL.CCOM.Reply_group().GetModel(Group_id); try { if (model.Group_type == 0) { //口头答辩 var group_model = new BLL.CCOM.Reply_group().GetModel(" Group_id=" + Group_id); if (GetAdminInfo_CCOM().User_id != group_model.User_id) //组员 { var mark_table_model = new BLL.CCOM.View_Mark_table().GetModel(" Teacher_id=" + GetAdminInfo_CCOM().User_id); if (mark_table_model != null) { return("<b style=\"color: green;\">已评分</b>"); } else { return("<b style=\"color: red;\">未评分</b>"); } } else { 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.Reply_score != null) { return("<b style=\"color: green;\">已评分</b>"); } else { return("<b style=\"color: red;\">未评分</b>"); } } } else if (model.Group_type == 1) //软件验收 { long Topic_relation_id = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + userId).Topic_relation_id; var software_model = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + Topic_relation_id); if (software_model != null && software_model.Conclusion != null) { return("<b style=\"color: green;\">已评分</b>"); } else { return("<b style=\"color: red;\">未评分</b>"); } } else if (model.Group_type == 2) //开题评审 { long Topic_relation_id = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + userId).Topic_relation_id; var proposal_model = new BLL.CCOM.Proposal().GetModel(" Topic_relation_id=" + Topic_relation_id); if (proposal_model != null && proposal_model.Result > 0) { if (proposal_model.Result == 1) { return("<b style=\"color: green;\">已通过</b>"); } else if (proposal_model.Result == 2) { return("<b style=\"color: red;\">未通过</b>"); } else { return(""); } } else { return("<b>未审核</b>"); } } else { return(""); } } catch { return("--"); } }