private void isStudent() { Student stu = stuBll.GetModel(account); if (!stuBll.selectBystuId(account)) { Response.Write("账号不存在,请检查用户类型"); Response.End(); } else if (email != stu.Email) { Response.Write("邮箱错误"); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { //TODO 改成从session里获取值 student = (Student)Session["loginuser"]; StudentBll sbll = new StudentBll(); string op = Request.QueryString["op"]; try { student = sbll.GetModel(student.StuAccount); if (op == "update") { string phone = Context.Request["phone"].ToString(); string Email = Context.Request["Email"].ToString(); Student newStu = new Student(); College college = new College(); Profession pro = new Profession(); newStu.StuAccount = student.StuAccount; newStu.RealName = student.RealName; newStu.StuPwd = student.StuPwd; newStu.Sex = student.Sex; newStu.college = student.college; newStu.profession = student.profession; newStu.Phone = phone; newStu.Email = Email; updata(newStu); } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } }
public void insert() { string txtAreReportContent = Request["ReportContent"]; string txtAreReportTime = Request["ReportTime"]; string txtAreDefence = Request["Defence"]; string txtAreInnovate = Request["Innovate"]; double txtAreDefenceScore = double.Parse(Request["DefenceScore"]); string txtAreEvaluate = Request["txtAreEvaluate"]; Plan plan = new Plan(); try { StudentBll studentBll = new StudentBll(); Student stu = studentBll.GetModel(stuAccount); plan.PlanId = planId; scoreModel.student = stu; scoreModel.plan = plan; scoreModel.reportContent = txtAreReportContent; scoreModel.reportTime = txtAreReportTime; scoreModel.defence = txtAreDefence; scoreModel.defenInnovate = txtAreInnovate; scoreModel.defenceScore = txtAreDefenceScore; scoreModel.defenEvaluate = txtAreEvaluate; ScoreBll scorebll = new ScoreBll(); Result row = scorebll.updatereplyPanelsOpinion(scoreModel); if (row == Result.添加成功) { Teacher teacher = (Teacher)Session["loginuser"]; LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师添加 - " + stu.StuAccount + " - " + stu.RealName + " - 学生的答辩成绩及评定"); Response.Write("提交成功"); Response.End(); } else { Response.Write("提交失败"); Response.End(); } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } }
public void insert() { double score = Convert.ToDouble(Request["score"]); string material = Request["material"]; string paperDesign = Request["quality"]; string workload = Request["workload"]; string innovate = Request["innovate"]; string evaluate = Request["evaluate"]; StudentBll stuBll = new StudentBll(); Student student = stuBll.GetModel(Session["stuAccount"].ToString()); ScoreBll sbll = new ScoreBll(); Score scoreModel = new Score(); try { scoreModel.material = material; scoreModel.paperDesign = paperDesign; scoreModel.workload = workload; scoreModel.crossInnovate = innovate; scoreModel.crossEvaluate = evaluate; scoreModel.crossScore = score; scoreModel.student = student; Plan plan = new Plan(); plan.PlanId = Convert.ToInt32(Session["planId"]); scoreModel.plan = plan; Result row = sbll.updateCrossGuide(scoreModel); if (row == Result.添加成功) { LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师对 - " + student.StuAccount + " - " + student.RealName + " - 学生的交叉指导意见"); Response.Write("提交成功"); Response.End(); } else { Response.Write("提交失败"); Response.End(); } } catch (Exception ex) { LogHelper.Error(this.GetType(), ex); } }
/// <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) { 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 void insert() { //获取评定及成绩 double score = Convert.ToDouble(Request["score"]); string investigation = Request["investigation"]; string practice = Request["practice"]; string solveProblem = Request["solveProblem"]; string workAttitude = Request["workAttitude"]; string quality = Request["quality"]; string evaluate = Request["evaluate"]; string innovate = Request["innovate"]; string crossTea = Request["crossTea"]; //添加评定及成绩 Student student = new Student(); Plan plan = new Plan(); try { student.StuAccount = stuAccount; plan.PlanId = planId; scoreModel.student = student; scoreModel.plan = plan; scoreModel.guideScore = score; scoreModel.investigation = investigation; scoreModel.practice = practice; scoreModel.solveProblem = solveProblem; scoreModel.workAttitude = workAttitude; scoreModel.paperDesign = quality; scoreModel.innovate = innovate; scoreModel.evaluate = evaluate; //添加交叉指导教师 CrossBll crossBll = new CrossBll(); PathBll pathBll = new PathBll(); TitleRecord titleRecord = new TitleRecord(); Cross cross = new Cross(); Path path = new Path(); Teacher teacher = new Teacher(); titleRecord.TitleRecordId = titleRecordId; cross.titleRecord = titleRecord; teacher.TeaAccount = crossTea; cross.teacher = teacher; path.titleRecord = titleRecord; path.state = 3; path.type = 0; Result state = pathBll.updateState(path); if (state == Result.更新成功) { Result recordState = titlebll.updateState(titleRecord.TitleRecordId); if (recordState == Result.更新成功) { Result result = crossBll.Insert(cross); if (result == Result.添加成功) { StudentBll studentBll = new StudentBll(); Student stu = studentBll.GetModel(stuAccount); TeacherBll teacherBll = new TeacherBll(); Teacher tea = teacherBll.GetModel(crossTea); LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师指定 - " + stuAccount + " - " + stu.RealName + " - 学生的交叉指导教师 - " + teacher + " - " + tea.TeaName); Result row = sbll.insertInstructorsComments(scoreModel); if (row == Result.添加成功) { LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师添加 - " + stuAccount + " - " + stu.RealName + " - 学生的指导成绩及评定"); 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); } }