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; } } }
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; }
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> /// 添加学生 /// </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); }
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); } } }