示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.fun_id   = get_fun_id("CCOM/ScoreManage/StudentList.aspx");
     this.apply_id = long.Parse(DESEncrypt.Decrypt(MyRequest.GetQueryString("groupid")));
     if (this.apply_id == 0)
     {
         JscriptMsg("传输参数不正确!", "back", "Error");
         return;
     }
     Model.CCOM.Reply_group model = new BLL.CCOM.Reply_group().GetModel(apply_id);
     if (model.Group_type == 0)
     {
         PageTitle = "口头答辩打分";
     }
     else if (model.Group_type == 1)
     {
         PageTitle = "软件验收打分";
     }
     else if (model.Group_type == 2)
     {
         PageTitle = "开题评审打分";
     }
     if (!Page.IsPostBack)
     {
         ShowApplyTitle();
         RptBind(" User_id desc ");
     }
 }
        //#region 组合SQL查询语句==========================
        //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();
        //}
        //#endregion

        #region 数据绑定=================================
        private void RptBind(string _strWhere, string _order)
        {
            BLL.CCOM.Reply_group bll = new BLL.CCOM.Reply_group();
            int    pageSize          = GetPageSize(15);//每页数量
            int    page        = MyRequest.GetQueryInt("page", 1);
            string keywords    = MyRequest.GetQueryString("keywords");
            int    start_index = pageSize * (page - 1) + 1;

            this.st_index = pageSize * (page - 1) + 1;
            int end_index = pageSize * page;

            if (_strWhere != "")
            {
                _strWhere = "Group_id in" + _strWhere;
            }
            //计算数量
            int totalCount = bll.GetRecordCount(_strWhere);

            //绑定当页
            this.rptList.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("MyExamList.aspx", "fun_id={0}&keywords={1}&sort={2}&page={3}", this.fun_id, this.keywords, MyRequest.GetString("sort"), "__id__");

            this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true);
        }
        //删除
        protected void lbtSingleDelete_Click(object sender, EventArgs e)
        {
            BLL.CCOM.Reply_group bll = new BLL.CCOM.Reply_group();
            var lbtn = sender as LinkButton;

            if (lbtn != null)
            {
                var  id     = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString()));
                bool result = true;
                try
                {
                    result = bll.Delete(id);
                }
                catch
                {
                    result = false;
                }
                string keywords = this.keywords;
                int    page     = MyRequest.GetQueryInt("page", 1);
                if (result == true)
                {
                    JscriptMsg("删除成功!", Utils.CombUrlTxt("ExamList.aspx", "fun_id={0}&keywords={1}&sort={2}&page={3}",
                                                         this.fun_id, this.keywords, MyRequest.GetString("sort"), "__id__"), "Success");
                }
                else
                {
                    JscriptMsg("删除失败!", Utils.CombUrlTxt("ExamList.aspx", "fun_id={0}&keywords={1}&sort={2}&page={3}",
                                                         this.fun_id, this.keywords, MyRequest.GetString("sort"), "__id__"), "Error");
                }
            }
        }
示例#4
0
        private void ShowApplyTitle()
        {
            var m = new BLL.CCOM.Reply_group().GetModel((int)this.apply_id);

            title.HRef          = "ExamList.aspx?fun_id=" + MyRequest.GetQueryString("fun_id");
            this.lblTitle.Text += m.Group_name;
        }
示例#5
0
        protected string CombSqlTxt(string _keywords)
        {
            StringBuilder strTemp = new StringBuilder();

            //if (GetSonUOList(apply_id) != "") strTemp.Append(" Agency_id in (" + GetSonUOList(apply_id) + ")");
            //else strTemp.Append(" Agency_id = 0");

            //BLL.CCOM.Period per_bll = new BLL.CCOM.Period();
            //Model.CCOM.Period per_model = per_bll.GetModel(" Period_state=1");
            //if (per_model != null) strTemp.Append(" and Period_id='" + per_model.Period_id + "'");
            //else strTemp.Append(" and Period_id='0'");
            BLL.CCOM.Reply_group   per_bll   = new BLL.CCOM.Reply_group();
            Model.CCOM.Reply_group per_model = per_bll.GetModel("Group_id=" + apply_id);
            strTemp.Append(" Role_id != 3 and Role_id != 1 and Role_id != 4 and User_id !=" + per_model.User_id);//非学生,教学干事,系统管理员,组长
            _keywords = _keywords.Replace("'", "");
            if (!string.IsNullOrEmpty(_keywords))
            {
                strTemp.Append(" and (");
                strTemp.Append(" User_realname like '%" + _keywords + "%' ");
                strTemp.Append(" or User_number like '%" + _keywords + "%' ");
                strTemp.Append(" or Agency_name like '%" + _keywords + "%' ");
                strTemp.Append(")");
            }
            return(strTemp.ToString());
        }
        //保存
        protected void btn_Submit_Click(object sender, EventArgs e)
        {
            var student_models = new BLL.CCOM.User_information().GetModelList(" Role_id=3");

            foreach (var student_model in student_models)
            {
                if (!new BLL.CCOM.User_information().Delete(student_model.User_id))
                {
                    JscriptMsg("删除学生:" + student_model.User_realname + "时,发生异常!", "", "Error");
                    return;
                }
            }

            var topic_models = new BLL.CCOM.Topic().GetModelList("");

            foreach (var topic_model in topic_models)
            {
                if (!new BLL.CCOM.Topic().Delete(topic_model.Topic_id))
                {
                    JscriptMsg("删除选题:" + topic_model.Topic_name + "时,发生异常!", "", "Error");
                    return;
                }
            }

            var teachweek_models = new BLL.CCOM.Teach_week().GetModelList("");

            foreach (var teachweek_model in teachweek_models)
            {
                if (!new BLL.CCOM.Teach_week().Delete(teachweek_model.TeachWeek_id))
                {
                    JscriptMsg("删除异常!", "", "Error");
                    return;
                }
            }

            var reply_models = new BLL.CCOM.Reply_group().GetModelList("");

            foreach (var reply_model in reply_models)
            {
                if (!new BLL.CCOM.Reply_group().Delete(reply_model.Group_id))
                {
                    JscriptMsg("删除答辩组:" + reply_model.Group_name + "时,发生异常!", "", "Error");
                    return;
                }
            }

            var user_models = new BLL.CCOM.User_information().GetModelList(" Role_id!=1");

            foreach (var student_model in user_models)
            {
                if (!new BLL.CCOM.User_information().Delete(student_model.User_id))
                {
                    JscriptMsg("删除用户:" + student_model.User_realname + "时,发生异常!", "", "Error");
                    return;
                }
            }

            JscriptMsg("初始化成功!", "InitSystem.aspx?fun_id=" + DESEncrypt.Encrypt(this.fun_id), "Success");
        }
        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>";
            }
        }
示例#8
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;
            }
        }
        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);
                }
            }
        }
示例#10
0
        protected void InitView()
        {
            Model.CCOM.Reply_group model = new BLL.CCOM.Reply_group().GetModel(Group_id);
            if (model != null)
            {
                try
                {
                    BLL.CCOM.User_information   user_bll   = new BLL.CCOM.User_information();
                    Model.CCOM.User_information user_model = new Model.CCOM.User_information();

                    this.txtGroupName.Text  = model.Group_name;
                    this.txtReplyTime.Value = model.Reply_time.ToString("yyyy-MM-dd HH:mm:ss");
                    this.txtReplyRoom.Text  = model.Reply_room;
                    user_model                 = user_bll.GetModel(model.User_id);
                    this.txtTeaNumber.Text     = user_model.User_number;
                    this.ddltype.SelectedValue = model.Group_type.ToString();
                }
                catch { }
            }
        }
示例#11
0
 protected String GetHref()
 {
     Model.CCOM.Reply_group model = new BLL.CCOM.Reply_group().GetModel(apply_id);
     if (model.Group_type == 1)
     {
         return("SoftwareScore");
     }
     else if (model.Group_type == 0)
     {
         return("CommentScore");
     }
     else if (model.Group_type == 2)//需要添加开题评审页面
     {
         return("ProposalReview");
     }
     else
     {
         return("");
     }
 }
示例#12
0
 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("--");
     }
 }
示例#13
0
        private void ShowApplyTitle()
        {
            var m = new BLL.CCOM.Reply_group().GetModel((int)this.apply_id);

            this.lblTitle.Text += m.Group_name;
        }
示例#14
0
        private string DoAction()
        {
            string result = "";

            BLL.CCOM.Reply_group   bll = new BLL.CCOM.Reply_group();
            Model.CCOM.Reply_group model;
            if (action != MyEnums.ActionEnum.Edit.ToString())
            {
                model = new Model.CCOM.Reply_group();
            }
            else
            {
                model = bll.GetModel(Group_id);
            }
            string GroupName = this.txtGroupName.Text.Trim();
            string TeaNumber = this.txtTeaNumber.Text.Trim();
            // string Time = this.txtReplyTime.Text.Trim();
            string Room      = this.txtReplyRoom.Text.Trim();
            string Goup_type = this.ddltype.SelectedValue;

            //必填部分
            if (Tools.CheckParams(GroupName + TeaNumber + Room))
            {
                return("请勿输入非法字符");
            }

            if (GroupName == "")
            {
                return("请填答辩组名称");
            }
            if (TeaNumber == "")
            {
                return("请填组长工号");
            }
            if (this.txtReplyTime.Value == "")
            {
                return("请填写答辩时间");
            }
            if (Room == "")
            {
                return("请填写答辩地点");
            }

            if (Goup_type == "#")
            {
                return("请选择答辩类型");
            }
            else if (Goup_type == "0")
            {
                model.Group_type = 0;
            }
            else if (Goup_type == "1")
            {
                model.Group_type = 1;
            }
            else if (Goup_type == "2")
            {
                model.Group_type = 2;
            }

            model.Group_name = GroupName;
            model.Reply_time = Convert.ToDateTime(this.txtReplyTime.Value);;
            model.Reply_room = Room;
            BLL.CCOM.User_information   user_bll = new BLL.CCOM.User_information();
            Model.CCOM.User_information uset_model;
            uset_model = user_bll.GetModel("User_number='" + TeaNumber + "'and Role_id!=3");
            if (uset_model == null)
            {
                return("该教师用户不存在");
            }
            else
            {
                model.User_id = uset_model.User_id;
            }



            try
            {
                if (action == MyEnums.ActionEnum.Edit.ToString()) //修改
                {
                    bll.Update(model);
                }
                else
                {
                    bll.Add(model);
                }
            }
            catch (Exception ex)
            {
                result = action == MyEnums.ActionEnum.Edit.ToString() ? "修改失败" : "添加失败" + ex.Message.ToString();
            }

            return(result);
        }
示例#15
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("");
        }
示例#16
0
        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();
            }
        }
        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());
        }
        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();
            }
        }
示例#19
0
        protected string AddStudent()
        {
            JsonData data     = new JsonData();
            string   Group_id = MyRequest.GetString("GroupID");
            string   User_id  = MyRequest.GetString("StudentID");
            string   msg      = "";

            if (Tools.CheckParams(Group_id + User_id))
            {
                msg = "传输异常,存在非法字符!";
            }
            else
            {
                try
                {
                    long userid  = long.Parse(User_id);
                    long groupid = long.Parse(Group_id);

                    //判断学生是否已经选题
                    var topic_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + userid + " and Accept_state=1");
                    if (topic_model == null)
                    {
                        msg = "该同学尚未选择毕设题目!";
                    }

                    BLL.CCOM.Reply_student   bll   = new BLL.CCOM.Reply_student();
                    Model.CCOM.Reply_student model = bll.GetModel(" Group_id=" + groupid + " and User_id=" + userid);
                    if (msg == "")
                    {
                        if (model != null)
                        {
                            msg = "学生已在该答辩组中";
                        }
                        else
                        {
                            bool isIn           = true;
                            var  student_models = new BLL.CCOM.Reply_student().GetModelList(" User_id=" + User_id);
                            var  group_model    = new BLL.CCOM.Reply_group().GetModel(long.Parse(Group_id));
                            Model.CCOM.Reply_group other_model = null;;
                            foreach (Model.CCOM.Reply_student student_model in student_models)
                            {
                                if (new BLL.CCOM.Reply_group().GetModel(student_model.Group_id).Group_type.Equals(group_model.Group_type))
                                {
                                    isIn        = false;
                                    other_model = new BLL.CCOM.Reply_group().GetModel(student_model.Group_id);
                                    break;
                                }
                            }

                            if (isIn)
                            {
                                model          = new Model.CCOM.Reply_student();
                                model.Group_id = groupid;
                                model.User_id  = userid;
                                if (bll.Add(model) <= 0)
                                {
                                    msg = "添加失败";
                                }
                            }
                            else
                            {
                                string name = new BLL.CCOM.User_information().GetModel(userid).User_realname;
                                msg = "学生" + name + "已在" + other_model.Group_name + "答辩组中";
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    msg = "添加发生异常!";
                }
            }
            if (msg == "")
            {
                data["msg"]  = "添加成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }