protected void Page_Load(object sender, EventArgs e) { Student student = (Student)Session["loginuser"]; string stuAccount = student.StuAccount; TitleRecordBll titleRecordBll = new TitleRecordBll(); TitleRecord titleRecord = titleRecordBll.getRtId(stuAccount); int rtId = titleRecord.TitleRecordId; Path path = pathBll.getState(rtId, 1); pstate = path.state; if (rtId == 0) { //未选题 state = 3; } else { Result result = pathBll.selectByTitleRecordId(rtId.ToString()); if (result == Result.记录存在) { //显示页面 state = 1; } else { state = 0; } } }
/// <summary> /// 根据选题记录id获取开题报告对象 /// </summary> /// <param name="titleRecordId"></param> /// <returns></returns> public OpenReport Select(int titleRecordId) { DataSet ds = odao.Select(titleRecordId); OpenReport or = new OpenReport(); if (ds != null && ds.Tables[0].Rows.Count > 0) { int i = ds.Tables[0].Rows.Count - 1; or.openId = Convert.ToInt32(ds.Tables[0].Rows[i]["ID"].ToString()); or.meaning = ds.Tables[0].Rows[i]["meaning"].ToString(); or.content = ds.Tables[0].Rows[i]["openContent"].ToString(); or.method = ds.Tables[0].Rows[i]["method"].ToString(); or.outline = ds.Tables[0].Rows[i]["outline"].ToString(); or.plan = ds.Tables[0].Rows[i]["openPlan"].ToString(); or.reference = ds.Tables[0].Rows[i]["reference"].ToString(); TitleRecord titleRecord = new TitleRecord(); titleRecord.TitleRecordId = Convert.ToInt32(ds.Tables[0].Rows[i]["titleRecordId"].ToString()); or.titleRecord = titleRecord; or.reportTime = Convert.ToDateTime(ds.Tables[0].Rows[i]["reportTime"].ToString()); or.trend = ds.Tables[0].Rows[i]["trend"].ToString(); or.teacherOpinion = ds.Tables[0].Rows[i]["teacherOpinion"].ToString(); or.deanOpinion = ds.Tables[0].Rows[i]["deanOpinion"].ToString(); or.state = Convert.ToInt32(ds.Tables[0].Rows[i]["state"]); return(or); } else { return(null); } }
public void StusecltTitle() { string titleid = Context.Request.QueryString["titleId"]; TitleRecord titleRecord = new TitleRecord(); //TODO 后期从session里获取学生对象 //Student student = (Student)Session["user"]; titleRecord.student = stu; Title title = new Title(); title.TitleId = int.Parse(titleid); titleRecord.title = title; //PublicProcedureBll pbll = new PublicProcedureBll(); //int rows = pbll.AddTitlerecord(titleRecord); //if (rows > 0) //{ // //Response.Write("选题成功"); // //刷新iframe父页面 // Response.Write("<script>alert('选题成功');</script>"); // Response.Write("<script>parent.location.reload();</script>"); // //var iframeId=window.frameElement.id; // Response.Write("<script>document.getElementById('iframe').src = '~/admin/PaperDtailStu.aspx';</script>"); // //Response.Write("<script>window.location.href=PaperDtailStu.aspx;</script>"); // //Response.Redirect("PaperDtailStu.aspx"); // Response.End(); //} //else //{ // Response.Write("<script>alert('选题失败');</script>"); // Response.End(); //} }
public void getData() { Teacher tea = (Teacher)Session["loginuser"]; string teaAccount = tea.TeaAccount; stuAccount = Request.QueryString["stuAccount"]; TitleRecord titleRecord = titleRecordBll.getRtIdByTea(stuAccount, teaAccount); int titleRecordId = titleRecord.TitleRecordId; string currentPage = Request.QueryString["currentPage"]; if (currentPage == null || currentPage.Length <= 0) { currentPage = "1"; } TableBuilder tabuilder = new TableBuilder() { StrTable = "T_Path", StrWhere = "titleRecordId=" + titleRecordId, IntColType = 0, IntOrder = 1, IntPageNum = int.Parse(currentPage), IntPageSize = pagesize, StrColumn = "pathId", StrColumnlist = "pathTitle,dateTime,path" }; getCurrentPage = int.Parse(currentPage); dsPath = crossBll.SelectBypage(tabuilder, out count); }
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("管理员和教师没有进度条"); } }
public void CreateTitle(string titleName) { TitleRecord record = new TitleRecord { Name = titleName }; _titleRepository.Create(record); }
/// <summary> /// 根据选题记录ID查询一个批次信息 /// </summary> /// <param name="planId">要查询的选题记录ID</param> /// <returns>类型为DataSet的选题记录信息列表</returns> public TitleRecord Select(int recordId) { TitleRecord plan = dao.GetTitleRecord(recordId); if (plan != null) { return(plan); } return(null); }
/// <summary> /// 修改一条选题记录信息 /// </summary> /// <param name="record">要修改的选题记录对象</param> /// <returns>成功返回Result.更新成功,失败返回Result.更新失败</returns> public Result Update(TitleRecord record) { int row = dao.Update(record); if (row > 0) { return(Result.更新成功); } return(Result.更新失败); }
/// <summary> /// 添加一条选题记录信息 /// </summary> /// <param name="record">要添加的选题记录对象</param> /// <returns>成功返回Result.添加成功,失败返回Result.添加失败</returns> public Result Insert(TitleRecord record) { int row = dao.Insert(record); if (row > 0) { return(Result.添加成功); } return(Result.添加失败); }
/// <summary> /// 执行选题操作 /// </summary> public void StusecltTitle() { try { //string stuId = Context.Request["stuId"].ToString(); stu = (Student)Session["loginuser"]; int titleid = int.Parse(Context.Request.QueryString["titleId"]); Title dstitle = new Title(); TitleBll titleSelect = new TitleBll(); dstitle = titleSelect.GetTitle(titleid); int limited = int.Parse(dstitle.Limit.ToString()); int selected = int.Parse(dstitle.Selected.ToString()); if (selected < limited) { Result row = isExist(); if (row == Result.记录不存在) { LogHelper.Info(this.GetType(), stu.StuAccount + " - " + stu.RealName + " - 学生选题 - " + dstitle.TitleId + dstitle.title); 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) { 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); } }
/// <summary> /// 添加选题记录使题目的选题人数加1 /// </summary> /// <param name="titlerecord">选题记录实体</param> /// <returns>返回0代表失败返回其他表示添加数据成功(返回的值是选题记录的主键)/returns> public int AddTitlerecord(TitleRecord titlerecord) { int isSuccess = 0; dao.AddTitlerecord(titlerecord, out isSuccess); if (isSuccess == 0) { return(0); } else { return(isSuccess); } }
protected void Page_Load(object sender, EventArgs e) { Student student = (Student)Session["loginuser"]; string stuAccount = student.StuAccount; TitleRecordBll titleRecordBll = new TitleRecordBll(); PathBll pathBll = new PathBll(); TitleRecord titleRecord = titleRecordBll.getRtId(stuAccount); int titleRecordId = titleRecord.TitleRecordId; OpenReport openReport = titleRecordBll.getState(titleRecordId); Path path = pathBll.getState(titleRecordId, 0); openState = openReport.state; state = path.state; }
/// <summary> /// 添加一条选题记录信息 /// </summary> /// <param name="record">选题信息实体</param> /// <returns>受影响行数</returns> public int Insert(TitleRecord record) { try { string cmdText = "insert into T_TitleRecord(stuAccount, titleId, defeseTeamId) values(@stuAccount,@titleId,@defeseTeamId)"; string[] param = { "@stuAccount", "@titleId", "@defeseTeamId" }; object[] values = { record.student.StuAccount, record.title.TitleId, record.DefeseTeamId }; int row = db.ExecuteNoneQuery(cmdText.ToString(), param, values); return(row); } catch (Exception ex) { throw ex; } }
/// <summary> /// 通过学生和老师账号获取titleRecordId /// </summary> /// <param name="stuAccount"></param> /// <param name="teaAccount"></param> /// <returns></returns> public TitleRecord getRtIdByTea(string stuAccount, string teaAccount) { string sql = "select top 1 titleRecordId from V_TitleRecord where stuAccount=@stuAccount and teaAccount=@teaAccount order by titleRecordId desc"; string[] param = { "@stuAccount", "teaAccount" }; object[] values = { stuAccount, teaAccount }; TitleRecord titleRecord = new TitleRecord(); SqlDataReader reader = db.ExecuteReader(sql, param, values); while (reader.Read()) { titleRecord.TitleRecordId = reader.GetInt32(0); } reader.Close(); return(titleRecord);; }
/// <summary> /// 修改一条选题记录信息 /// </summary> /// <param name="record">选题信息实体</param> /// <returns>受影响行数</returns> public int Update(TitleRecord record) { try { string cmdText = "update T_TitleRecord set stuAccount = @stuAccount, titleId = @titleId, defeseTeamId = @defeseTeamId, " + " where titleRecordId = @titleRecordId"; string[] param = { "@stuAccount", "@titleId", "@defeseTeamId", "@titleRecordId" }; object[] values = { record.student.StuAccount, record.title.TitleId, record.DefeseTeamId, record.TitleRecordId }; int row = db.ExecuteNoneQuery(cmdText.ToString(), param, values); return(row); } catch (Exception ex) { throw ex; } }
/// <summary> /// 通过学生账号取到选题记录id /// </summary> /// <param name="stuAccount">学生账号</param> /// <returns></returns> public TitleRecord getRtId(string stuAccount) { string sql = "select top 1 titleRecordId from T_TitleRecord where stuAccount=@Account order by createTime desc"; string[] param = { "@Account" }; object[] values = { stuAccount }; TitleRecord titleRecord = new TitleRecord(); SqlDataReader reader = db.ExecuteReader(sql, param, values); while (reader.Read()) { titleRecord.TitleRecordId = reader.GetInt32(0); } reader.Close(); return(titleRecord); }
//添加开题报告 private void insert() { try { string op = Context.Request["op"]; if (op == "add") { string meaning = Request["meaning"]; string trend = Request["trend"]; string content = Request["content"]; string plan = Request["plan"]; string method = Request["method"]; string outline = Request["outline"]; string reference = Request["reference"]; OpenReport open = new OpenReport(); TitleRecord titleRecord = new TitleRecord(); titleRecord.TitleRecordId = titleRecordId; open.titleRecord = titleRecord; open.meaning = meaning; open.trend = trend; open.content = content; open.plan = plan; open.method = method; open.outline = outline; open.reference = reference; open.reportTime = DateTime.Now; Result row = orbll.stuInsert(open); Result result = orbll.updateState(2, titleRecordId); if (row == Result.添加成功 && result == Result.更新成功) { LogHelper.Info(this.GetType(), student.StuAccount + " - " + student.RealName + " - 添加开题报告"); Response.Write("提交成功"); Response.End(); } else { Response.Write("提交失败"); Response.End(); } } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } }
public void getPage() { Student stu = (Student)Session["loginuser"]; string account = stu.StuAccount; TitleRecord titleRecord = titleRecordBll.getRtId(account); RTId = titleRecord.TitleRecordId.ToString(); //暂未选题 if (RTId == "0" || RTId == "" || RTId == null) { RTId = ""; } //暂未指定答辩小组 else if (!defenceBll.isGroup(RTId)) { RTId = "noGroup"; } else { DefenceGroup getDgId = defenceBll.getDgId(RTId); string dgId = getDgId.defenGroupId.ToString(); DefenceGroup defenceGroup = defenceBll.getTeaId(dgId); ///分别取到小组成员账号 string leader = defenceGroup.leader; string member = defenceGroup.member; string recorder = defenceGroup.recorder; Teacher leaderId = teacherBll.getModel(leader); Teacher memberId = teacherBll.getModel(member); Teacher recorderId = teacherBll.getModel(recorder); //取到姓名 leaderName = leaderId.TeaName; memberName = memberId.TeaName; recorderName = recorderId.TeaName; //取到电话 leaderTel = leaderId.Phone; memberTel = memberId.Phone; recorderTel = recorderId.Phone; //取到邮箱 leaderMail = leaderId.Email; memberMail = memberId.Email; recorderMail = recorderId.Email; } }
/// <summary> /// 添加选题记录使题目的选题人数加1 /// </summary> /// <param name="titlerecord">选题记录实体</param> /// <returns></returns> public DataSet AddTitlerecord(TitleRecord titlerecord, out int isSuccess) { StringBuilder strSql = new StringBuilder(); strSql.Append("AddTitlerecord"); SqlParameter[] values = { new SqlParameter("@stuAccount", SqlDbType.VarChar), new SqlParameter("@titleId", SqlDbType.Int), new SqlParameter("@return", SqlDbType.Int) }; values[0].Value = titlerecord.student.StuAccount; values[1].Value = titlerecord.title.TitleId; values[2].Direction = ParameterDirection.Output; DataSet ds = db.FillDataSetBySP(strSql.ToString(), values); isSuccess = Convert.ToInt32(values[2].Value); return(ds); }
protected void Page_Load(object sender, EventArgs e) { string op = Request["op"]; try { if (op == "submit") { titleRecordId = Request["titleRecordId"]; stuAccount = Request["stuAccount"]; getData = defenceBll.getModel(titleRecordId); DefenceRecord defenceRecord = new DefenceRecord(); TitleRecord titleRecord = new TitleRecord(); titleRecord.TitleRecordId = Convert.ToInt32(getData.Tables[0].Rows[0]["titleRecordId"]); defenceRecord.titleRecord = titleRecord; defenceRecord.recordContent = Request["content"]; defenceRecord.dateTime = Convert.ToDateTime(now); Result result = defenceBll.UpdateRecord(defenceRecord); if (result == Result.添加成功) { LogHelper.Info(this.GetType(), titleRecord.DefeseTeamId + " - 教师提交 - " + titleRecord.student.StuAccount + " - " + titleRecord.student.RealName + " - 学生的答辩记录"); Response.Write("添加成功"); Response.End(); } else { Response.Write("添加失败"); Response.End(); } } else { reportData(); } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } }
protected void Page_Load(object sender, EventArgs e) { TitleRecordBll trbll = new TitleRecordBll(); PathBll pathBll = new PathBll(); Path path = new Path(); Teacher teacher = (Teacher)Session["loginuser"]; string teaAccount = teacher.TeaAccount; collegeId = teacher.college.ColID; string op = Context.Request.Form["op"]; string type = Request.QueryString["type"]; if (!IsPostBack) { Search(); getPage(Search()); } string agree = Request["agree"]; if (agree != null) { string stuAccount = Request["stuAccount"]; DataSet ds = trbll.GetByAccount(stuAccount); int i = ds.Tables[0].Rows.Count - 1; TitleRecord titleRecord = new TitleRecord(); titleRecord.TitleRecordId = Convert.ToInt32(ds.Tables[0].Rows[i]["titleRecordId"].ToString()); if (agree == "yes") { path.state = 3; } else if (agree == "no") { path.state = 1; } path.type = 1; path.titleRecord = titleRecord; pathBll.updateState(path); } }
/// <summary> /// 添加学生 /// </summary> /// <returns></returns> public Result addStudent() { string stuAccount = Request["stuAccount"]; string[] stuList = stuAccount.Split('?'); for (int i = 0; i < stuList.Length - 1; i++) { TitleRecordBll titleBll = new TitleRecordBll(); TitleRecord titleRecord = titleBll.getRtId(stuList[i]); int titleRecordId = titleRecord.TitleRecordId; DefenceBll defenceBll = new DefenceBll(); DefenceRecord defence = new DefenceRecord(); defence.titleRecord = titleRecord; DefenceGroup defenceGroup = new DefenceGroup(); int defenId = Convert.ToInt32(Session["defenGroupId"]); defenceGroup.defenGroupId = defenId; defence.defenceGroup = defenceGroup; row = defenceBll.InsertStudent(defence); StudentBll stuBll = new StudentBll(); Student student = stuBll.GetModel(stuList[i]); string stu = stuList[i]; student.state = 1; Result result = stuBll.Updata(student); if (row != Result.添加成功 || result != Result.更新成功) { Response.Write("添加失败"); Response.End(); break; } else { LogHelper.Info(this.GetType(), tea.TeaAccount + " - " + tea.TeaName + " - 添加" + defenId + "答辩小组学生 - " + student.StuAccount + " - " + student.RealName); } } return(row); }
/// <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); } }
protected void Page_Load(object sender, EventArgs e) { TitleRecordBll trbll = new TitleRecordBll(); MedtermQualityBll mqbll = new MedtermQualityBll(); MedtermQuality medterm = new MedtermQuality(); state = Convert.ToInt32(Session["state"].ToString()); int titleRecordId = 0; string op = Request["op"]; if (!IsPostBack) { string stuAccount = Request.QueryString["stuAccount"]; if (stuAccount != null) { Session["stuAccount"] = stuAccount; } else { if (state == 3) { Student student = (Student)Session["loginuser"]; stuAccount = student.StuAccount; } else { stuAccount = Session["stuAccount"].ToString(); } } } if (state == 1) { Teacher teacher = (Teacher)Session["loginuser"]; string teaAccount = teacher.TeaAccount; string acount = Session["stuAccount"].ToString(); TitleRecord titleRecord = trbll.getRtIdByTea(acount, teaAccount); TitleRecord stuTitle = trbll.GetTitleRecord(titleRecord.TitleRecordId); mq = mqbll.Select(titleRecord.TitleRecordId); if (mq == null) { content = "学生未提交中期质量检查"; } else { planFinishSituation = mq.planFinishSituation; stuAccount = acount; stuName = stuTitle.student.RealName; proName = stuTitle.profession.ProName; title = stuTitle.title.title; collegeName = teacher.college.ColName; teaName = teacher.TeaName; MedtermQuality medtermQuality = mqbll.getState(titleRecord.TitleRecordId); mstate = medtermQuality.state; if (mstate == 3) { teacherOpinion = mq.teacherOpinion; } } if (op == "teacher") { try { string opinion = Request["teacher"]; medterm.teacherOpinion = opinion; medterm.dateTime = DateTime.Now; medterm.titleRecord = titleRecord; medterm.state = 3; Result row = mqbll.teaInsert(medterm); if (row == Result.添加成功) { LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师提交 - " + stuTitle.student.StuAccount + " - " + stuTitle.student.RealName + " - 学生的中期质量报告意见"); Response.Write("提交成功"); Response.End(); } else { Response.Write("提交失败"); Response.End(); } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } } } else if (state == 3) { try { Student student = (Student)Session["loginuser"]; stuAccount = student.StuAccount; stuName = student.RealName; proName = student.profession.ProName; collegeName = student.college.ColName; DataSet ds = trbll.GetByAccount(stuAccount); TitleRecordBll titleRecordBll = new TitleRecordBll(); TitleRecord titleRecord = titleRecordBll.getRtId(stuAccount); int rtId = titleRecord.TitleRecordId; Result result = pathBll.selectByTitleRecordId(rtId.ToString()); if (ds == null) { content = "暂未选题"; } else { if (result == Result.记录存在) { mq = mqbll.Select(titleRecord.TitleRecordId); if (mq != null) { planFinishSituation = mq.planFinishSituation; } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string stuaccount = ds.Tables[0].Rows[i]["stuAccount"].ToString(); if (stuaccount == stuAccount) { title = ds.Tables[0].Rows[0]["title"].ToString(); teaName = ds.Tables[0].Rows[0]["teaName"].ToString(); titleRecordId = Convert.ToInt32(ds.Tables[0].Rows[i]["titleRecordId"].ToString()); break; } } MedtermQuality medtermQuality = mqbll.getState(titleRecordId); mstate = medtermQuality.state; if (mstate == 3) { teacherOpinion = mq.teacherOpinion; } } else { content = "暂未提交论文"; } } if (op == "student") { string plan = Request["student"]; medterm.planFinishSituation = plan; medterm.dateTime = DateTime.Now; titleRecord.TitleRecordId = titleRecordId; medterm.titleRecord = titleRecord; medterm.state = 2; Result row = mqbll.stuInsert(medterm); if (row == Result.添加成功) { LogHelper.Info(this.GetType(), student.StuAccount + " - " + student.RealName + " - 学生提交中期质量报告"); Response.Write("提交成功"); Response.End(); } else { Response.Write("提交失败"); Response.End(); } } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } } }
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); } }
public string ToMarkdown(TitleRecord title) { return($"**Day {Day}** | [{title.Title}]({ReadmePath}) | {Language}</br>"); }
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); } } }
private void Start() { agi.HtmlDocument doc = new agi.HtmlDocument(); WebClient webClient = new WebClient(); string html; webClient.Encoding = Encoding.UTF8; // parsing 할 url html = webClient.DownloadString("http://www.ssu.ac.kr/web/kor/plaza_b_02"); // html 읽기 doc.LoadHtml(html); agi.HtmlNode node = doc.GetElementbyId("cmscont"); //Console.WriteLine(node.InnerText); // 테이블 맨위 row parsing List <TitleRecord> titleRecords = new List <TitleRecord>(); foreach (agi.HtmlNode node1 in doc.DocumentNode.SelectNodes("//div[@id='cmscont']")) { foreach (agi.HtmlNode node2 in node1.SelectNodes(".//thead")) { foreach (agi.HtmlNode node3 in node2.SelectNodes(".//th")) { TitleRecord record = new TitleRecord(); record.title = node3.InnerText; titleRecords.Add(record); } } } // Check correctly parsing? /* for (int i = 0; i < titleRecords.Count; i++) { * Console.WriteLine(titleRecords[i].title); * } */ // 동아리 정보들 parsing foreach (agi.HtmlNode node1 in doc.DocumentNode.SelectNodes("//div[@id='cmscont']")) { foreach (agi.HtmlNode node2 in node1.SelectNodes(".//tbody")) { int i = 0; foreach (agi.HtmlNode node3 in node2.SelectNodes(".//th[@class='fir']")) { separationRecords.Add(new SeparationRecord(node3.InnerText)); int num = Convert.ToInt32(node3.GetAttributeValue("rowspan", "")); separationRecords[i].num = num; //Console.WriteLine(separationRecords[i].separation + " " + separationRecords[i].num); i++; } agi.HtmlNodeCollection node4 = node2.SelectNodes(".//tr"); // td로 잘랐을때 55개가 나옴 그 index int index = 0; for (int j = 0; j < separationRecords.Count; j++) { agi.HtmlNodeCollection node5; for (int k = 0; k < separationRecords[j].num; k++) { node5 = node4[index].SelectNodes(".//td"); GroupRecord groupRecord = new GroupRecord(); groupRecord.name = node5[0].InnerText; groupRecord.location = node5[1].InnerText; groupRecord.information = node5[2].InnerText; groupRecord.since = node5[3].InnerText; groupRecord.homepage = node5[4].GetAttributeValue("href", ""); separationRecords[j].element.Add(groupRecord); index++; } } } } // ShowResult(separationRecords); }
public void EditTitle(TitleRecord record) { _titleRepository.Update(record); }
/// <summary> /// 获得一个选题记录信息 /// </summary> /// <param name="recordId">要获得的选题记录ID</param> /// <returns>返回一个类型为TitleRecord的选题记录对象</returns> public TitleRecord GetTitleRecord(int recordId) { try { string cmdText = "select * from V_TitleRecord where titleRecordId = @titleRecordId"; string[] param = { "@titleRecordId" }; object[] values = { recordId }; DataSet ds = db.FillDataSet(cmdText, param, values); TitleRecord titleRecord = new TitleRecord(); Student student = new Student(); Title title = new Title(); Plan plan = new Plan(); Profession prodession = new Profession(); if (ds != null && ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["titleRecordId"].ToString() != "" && ds.Tables[0].Rows[0]["titleRecordId"].ToString() == recordId.ToString()) { titleRecord.TitleRecordId = int.Parse(ds.Tables[0].Rows[0]["titleRecordId"].ToString()); if (ds.Tables[0].Rows[0]["stuAccount"].ToString() != "") { student.StuAccount = ds.Tables[0].Rows[0]["stuAccount"].ToString(); } if (ds.Tables[0].Rows[0]["titleId"].ToString() != "") { title.TitleId = int.Parse(ds.Tables[0].Rows[0]["titleId"].ToString()); } if (ds.Tables[0].Rows[0]["defeseTeamId"].ToString() != "") { titleRecord.DefeseTeamId = int.Parse(ds.Tables[0].Rows[0]["defeseTeamId"].ToString()); } if (ds.Tables[0].Rows[0]["stuPwd"].ToString() != "") { student.StuPwd = ds.Tables[0].Rows[0]["stuPwd"].ToString(); } if (ds.Tables[0].Rows[0]["realName"].ToString() != "") { student.RealName = ds.Tables[0].Rows[0]["realName"].ToString(); } if (ds.Tables[0].Rows[0]["sex"].ToString() != "") { student.Sex = ds.Tables[0].Rows[0]["sex"].ToString(); } if (ds.Tables[0].Rows[0]["phone"].ToString() != "") { student.Phone = ds.Tables[0].Rows[0]["phone"].ToString(); } if (ds.Tables[0].Rows[0]["Email"].ToString() != "") { student.Email = ds.Tables[0].Rows[0]["Email"].ToString(); } if (ds.Tables[0].Rows[0]["proId"].ToString() != "") { prodession.ProId = int.Parse(ds.Tables[0].Rows[0]["proId"].ToString()); } if (ds.Tables[0].Rows[0]["proName"].ToString() != "") { prodession.ProName = ds.Tables[0].Rows[0]["proName"].ToString(); } if (ds.Tables[0].Rows[0]["title"].ToString() != "") { title.title = ds.Tables[0].Rows[0]["title"].ToString(); } if (ds.Tables[0].Rows[0]["titleContent"].ToString() != "") { title.TitleContent = ds.Tables[0].Rows[0]["titleContent"].ToString(); } if (ds.Tables[0].Rows[0]["createTime"].ToString() != "") { title.CreateTime = DateTime.Parse(ds.Tables[0].Rows[0]["createTime"].ToString()); } if (ds.Tables[0].Rows[0]["selected"].ToString() != "") { title.Selected = int.Parse(ds.Tables[0].Rows[0]["selected"].ToString()); } if (ds.Tables[0].Rows[0]["limit"].ToString() != "") { title.Limit = int.Parse(ds.Tables[0].Rows[0]["limit"].ToString()); } if (ds.Tables[0].Rows[0]["planId"].ToString() != "") { plan.PlanId = int.Parse(ds.Tables[0].Rows[0]["planId"].ToString()); } if (ds.Tables[0].Rows[0]["planName"].ToString() != "") { plan.PlanName = ds.Tables[0].Rows[0]["planName"].ToString(); } if (student != null && title != null && plan != null && prodession != null) { titleRecord.student = student; titleRecord.title = title; titleRecord.plan = plan; titleRecord.profession = prodession; return(titleRecord); } } } return(null); } catch (Exception ex) { throw ex; } }