protected string BatchRemoveStudent()
        {
            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_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)
                            {
                                continue;
                            }
                            else
                            {
                                if (!bll.Delete(model.Rs_id))
                                {
                                    msg = "移除失败";
                                }
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    msg = "移除发生异常!";
                }
            }
            if (msg == "")
            {
                data["msg"]  = "移除成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
        protected String GetURL(long userId)
        {
            var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + userId);

            if (relation_model == null)
            {
                return("--");
            }
            var model = new BLL.CCOM.Proposal().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id);

            if (model == null)
            {
                return("--");
            }

            var rs_models = new BLL.CCOM.Reply_student().GetModelList(" User_id=" + userId);

            foreach (var rs_model in rs_models)
            {
                long group_id = rs_model.Group_id;
                if (new BLL.CCOM.Reply_group().GetModel(group_id).Group_type == 2)
                {
                    return("<a href=\"ProposalReview.aspx?userId=" + DESEncrypt.Encrypt(userId.ToString()) + "&groupid=" + DESEncrypt.Encrypt(group_id.ToString()) + "&fun_id=<%=DESEncrypt.Encrypt(\"15\") %>开题评审表</a>");

                    break;
                }
            }
            return("--");
        }
        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>";
            }
        }
Esempio n. 4
0
        private void RptBind(string _order)
        {
            var bll = new BLL.CCOM.Reply_student();
            //计算数量
            int totalCount = bll.GetRecordCount(" Group_id=" + apply_id);

            //绑定当页
            this.rptList.DataSource = bll.GetList(" Group_id=" + apply_id);
            this.rptList.DataBind();

            string pageUrl = Utils.CombUrlTxt("StudentList.aspx", "fun_id={0}&groupid={1}", MyRequest.GetQueryString("fun_id"), MyRequest.GetQueryString("groupid"));
        }
        protected string RemoveStudent()
        {
            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);
                    int  groupid = int.Parse(Group_id);
                    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
                        {
                            if (!bll.Delete(model.Rs_id))
                            {
                                msg = "移除失败";
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    msg = "移除发生异常!";
                }
            }
            if (msg == "")
            {
                data["msg"]  = "移除成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
 public string GetStudentNumber(long id)
 {
     try
     {
         var ml     = new BLL.CCOM.Reply_student().GetModelList(" Group_id=" + id);
         int number = ml.Count;
         // if (number == 0) return "0";
         return(Utils.ObjectToStr(number));
     }
     catch
     {
         return("0");
     }
 }
Esempio n. 7
0
        private long GetGroupId(long user_id)
        {
            var groups = new BLL.CCOM.Reply_student().GetModelList(" User_id=" + user_id);

            foreach (var group in groups)
            {
                long group_id = group.Group_id;
                if (new BLL.CCOM.Reply_group().GetModel(group_id).Group_type == 1)
                {
                    return(group_id);
                }
            }
            return(0);
        }
        protected String GetAddStatus(long userId, int Group_id)
        {
            var bll = new BLL.CCOM.Reply_student();

            try
            {
                var model = new BLL.CCOM.Reply_student().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("--");
            }
        }
Esempio n. 9
0
        /// <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);
        }
Esempio n. 10
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("");
        }
Esempio n. 11
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());
        }
        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());
        }