protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["email"] == null) { Javascript.GoHistory(-1, Page); return; } else { email = Request["email"].Trim(); PageDataBind(); DalOperationAboutTeacher DalOperationAboutTeacher = new DalOperationAboutTeacher(); String teacherNo = DalOperationAboutTeacher.GetTeacherNoByAddressEmail(email); DataSet ds = DalOperationAboutTeacher.GetCoursesByTeacherAssistant(teacherNo); courses.DataSource = ds.Tables[0]; courses.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string tid = Request["teacherNO"]; string courseNo = Request["courseNo"]; if (tid == null || tid.Trim().Length == 0) { Javascript.Alert("请先选择教师后再进行此项操作", Page); Javascript.RefreshParentWindow("/Administrator/SalaryManage.aspx?fragment=1", Page); } else { DalOperationAboutTeacher teacherDal = new DalOperationAboutTeacher(); TeachersList teacher = teacherDal.GetTeacherById(tid); if (teacher == null) { Javascript.AlertAndRedirect("请先确定教师后再进行此项操作", "/Administrator.aspx?fragment=1", Page); } else { this.teacherName.Text = teacher.teacherName; this.teacherNo.Value = teacher.teacherNo; } int teacherType = 1; if ("本院" == teacher.teacherType) { teacherType = 1; } else { this.SelectCourse_Literal.Visible = true; this.SelectCourse.Visible = true; DalOperationAboutTeacher dalt = new DalOperationAboutTeacher(); DataTable dsTeacher = dalt.GetCoursesByTeacherAssistant(tid).Tables[0]; if (dsTeacher.Rows.Count == 0) { Javascript.Alert("该教师非院内教师并且本学期未待任何课程!", Page); Javascript.RefreshParentWindowReload(Page); } else { DataBindTeacherSalaryCourse(dsTeacher, courseNo); if (string.IsNullOrWhiteSpace(courseNo)) { courseNo = this.SelectCourse.SelectedValue; } string[] courseInfo = courseNo.Split('-'); int atCourseType = 1; if (courseInfo.Length > 1) { atCourseType = int.Parse(courseInfo[1].Trim()); } teacherType = CommonUtility.CheckTeacherType(teacher.teacherType, atCourseType); } } this.TeacherType_Literal.Text = CommonUtility.ConvertTeacherType2String(teacherType); this.teacherType.Value = teacherType.ToString(); DalOperationAboutSalaryItem dalsi = new DalOperationAboutSalaryItem(); List<SalaryItem> salaryItems = dalsi.GetAllSalaryItem(teacherType, 1); this.TeacherInSalaryItemList.DataSource = salaryItems; this.TeacherInSalaryItemList.DataBind(); this.TeacherOutSalaryItemList.DataSource = salaryItems; this.TeacherOutSalaryItemList.DataBind(); } } }