Example #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("管理员和教师没有进度条");
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            tea = (Teacher)Session["loginuser"];
            TitleRecordBll trbll      = new TitleRecordBll();
            PathBll        pathBll    = new PathBll();
            Teacher        teacher    = (Teacher)Session["loginuser"];
            string         teaAccount = teacher.TeaAccount;

            collegeId = teacher.college.ColID;
            string addop = Context.Request.Form["op"];
            string type  = Request.QueryString["type"];

            op = Request["op"];
            try
            {
                if (op == "add")
                {
                    string         stuAccount = Request["stuAccount"];
                    string         opinion    = Request["opinion"];
                    GuideRecordBll guideBll   = new GuideRecordBll();
                    GuideRecord    guide      = new GuideRecord();
                    DataSet        dsTR       = trbll.GetByAccount(stuAccount);
                    int            i          = dsTR.Tables[0].Rows.Count - 1;
                    guide.opinion = opinion;
                    TitleRecord titleRecord = new TitleRecord();
                    titleRecord.TitleRecordId = Convert.ToInt32(dsTR.Tables[0].Rows[i]["titleRecordId"].ToString());
                    guide.titleRecord         = titleRecord;
                    guide.dateTime            = DateTime.Now;
                    path             = pathBll.Select(titleRecord.TitleRecordId, stuAccount);
                    guide.path       = path;
                    path.titleRecord = titleRecord;
                    path.state       = 1;
                    path.type        = 0;
                    Result result = pathBll.updateState(path);
                    if (result == Result.更新成功)
                    {
                        Result row = guideBll.Insert(guide);
                        if (row == Result.添加成功)
                        {
                            StudentBll studentBll = new StudentBll();
                            Student    stu        = studentBll.GetModel(stuAccount);
                            LogHelper.Info(this.GetType(), tea.TeaAccount + " - " + tea.TeaName + " - 教师添加 - " + stuAccount + " - " + stu.RealName + " - 学生的指导记录");
                            Response.Write("提交成功");
                            Response.End();
                        }
                        else
                        {
                            Response.Write("提交失败");
                            Response.End();
                        }
                    }
                    else
                    {
                        Response.Write("提交失败");
                        Response.End();
                    }
                }
                else if (op == "download")
                {
                    download = "download";
                    string account          = Request["stuAccount"];
                    Path   getTitleRecordId = pathBll.getTitleRecordId(account);
                    int    titleRecordId    = getTitleRecordId.titleRecord.TitleRecordId;
                    paperPath = pathBll.Select(titleRecordId, account);
                    //Response.Redirect(paperPath.paperPath);
                    Response.Write("<script>$('#loadHref').href = '" + paperPath.paperPath + "';</script>");
                    //Response.End();
                }
                if (!IsPostBack)
                {
                    Search();
                    getPage(Search());
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(this.GetType(), ex);
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Student student = (Student)Session["loginuser"];

            HttpFileCollection files = Request.Files;
            string             msg   = string.Empty;
            string             error = string.Empty;

            if (files.Count > 0)
            {
                try
                {
                    string stuAccount = student.StuAccount;
                    string stuName    = student.RealName;
                    string year       = DateTime.Now.ToString("yyyy");
                    string absPath    = "/upload/学生/" + stuAccount + stuName + "/论文/" + year + "/";
                    string director   = Server.MapPath(absPath);
                    if (!Directory.Exists(director))
                    {
                        Directory.CreateDirectory(director);
                    }
                    string now      = DateTime.Now.ToString("yyyyMMddHHmmss");
                    string path     = director + System.IO.Path.GetFileName(now + "-" + files[0].FileName);
                    string fileName = absPath + now + "-" + files[0].FileName;
                    if (File.Exists(path))
                    {
                        msg = "上传失败,文件存在";
                    }
                    if ((files[0].ContentLength / 1000) > 1024000) //1G大小
                    {
                        msg = "文件大小超过限制";
                    }
                    else
                    {
                        string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        files[0].SaveAs(path);

                        Model.Path _path         = pathBll.getTitleRecordId(student.StuAccount);
                        int        titleRecordId = _path.titleRecord.TitleRecordId;

                        Model.Path  insertPath  = new Model.Path();
                        TitleRecord titleRecord = new TitleRecord();
                        titleRecord.TitleRecordId = titleRecordId;
                        insertPath.titleRecord    = titleRecord;
                        insertPath.title          = files[0].FileName.Substring(0, files[0].FileName.Length - 4);
                        insertPath.paperPath      = fileName;
                        insertPath.dateTime       = Convert.ToDateTime(time);

                        Result result = pathBll.InsertThesis(insertPath);
                        insertPath.state = 2;
                        insertPath.type  = 0;
                        Result row = pathBll.updateState(insertPath);
                        if (result == Result.添加成功 && row == Result.更新成功)
                        {
                            LogHelper.Info(this.GetType(), student.StuAccount + " - " + student.RealName + " - 上传论文文件");
                            msg = "上传成功";
                        }
                        else
                        {
                            msg = "上传失败";
                        }
                    }
                    string res = "{ error:'" + error + "', msg:'" + msg + "'}";
                    Response.Write(res);
                    Response.End();
                }
                catch (Exception ex)
                {
                    LogHelper.Error(this.GetType(), ex);
                }
            }
        }