示例#1
0
        public void getData()
        {
            PathBll           pathBll  = new PathBll();
            MedtermQualityBll mqBll    = new MedtermQualityBll();
            ScoreBll          scoreBll = new ScoreBll();
            GuideRecordBll    guideBll = new GuideRecordBll();
            CrossBll          crossBll = new CrossBll();
            DefenceBll        dfBll    = new DefenceBll();

            state = Session["state"].ToString();
            if (state == "3")
            {
                student      = (Student)Session["loginuser"];
                stuNO        = student.StuAccount;
                recordResult = Record.selectBystuId(stuNO);
                if (recordResult)
                {
                    ds     = Record.GetByAccount(stuNO);
                    title  = ds.Tables[0].Rows[0]["title"].ToString();  //获取标题
                    planId = ds.Tables[0].Rows[0]["planId"].ToString(); //获取批次ID
                    Plan plan = planBll.Select(int.Parse(planId));      //获取批次信息
                    startTime = plan.StartTime;                         //批次开始时间
                    endTime   = plan.EndTime;                           //批次结束时间
                    string dsTime = ds.Tables[0].Rows[0]["createTime"].ToString();
                    selectTime = Convert.ToDateTime(dsTime);            //学生选定题目时间

                    //获取选题记录ID来取得学生开题报告的信息
                    titleRecordId = ds.Tables[0].Rows[0]["titleRecordId"].ToString();
                    if (opBll.selectByRecordId(int.Parse(titleRecordId)) == true)
                    {
                        opReport        = opBll.Select(int.Parse(titleRecordId));
                        opTime          = opReport.reportTime;
                        teacherOpenning = opReport.teacherOpinion;
                        pathRe          = pathBll.selectByTitleRecordId(titleRecordId);
                        if (pathRe == Result.记录存在)
                        {
                            Path        pathRecordId = pathBll.getTitleRecordId(stuNO);
                            TitleRecord tr           = pathRecordId.titleRecord;
                            pathds       = pathBll.getModel(tr.TitleRecordId, stuNO);   //遍历路径信息(type为0时)
                            checkReport  = pathBll.getCheckReport(tr.TitleRecordId);    //查重
                            mq           = mqBll.Select(tr.TitleRecordId);              //遍历中期质量报告
                            scoreDs      = scoreBll.Select(stuNO, int.Parse(planId));   //获取学生成绩
                            crossGuideDs = crossBll.Select(tr.TitleRecordId);           //遍历交叉指导信息
                            corssDs      = crossBll.SelectByStu(stuNO);
                            defenceDs    = dfBll.getModel(tr.TitleRecordId.ToString()); //遍历答辩记录信息
                        }
                    }
                }
                //else
                //{
                //    Response.Write("你还没有选题,请先进行选题");
                //}
            }
            else
            {
                Response.Write("管理员和教师没有进度条");
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string op   = Context.Request.Form["op"];
            string type = Request.QueryString["type"];

            if (!IsPostBack)
            {
                Search();
                getPage(Search());
            }
            //批次下拉菜单
            if (type == "plandrop")
            {
                dropstrWhereplan = Context.Request.QueryString["dropstrWhereplan"].ToString();
                if (dropstrWhereplan == "0")
                {
                    getPage("");
                }
                string strWhere = string.Format(" planId = {0}", dropstrWhereplan);
                getPage(strWhere);
            }
            //专业下拉菜单
            if (type == "prodrop")
            {
                dropstrWherepro = Context.Request.QueryString["dropstrWherepro"].ToString();
                string strWhere = string.Format(" proId = {0}", dropstrWherepro);
                getPage(strWhere);
            }
            //所有下拉菜单
            if (type == "alldrop")
            {
                dropstrWhereplan = Context.Request.QueryString["dropstrWhereplan"].ToString();
                dropstrWherepro  = Context.Request.QueryString["dropstrWherepro"].ToString();
                string strWhere = string.Format(" proId = {0} and planId = {1}", dropstrWherepro, dropstrWhereplan);
                getPage(strWhere);
            }

            bads  = colbll.Select();
            prods = probll.Select();
            plans = plbll.Select();
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string op  = Context.Request.Form["op"];
            string op1 = Context.Request.QueryString["op"];
            //下拉专业ID
            string dropstrWhere = Request.QueryString["dropstrWhere"];
            //下拉批次ID
            string batchWhere = Request.QueryString["batchWhere"];
            //下拉分院ID
            string collegeIdstWhere = Request.QueryString["collegeIdstrWhere"];
            //搜索信息
            string strsearch = Request.QueryString["search"];

            //获取登录者信息、判断是分院管理员还是超管
            userType     = Session["state"].ToString();
            collegeAdmin = (Teacher)Session["user"];
            if (userType == "0")
            {
                //0为超级管理员
                bads  = colbll.Select();
                prods = probll.Select();

                if (collegeIdstWhere == "0" || collegeIdstWhere == "null" || collegeIdstWhere == null)
                {
                    plands = planbll.Select();
                }
                else
                {
                    plands = planbll.GetplanByCollegeId(int.Parse(collegeIdstWhere));
                }
                if (collegeIdstWhere != null && collegeIdstWhere != "null" && batchWhere == "null")
                {
                    // 分院id不为空,批次id为空

                    getPage(Searchcollege());
                }
                else if (batchWhere != null && batchWhere != "null" && (collegeIdstWhere == "null" || collegeIdstWhere == "0"))
                {
                    // 分院id为空,批次id不为空
                    getPage(batcchdrop());
                }
                else if (collegeIdstWhere != null && collegeIdstWhere != "null" && batchWhere != null && batchWhere != "null")
                {
                    //两个都不为空
                    getPage(SearchCollegeAndBatch());
                }
                else if (strsearch != null)
                {
                    getPage(Search());
                }
                else
                {
                    getPage("");
                }
            }
            else if (userType == "2")
            {
                //2为分院管理员
                //获取分管所在分院ID
                int collegeId = collegeAdmin.college.ColID;

                prods  = probll.SelectByCollegeId(collegeId);
                plands = planbll.GetplanByCollegeId(collegeId);

                if (dropstrWhere != null && dropstrWhere != "null" && batchWhere == "null")
                {// 如果批次id为空,专业id不为空
                    getPage(Searchdrop());
                }
                else if (batchWhere != null && batchWhere != "null" && (dropstrWhere == "null" || dropstrWhere == "0"))
                {// 如果专业id为空,批次id不为空
                    getPage(batcchdrop());
                }
                else if (dropstrWhere != null && dropstrWhere != "null" && batchWhere != null && batchWhere != "null")
                {
                    //两个都不为空
                    getPage(SearchProAndBatch());
                }
                else if (strsearch != null)
                {
                    getPage(Search());
                }
                else
                {
                    getPage("");
                }
            }
            else
            {
                prods  = probll.Select();
                plands = planbll.Select();
                getPage("");
            }
            if (op == "del")
            {//删除
                IsdeleteCollege();
                delPro();
            }
            //导出列表
            if (op1 == "export")
            {
                //分院id
                string collegeId = Request.QueryString["collegeIdstrWhere"];
                //专业id
                string pro = Request.QueryString["dropstrWhere"];
                //批次Id
                string batch = Request.QueryString["batchWhere"];
                //输入框条件
                string input    = Request.QueryString["search"];
                string strWhere = "";

                if (userType == "2")
                {
                    if (input == null)
                    {
                        if ((pro == "null" || pro == "0") && batch == "null")
                        {
                            strWhere = string.Format("");
                        }
                        else if (pro != "null" && batch == "null")
                        {
                            strWhere = string.Format(" where proId = {0}", "'" + pro + "'");
                        }
                        else if ((pro == "null" || pro == "0") && batch != "null")
                        {
                            strWhere = string.Format(" where planId = {0}", "'" + batch + "'");
                        }
                        else
                        {
                            strWhere = string.Format(" where planId = {0} and proId = {1}", "'" + batch + "'", "'" + pro + "'");
                        }
                    }
                    //如果不为空传 input里的值
                    else
                    {
                        strWhere = string.Format(" where teaName {0} or title {0} or realName {0} or planName {0} or proName {0} or collegeName {0}", "like '%" + input + "%'");
                    }
                }
                else
                {
                    if (input == null)
                    {
                        if (collegeId == "null" && batch == "null")
                        {
                            strWhere = string.Format("");
                        }
                        else if (collegeId != "null" && batch == "null")
                        {
                            strWhere = string.Format(" where collegeId = {0}", "'" + collegeId + "'");
                        }
                        else if ((collegeId == "null" || collegeId == "0") && batch != "null")
                        {
                            strWhere = string.Format(" where planId = {0}", "'" + batch + "'");
                        }
                        else
                        {
                            strWhere = string.Format(" where planId = {0} and collegeId = {1}", "'" + batch + "'", "'" + collegeId + "'");
                        }
                    }
                    //如果不为空传 input里的值
                    else
                    {
                        strWhere = string.Format(" where teaName {0} or title {0} or realName {0} or planName {0} or proName {0} or collegeName {0}", "like '%" + input + "%'");
                    }
                }

                TitleRecordBll titlerd = new TitleRecordBll();
                try
                {
                    var       name = DateTime.Now.ToString("yyyyMMddhhmmss") + new Random(DateTime.Now.Second).Next(10000);
                    DataTable dt   = titlerd.ExportExcel(strWhere);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        var path = Server.MapPath("~/download/选题记录导出/" + name + ".xls");
                        ExcelHelper.x2003.TableToExcelForXLS(dt, path);
                        downloadfile(path);
                    }
                    else
                    {
                        Response.Write("<script language='javascript'>alert('查询不到数据,不能执行导出操作!')</script>");
                    }
                }
                catch (Exception ex)
                {
                    LogHelper.Error(this.GetType(), ex);
                }
            }
        }
示例#4
0
        /// <summary>
        /// 执行选题操作
        /// </summary>
        public void StusecltTitle()
        {
            //string stuId = Context.Request["stuId"].ToString();
            int      titleid     = int.Parse(Context.Request.QueryString["titleId"]);
            Title    dstitle     = new Title();
            Plan     plan        = new Plan();
            TitleBll titleSelect = new TitleBll();
            PlanBll  planBll     = new PlanBll();

            dstitle = titleSelect.GetTitle(titleid);

            int limited  = int.Parse(dstitle.Limit.ToString());
            int selected = int.Parse(dstitle.Selected.ToString());

            //获取截止时间
            int pid = dstitle.plan.PlanId;

            plan = planBll.Select(pid);
            string   now     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            DateTime nowTime = Convert.ToDateTime(now);
            string   end     = plan.EndTime.ToString("yyyy-MM-dd HH:mm:ss");
            DateTime endTime = Convert.ToDateTime(end);

            try
            {
                if (nowTime <= endTime)
                {
                    if (selected < limited)
                    {
                        Result row = isExist();
                        if (row == Result.记录不存在)
                        {
                            TitleRecord titleRecord = new TitleRecord();
                            titleRecord.student = stu;
                            Title title = new Title();
                            title.TitleId     = titleid;
                            titleRecord.title = title;

                            int rows = pbll.AddTitlerecord(titleRecord);
                            if (rows > 0)
                            {
                                LogHelper.Info(this.GetType(), stu.StuAccount + " - " + stu.RealName + " - 学生选题 - " + dstitle.TitleId + dstitle.title);
                                Response.Write("选题成功");
                                Response.End();
                            }
                            else
                            {
                                Response.Write("选题失败");
                                Response.End();
                            }
                        }
                        else
                        {
                            Response.Write("已选题");
                            Response.End();
                        }
                    }
                    else
                    {
                        Response.Write("已达上限");
                        Response.End();
                    }
                }
                else
                {
                    Response.Write("选题时间已截止");
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(this.GetType(), ex);
            }
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string op = Request.QueryString["op"];

            //获取数据
            state = Convert.ToInt32(Session["state"]);
            if (state == 0)
            {
                dsPlan  = planBll.Select();
                dsPro   = proBll.Select();
                teacher = (Teacher)Session["user"];
            }
            else
            {
                if (state == 1)
                {
                    teacher = (Teacher)Session["loginuser"];
                }
                else if (state == 2)
                {
                    teacher = (Teacher)Session["user"];
                }
                dsPlan = planBll.getPlanByCid(teacher.college.ColID);
                dsPro  = proBll.SelectByCollegeId(teacher.college.ColID);
            }
            //展示数据
            string type = Request.QueryString["type"];

            order = Request.QueryString["order"];
            if (!IsPostBack)
            {
                Search();
                getdata(Search());
            }
            //导出列表
            if (op == "export")
            {
                try
                {
                    //获取成绩占比
                    Score  scoreRatio = scoreBll.getRatio();
                    double guide      = scoreRatio.guideRatio,
                           cross      = scoreRatio.crossRatio,
                           defen      = scoreRatio.defenceRatio,
                           excellent  = scoreRatio.excellent;
                    //分院id
                    int collegeId = teacher.college.ColID;
                    //专业id
                    string pro = Request.QueryString["dropstrWherepro"];
                    //批次Id
                    string batch = Request.QueryString["dropstrWhereplan"];
                    //输入框条件
                    string input    = Request.QueryString["search"];
                    string strWhere = "(guideScore*" + guide + "+crossScore*" + cross + "+defenceScore*" + defen + ")>=" + excellent;

                    if (state == 2)
                    {
                        if (input == null)
                        {
                            if ((pro == null || pro == "0") && batch == null || pro == "0")
                            {
                                strWhere += string.Format(" where collegeId = {0}", collegeId);
                            }
                            else if (pro != null && batch == null)
                            {
                                strWhere += string.Format(" where proId = {0} and collegeId = {1}", "'" + pro + "'", collegeId);
                            }
                            else if ((pro == null || pro == "0") && batch != null)
                            {
                                strWhere += string.Format(" where planId = {0} and collegeId = {1}", "'" + batch + "'", collegeId);
                            }
                            else
                            {
                                strWhere += string.Format(" where planId = {0} and proId = {1} and collegeId = {2}", "'" + batch + "'", "'" + pro + "'", collegeId);
                            }
                        }
                        //如果不为空传 input里的值
                        else
                        {
                            strWhere += string.Format(" where (teaName {0} or title {0} or realName {0} or planName {0} or proName {0}) and collegeId = {1}", "like '%" + input + "%'", collegeId);
                        }
                    }
                    else if (state == 0)
                    {
                        if (input == null)
                        {
                            if (pro == null && batch == null)
                            {
                                strWhere += "";
                            }
                            else if (pro != null && batch == null)
                            {
                                strWhere += string.Format(" where proId = {0}", "'" + pro + "'");
                            }
                            else if ((pro == null || pro == "0") && batch != null)
                            {
                                strWhere += string.Format(" where planId = {0}", "'" + batch + "'");
                            }
                            else
                            {
                                strWhere += string.Format(" where planId = {0} and proId = {1}", "'" + batch + "'", "'" + pro + "'");
                            }
                        }
                        //如果不为空传 input里的值
                        else
                        {
                            strWhere += string.Format(" where (teaName {0} or title {0} or realName {0} or planName {0} or proName {0})", "like '%" + input + "%'");
                        }
                    }
                    else
                    {
                        if (input == null)
                        {
                            strWhere += string.Format(" where collegeId = {0}", collegeId);
                        }
                        //如果不为空传 input里的值
                        else
                        {
                            strWhere += string.Format(" where (teaName {0} or title {0} or realName {0} or planName {0} or proName {0}) and collegeId = {1}", "like '%" + input + "%'", collegeId);
                        }
                    }

                    var       name = "优质论文" + DateTime.Now.ToString("yyyyMMddhhmmss") + new Random(DateTime.Now.Second).Next(10000);
                    DataTable dt   = scoreBll.ExportExcel(strWhere, scoreRatio);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        var path = Server.MapPath("~/download/学生成绩导出/" + name + ".xls");
                        ExcelHelper.x2007.TableToExcelForXLSX(dt, path);
                        downloadfile(path);
                    }
                    else
                    {
                        Response.Write("<script language='javascript'>alert('查询不到数据,不能执行导出操作!')</script>");
                    }
                }
                catch (Exception ex)
                {
                    LogHelper.Error(this.GetType(), ex);
                }
            }
            //批次下拉菜单
            if (type == "plandrop")
            {
                planId = Request.QueryString["dropstrWhereplan"].ToString();
                if (planId == "0")
                {
                    getdata("");
                }
                else
                {
                    string strWhere = string.Format(" planId = {0}", planId);
                    getdata(strWhere);
                }
            }
            //专业下拉菜单
            if (type == "prodrop")
            {
                proId = Request.QueryString["dropstrWherepro"].ToString();
                if (proId == "0")
                {
                    getdata("");
                }
                else
                {
                    string strWhere = string.Format(" proId = {0}", proId);
                    getdata(strWhere);
                }
            }
            //所有下拉菜单
            if (type == "alldrop")
            {
                planId = Request.QueryString["dropstrWhereplan"].ToString();
                proId  = Request.QueryString["dropstrWherepro"].ToString();
                string strWhere = string.Format(" proId = {0} and planId = {1}", proId, planId);
                getdata(strWhere);
            }
        }