protected string BatchRemoveTeacher() { JsonData data = new JsonData(); string Group_id = MyRequest.GetString("GroupID"); string value = MyRequest.GetString("StudentID"); string msg = ""; if (Tools.CheckParams(Group_id + value)) { msg = "传输异常,存在非法字符!"; } else if (value == "") { msg = "参数异常!"; } else { try { value = Utils.DelLastComma(value); string[] list = value.Split(','); foreach (var tmp in list) { long userid = long.Parse(tmp); int groupid = int.Parse(Group_id); BLL.CCOM.Reply_commission bll = new BLL.CCOM.Reply_commission(); Model.CCOM.Reply_commission model = bll.GetModel(" Group_id=" + groupid + " and User_id=" + userid); if (msg == "") { if (model == null) { continue; } else { if (!bll.Delete(model.Rc_id)) { msg = "移除失败"; } } } } } catch (Exception) { msg = "移除发生异常!"; } } if (msg == "") { data["msg"] = "移除成功"; data["code"] = 1; } else { data["msg"] = msg; data["code"] = 0; } return(data.ToJson()); }
protected void bindTitleInfo() { //Model.CCOM.Examination_arrangement exam_model = new BLL.CCOM.Examination_arrangement().GetModel(Group_id); //Model.CCOM.Examination_room room_model = new BLL.CCOM.Examination_room().GetModel(exam_model.Ea_room); //Model.CCOM.Examination_subject subject_model = new BLL.CCOM.Examination_subject().GetModel(" Ea_id='" + exam_model.Ea_id + "'"); //string year = ""; //if (subject_model != null) //{ // Model.CCOM.Subject s_model = new BLL.CCOM.Subject().GetModel(subject_model.Esn_id); // year = new BLL.CCOM.Period().GetModel(s_model.Period_id).Period_year; //} //if (year == "") year = Utils.ObjectToStr(DateTime.Now.Year); //this.lbltime.Text = Convert.ToDateTime(exam_model.Ea_starttime).ToString("MM月dd日 HH:mm"); //this.lblplace.Text = room_model.Er_building + room_model.Er_floor + "层" + room_model.Er_room; Model.CCOM.Reply_group rg_model = new BLL.CCOM.Reply_group().GetModel(Group_id); this.lbltime.Text = rg_model.Reply_time.ToString("yyyy年MM月dd日 HH:mm"); this.lblplace.Text = rg_model.Reply_room; this.lbltitle.Text = rg_model.Group_name; if (rg_model.Group_type == 0) { page_title = "2017软件学院毕业设计答辩安排"; this.lbltype.Text = "口头答辩"; } else if (rg_model.Group_type == 1) { page_title = "2017软件学院毕业设计软件验收安排"; this.lbltype.Text = "软件验收"; } else if (rg_model.Group_type == 2) { page_title = "2017软件学院开题评审答辩安排"; this.lbltype.Text = "开题评审"; } //绑定答辩委员会 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); reviewTr1 = "<tr><td style=\"text-align:center\">" + leader_model.User_realname + "</td><td style=\"text-align:center\">" + leader_model.Role_name + "</td><td style=\"text-align:center\">主席</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); reviewTr1 += "<tr><td style=\"text-align:center\">" + u_model.User_realname + "</td><td style=\"text-align:center\">" + u_model.Role_name + "</td><td style=\"text-align:center\">成员</td></tr>"; } //绑定学生 var rss = new BLL.CCOM.Reply_student().GetModelList("Group_id=" + Group_id + " order by User_id"); BLL.CCOM.View_Selete_Topic user_bll = new BLL.CCOM.View_Selete_Topic(); foreach (var rs in rss) { var s_model = new BLL.CCOM.View_Selete_Topic().GetModel(" Student_id=" + rs.User_id); reviewTr2 += "<tr><td style=\"text-align:center\">" + s_model.Student_name + "</td><td style=\"text-align:center\">" + s_model.User_number + "</td><td style=\"text-align:center\">" + s_model.Teacher_name + "</td><td style=\"text-align:center\">" + s_model.Topic_name + "</td></tr>"; } }
protected string AddTeacher() { JsonData data = new JsonData(); string Group_id = MyRequest.GetString("GroupID"); string User_id = MyRequest.GetString("TeacherID"); string msg = ""; if (Tools.CheckParams(Group_id + User_id)) { msg = "传输异常,存在非法字符!"; } else { try { long userid = long.Parse(User_id); long groupid = long.Parse(Group_id); BLL.CCOM.Reply_commission bll = new BLL.CCOM.Reply_commission(); Model.CCOM.Reply_commission model = bll.GetModel(" Group_id=" + groupid + " and User_id=" + userid); if (msg == "") { if (model != null) { msg = "教师已在该答辩组中"; } else { model = new Model.CCOM.Reply_commission(); model.Group_id = groupid; model.User_id = userid; if (bll.Add(model) <= 0) { msg = "添加失败"; } } } } catch (Exception) { msg = "添加发生异常!"; } } if (msg == "") { data["msg"] = "添加成功"; data["code"] = 1; } else { data["msg"] = msg; data["code"] = 0; } return(data.ToJson()); }
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; } }
protected string RemoveTeacher() { JsonData data = new JsonData(); string Group_id = MyRequest.GetString("GroupID"); string User_id = MyRequest.GetString("TeacherID"); string msg = ""; if (Tools.CheckParams(Group_id + User_id)) { msg = "传输异常,存在非法字符!"; } else { try { long userid = long.Parse(User_id); int groupid = int.Parse(Group_id); BLL.CCOM.Reply_commission bll = new BLL.CCOM.Reply_commission(); Model.CCOM.Reply_commission model = bll.GetModel(" Group_id=" + groupid + " and User_id=" + userid); if (msg == "") { if (model == null) { msg = "教师不在该答辩组中"; } else { if (!bll.Delete(model.Rc_id)) { msg = "移除失败"; } } } } catch (Exception) { msg = "移除发生异常!"; } } if (msg == "") { data["msg"] = "移除成功"; data["code"] = 1; } else { data["msg"] = msg; data["code"] = 0; } return(data.ToJson()); }
protected void Page_Load(object sender, EventArgs e) { this.fun_id = MyRequest.GetQueryString("fun_id"); if (!Page.IsPostBack) { var model = GetAdminInfo_CCOM(); BLL.CCOM.Reply_group rg_bll = new BLL.CCOM.Reply_group(); BLL.CCOM.Reply_commission rc_bll = new BLL.CCOM.Reply_commission(); List <Model.CCOM.Reply_group> modellist1 = rg_bll.GetModelList("User_id=" + model.User_id); List <Model.CCOM.Reply_commission> modellist2 = rc_bll.GetModelList("User_id=" + model.User_id); if (modellist1.Count == 0 && modellist2.Count == 0) { string ht = ""; ht = " <div class=\"content\" align=\"center\"><h3>您尚无权限<h3><table class=\"table table-striped table-bordered dataTable\"></table></div>"; this.print_div.InnerHtml = ht; } else { string _order = MyRequest.GetString("sort").Replace(",", " "); if (_order == "" || Tools.CheckParams(_order)) { _order = " Group_id asc"; } StringBuilder strTemp = new StringBuilder(); strTemp.Append("("); string res = ""; foreach (Model.CCOM.Reply_group rg_model in modellist1) { res += rg_model.Group_id + ","; } foreach (Model.CCOM.Reply_commission rg_model in modellist2) { res += rg_model.Group_id + ","; } if (res != "") { strTemp.Append(Utils.DelLastComma(res) + ")"); } else { strTemp.Append("0)"); } RptBind(strTemp.ToString(), _order); } } }
protected String GetAddStatus(long userId, int Group_id) { var bll = new BLL.CCOM.Reply_commission(); try { var model = new BLL.CCOM.Reply_commission().GetModel(" User_id=" + userId + "and Group_id=" + Group_id); if (model != null) { return("<b style=\"color: green;\">已添加</b>"); } else { return("<b style=\"color: red;\">未添加</b>"); } } catch { return("--"); } }
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(""); }
public void ShowInfo() { Model.CCOM.View_User user_model = new BLL.CCOM.View_User().GetModel(" User_id=" + UserID); long Group_id = GetGroupId(UserID); if (Group_id == 0) { this.print_div.InnerHtml = " <div class=\"content\" align=\"center\"><h3>您尚未被分配到任何软件验收组<h3><table class=\"table table-striped table-bordered dataTable\"></table></div>";; btnSubmit.Visible = false; return; } 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); PageTitle = user_model.User_realname + "的软件验收表"; this.txtRunStatus.Disabled = true; this.txtFeature.Disabled = true; this.txtScore.Disabled = true; this.lblName.InnerText = user_model.User_realname; this.lblNumber.InnerHtml = user_model.User_number; var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + UserID); if (relation_model != null) { this.lblTeacher.InnerText = new BLL.CCOM.User_information().GetModel(relation_model.Teacher_id).User_realname; this.lblTitle.InnerText = new BLL.CCOM.Topic().GetModel(relation_model.Topic_id).Topic_name; } else { return; } string leader_title = "--"; var leader_tutor_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + leader_model.User_id); if (leader_tutor_model != null) { if (leader_tutor_model.Title_id != null) { leader_title = new BLL.CCOM.Title().GetModel((int)leader_tutor_model.Title_id).Title_name; } else { leader_title = "--"; } } reviewTr = "<tr><td style=\"text-align:center;\">组长</td><td style=\"text-align:center;\">" + leader_model.User_realname + "</td><td style=\"text-align:center;\">" + leader_title + "</td><td colspan=\"3\" style=\"text-align:center;\">" + leader_model.Agency_name + "</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); string title = "--"; var tutor_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + rc.User_id); if (tutor_model != null) { if (tutor_model.Title_id != null) { title = new BLL.CCOM.Title().GetModel((int)tutor_model.Title_id).Title_name; } else { title = "--"; } } reviewTr += "</tr><td style=\"text-align:center;\">组员</td><td style=\"text-align:center;\">" + u_model.User_realname + "</td><td style=\"text-align:center;\">" + title + "</td><td colspan=\"3\" style=\"text-align:center;\">" + u_model.Agency_name + "</td></tr>"; } var software_model = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); if (software_model != null) { if (software_model.Time != null) { this.lblTime.InnerText = software_model.Time.Value.ToString("yyyy年MM月dd日 HH:mm:ss"); } this.txtDataList.InnerText = software_model.Data_list; this.txtAnguage.InnerText = software_model.anguage; this.txtEnvironmental.InnerText = software_model.Environmental; this.txtLineCount.InnerText = software_model.Line_count; this.txtLineHand.InnerText = software_model.Line_hand; this.txtRunStatus.InnerText = software_model.Run_status; this.txtFeature.InnerText = software_model.Feature; this.txtScore.Value = software_model.Conclusion.ToString(); } }
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); if (GetAdminInfo_CCOM().User_id != leader_model.User_id) { this.txtOpinion.Disabled = true; this.ddlresult.Enabled = false; this.btnSubmit.Visible = false; } this.lblName.InnerText = user_model.User_realname; this.lblNumber.InnerHtml = user_model.User_number; var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + UserID); if (relation_model != null) { this.lblTeacher.InnerText = new BLL.CCOM.User_information().GetModel(relation_model.Teacher_id).User_realname; var topic_model = new BLL.CCOM.Topic().GetModel(relation_model.Topic_id); this.lblTitle.InnerText = topic_model.Topic_name; this.lblNature.InnerText = topic_model.Topic_nature; this.lblSource.InnerText = topic_model.Topic_source; } else { return; } string leader_title = "--"; var leader_tutor_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + leader_model.User_id); if (leader_tutor_model != null) { if (leader_tutor_model.Title_id != null) { leader_title = new BLL.CCOM.Title().GetModel((int)leader_tutor_model.Title_id).Title_name; } else { leader_title = "--"; } } reviewTr = "<tr><td style=\"text-align:center;\">组长</td><td style=\"text-align:center;\">" + leader_model.User_realname + "</td><td style=\"text-align:center;\">" + leader_title + "</td><td colspan=\"3\" style=\"text-align:center;\">" + leader_model.Agency_name + "</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); string title = "--"; var tutor_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + rc.User_id); if (tutor_model != null) { if (tutor_model.Title_id != null) { title = new BLL.CCOM.Title().GetModel((int)tutor_model.Title_id).Title_name; } else { title = "--"; } } reviewTr += "</tr><td style=\"text-align:center;\">组员</td><td style=\"text-align:center;\">" + u_model.User_realname + "</td><td style=\"text-align:center;\">" + title + "</td><td colspan=\"3\" style=\"text-align:center;\">" + u_model.Agency_name + "</td></tr>"; } var proposal_model = new BLL.CCOM.Proposal().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); if (proposal_model != null) { this.txtOpinion.InnerText = proposal_model.Review; this.ddlresult.SelectedValue = proposal_model.Result.ToString(); } }
protected string BatchAddTeacher() { JsonData data = new JsonData(); string Group_id = MyRequest.GetString("GroupID"); string User_id_List = MyRequest.GetString("TeacherID"); string msg = ""; if (Tools.CheckParams(Group_id + User_id_List)) { msg = "传输异常,存在非法字符!"; } else if (User_id_List == "") { msg = "参数异常!"; } else { try { User_id_List = Utils.DelLastComma(User_id_List); string[] list = User_id_List.Split(','); foreach (var tmp in list) { long userid = long.Parse(tmp); long groupid = long.Parse(Group_id); BLL.CCOM.Reply_commission bll = new BLL.CCOM.Reply_commission(); Model.CCOM.Reply_commission model = bll.GetModel(" Group_id=" + groupid + " and User_id=" + userid); if (msg == "") { if (model != null) { continue; } else { model = new Model.CCOM.Reply_commission(); model.Group_id = groupid; model.User_id = userid; if (bll.Add(model) <= 0) { msg = "添加失败"; } } } } } catch (Exception) { msg = "添加发生异常!"; } } if (msg == "") { data["msg"] = "添加成功"; data["code"] = 1; } else { data["msg"] = msg; data["code"] = 0; } return(data.ToJson()); }
protected string CombSqlTxt() { int flag = 0; int i = 0; var model = GetAdminInfo_CCOM(); StringBuilder strTemp = new StringBuilder(); BLL.CCOM.Reply_student rs_bll = new BLL.CCOM.Reply_student(); BLL.CCOM.Reply_commission rc_bll = new BLL.CCOM.Reply_commission(); BLL.CCOM.Reply_group rg_bll = new BLL.CCOM.Reply_group(); strTemp.Append("("); //学生 DataSet ds = rs_bll.GetList("User_id=" + model.User_id); if (ds.Tables[0].Rows.Count > 0) { flag = 1; strTemp.Append(ds.Tables[0].Rows[0]["Group_id"]); for (i = 1; i < ds.Tables[0].Rows.Count; i++) { strTemp.Append("," + ds.Tables[0].Rows[i]["Group_id"]); } } //组长 ds = rg_bll.GetList("User_id=" + model.User_id); if (ds.Tables[0].Rows.Count > 0) { if (flag == 0) { flag = 1; strTemp.Append(ds.Tables[0].Rows[0]["Group_id"]); i = 1; } else { i = 0; } for (; i < ds.Tables[0].Rows.Count; i++) { strTemp.Append("," + ds.Tables[0].Rows[i]["Group_id"]); } } //组员 ds = rc_bll.GetList("User_id=" + model.User_id); if (ds.Tables[0].Rows.Count > 0) { if (flag == 0) { flag = 1; strTemp.Append(ds.Tables[0].Rows[0]["Group_id"]); i = 1; } else { i = 0; } for (; i < ds.Tables[0].Rows.Count; i++) { strTemp.Append("," + ds.Tables[0].Rows[i]["Group_id"]); } } if (flag == 0) { strTemp.Append("-1"); } strTemp.Append(")"); return(strTemp.ToString()); }