/// <summary> /// 绑定数据源 /// </summary> private void bind() { string id = Request.QueryString["id"].ToString(); AttendanceBLL attendBLL = new AttendanceBLL(); attend = attendBLL.get(id); CourseTableBLL ctBLL = new CourseTableBLL(); CourseTable ct = ctBLL.get(attend.CourTableID); ClassBLL classBLL = new ClassBLL(); TeacherBLL teacherBLL = new TeacherBLL(); CourseBLL courseBLL = new CourseBLL(); StudentBLL stuBLL = new StudentBLL(); #region 绑定页面数据 Label_class.Text = classBLL.get(ct.ClassID).Name; Label_course.Text = courseBLL.get(ct.CourId).Name; Label_teacher.Text = teacherBLL.get(ct.TeachID).Name; Label_student.Text = stuBLL.get(attend.StudID).Name; Label_oldStatus.Text = attend.Status; Label_week.Text = ct.Week; Label_weekDay.Text = ct.WeekDay; Label_courseTime.Text = ct.CourseTime; Label_place.Text = ct.Place; #endregion }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ClassBLL classBLL = new ClassBLL(); CourseBLL courBLL = new CourseBLL(); TeacherBLL teachBLL = new TeacherBLL(); //绑定页面查询条件的数据 DropDownList_class.DataSource = classBLL.getAll(); DropDownList_class.DataTextField = "name"; DropDownList_class.DataBind(); DropDownList_class.Items.Insert(0, "全部班级"); DropDownList_course.DataSource = courBLL.getAll(); DropDownList_course.DataTextField = "name"; DropDownList_course.DataBind(); DropDownList_course.Items.Insert(0, "全部课程"); DropDownList_teacher.DataSource = teachBLL.getTeachers(); DropDownList_teacher.DataTextField = "name"; DropDownList_teacher.DataBind(); DropDownList_teacher.Items.Insert(0, "全部教师"); bind(); } }
protected void DropDownList_class_SelectedIndexChanged(object sender, EventArgs e) { CourseTableBLL ctBLL = new CourseTableBLL(); CourseBLL courBLL = new CourseBLL(); TeacherBLL teachBLL = new TeacherBLL(); DropDownList_course.Items.Clear(); DropDownList_course.DataSource = courBLL.getByClassId(DropDownList_class.SelectedValue); DropDownList_course.DataTextField = "name"; DropDownList_course.DataValueField = "ID"; DropDownList_course.DataBind(); DropDownList_teacher.Items.Clear(); string filterTeacher = "classID='" + DropDownList_class.SelectedValue + "' and courId='" + DropDownList_course.SelectedValue + "'"; DataTable tempDt = PageUtil.getProcessedDataTable(ctBLL.getAll().Tables[0], filterTeacher, null, false); DataView dv = tempDt.DefaultView; tempDt = dv.ToTable(true, "teachID"); foreach (DataRow dr in tempDt.Rows) { Teacher teacher = teachBLL.get(dr["teachID"].ToString()); DropDownList_teacher.Items.Add(new ListItem(teacher.Name, teacher.Id)); } bind(); }
/// <summary> /// 绑定数据源 /// </summary> private void bind() { string courTableID = Request.QueryString["courTableID"]; CourseTableBLL ctBLL = new CourseTableBLL(); TeacherBLL teacherBLL = new TeacherBLL(); CourseBLL courBLL = new CourseBLL(); ClassBLL classBLL = new ClassBLL(); CourseTable ct = ctBLL.get(courTableID); Class clazz = classBLL.get(ct.ClassID); #region 页面数据绑定 className.Text = clazz.Name; courseName.Text = courBLL.get(ct.CourId).Name; teacherName.Text = teacherBLL.get(ct.TeachID).Name; week.Text = "第" + ct.Week + "周"; weekDay.Text = ct.WeekDay; classtTime.Text = ct.CourseTime; classAddress.Text = ct.Place; CommonBLL commBLL = new CommonBLL(); DataTable dt = commBLL.getAbsentStudent(courTableID,false); AspNetPager1.RecordCount = dt.Rows.Count; int from = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1; int to = from + AspNetPager1.PageSize - 1 > AspNetPager1.RecordCount ? AspNetPager1.RecordCount : from + AspNetPager1.PageSize - 1; GridView1.DataSource = PageUtil.getPaged(dt, from, to); GridView1.DataBind(); #endregion }
public static CourseBLL getInstance() { if (instance == null) { instance = new CourseBLL(); } return(instance); }
public DataTable ShowCourseInfo() { CourseBLL objCourseBLL = new CourseBLL(); dgvshow.DataSource = objCourseBLL.ShowCourse(); DataTable objDataTable = objCourseBLL.ShowCourse(); //给课程表调用: return objDataTable; }
private void bind() { string id = Request.QueryString["id"].ToString(); CourseBLL courBLL = new CourseBLL(); course = courBLL.get(id); TextBox_courName.Text = course.Name; TextBox_credit.Text = course.Credit; TextBox_schoolHour.Text = course.SchoolHour; }
protected void ImageButton_delete_Click(object sender, ImageClickEventArgs e) { ImageButton imageButton = sender as ImageButton; string id = imageButton.CommandArgument; Course course = new Course(); course.Id = id; CourseBLL courBLL = new CourseBLL(); courBLL.delete(course); Response.Write("<script>alert('删除成功!');location.href='showCourses.aspx';</script>"); }
protected void ImageButton_submit_Click(object sender, ImageClickEventArgs e) { if (check()) { CourseBLL courBLL = new CourseBLL(); string courName = TextBox_courName.Text.Trim(); string credit = TextBox_credit.Text.Trim(); string schoolHour = TextBox_schoolHour.Text.Trim(); course.Name = courName; course.Credit = credit; course.SchoolHour = schoolHour; courBLL.update(course); Response.Write("<script>alert('修改成功!');location.href='showCourses.aspx';</script>"); } }
public void bind() { List<Attendance> attenList = Session["attenList"] as List<Attendance>; CourseTableBLL ctBLL = new CourseTableBLL(); TeacherBLL teachBll = new TeacherBLL(); CourseBLL courBLL = new CourseBLL(); ClassBLL classBLL = new ClassBLL(); CourseTable ct = ctBLL.get(attenList[0].CourTableID); Class clazz = classBLL.get(ct.ClassID); #region 页面数据绑定 className.Text = clazz.Name; courseName.Text = courBLL.get(ct.CourId).Name; teacherName.Text = teachBll.get(ct.TeachID).Name; week.Text = "第" + ct.Week + "周"; weekDay.Text = ct.WeekDay; classtTime.Text = ct.CourseTime; classAddress.Text = ct.Place; lateNumber.Text = attenList.Where(x => x.Status.Equals("迟到")).ToList().Count.ToString(); absences.Text = attenList.Where(x => !x.Status.Equals("正常")).ToList().Count.ToString(); allNumber.Text = clazz.StudCount; attRate.Text = FormatUtil.doubleToPercent(attenList.Where(x => x.Status.Equals("正常")).ToList().Count / Convert.ToDouble(clazz.StudCount)); DataTable dt = transferListToDataTable(attenList); AspNetPager1.RecordCount = dt.Rows.Count; int from = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1; int to = from + AspNetPager1.PageSize - 1 > AspNetPager1.RecordCount ? AspNetPager1.RecordCount : from + AspNetPager1.PageSize - 1; GridView1.DataSource = PageUtil.resort(PageUtil.getPaged(dt, from, to)); GridView1.DataBind(); #endregion }
public void bind() { string teachId = Request.QueryString["teachID"]; string classId = Request.QueryString["classID"]; string courseId = Request.QueryString["courId"]; // ClassBLL classBll = new ClassBLL(); CourseBLL courseBll = new CourseBLL(); CommonBLL commonBll = new CommonBLL(); //courseName.Text = classBll.get(classId).Name; courseName.Text = courseBll.get(courseId).Name; DataTable dt = commonBll.getCourseDetailAttendaceRate(teachId, classId, courseId, true); AspNetPager1.RecordCount = dt.Rows.Count; int from = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1; int to = from + AspNetPager1.PageSize - 1 > AspNetPager1.RecordCount ? AspNetPager1.RecordCount : from + AspNetPager1.PageSize - 1; GridView1.DataSource = PageUtil.getPaged(dt, from, to); GridView1.DataBind(); }
/// <summary> /// 绑定数据源 /// </summary> private void bind() { string id = Request.QueryString["ID"].ToString(); string week = Request.QueryString["week"].ToString(); CourseBLL courBLL = new CourseBLL(); TeacherBLL teacherBLL = new TeacherBLL(); ClassBLL classBLL = new ClassBLL(); CourseTableBLL ctBLL = new CourseTableBLL(); ct = ctBLL.get(id); #region 页面数据绑定 Label_course.Text = courBLL.get(ct.CourId).Name; Label_teacher.Text = teacherBLL.get(ct.TeachID).Name; Label_class.Text = classBLL.get(ct.ClassID).Name; PageUtil.bindDropDownList(DropDownList_semester_from, ct.Semester.Substring(0, 4)); PageUtil.bindDropDownList(DropDownList_semester_to, ct.Semester.Substring(5, 4)); PageUtil.bindDropDownList(DropDownList_semester_end, ct.Semester.Substring(9, 3)); PageUtil.bindDropDownList(DropDownList_week_from, week.Split('-')[0]); PageUtil.bindDropDownList(DropDownList_week_to, week.Split('-')[1]); PageUtil.bindDropDownList(DropDownList_weekDay, ct.WeekDay); TextBox_place.Text = ct.Place; PageUtil.bindDropDownList(DropDownList_courseTime, ct.CourseTime.Split('节')[0]); #endregion }
/// <summary> /// 绑定数据源 /// </summary> private void bind() { CourseBLL courBLL = new CourseBLL(); TeacherBLL teacherBLL = new TeacherBLL(); ClassBLL classBLL = new ClassBLL(); //绑定 "课程名称" 数据源 DropDownList_course.DataSource = courBLL.getAll(); DropDownList_course.DataTextField = "name"; DropDownList_course.DataValueField = "ID"; DropDownList_course.DataBind(); //绑定 "任课老师" 数据源 DropDownList_teacher.DataSource = teacherBLL.getTeachers(); DropDownList_teacher.DataTextField = "name"; DropDownList_teacher.DataValueField = "ID"; DropDownList_teacher.DataBind(); //绑定 "班级名称" 数据源 DropDownList_class.DataSource = classBLL.getAll(); DropDownList_class.DataTextField = "name"; DropDownList_class.DataValueField = "ID"; DropDownList_class.DataBind(); }
private void Del_Click(object sender, EventArgs e) { if (txtCourseNum.Text == "") { MessageBox.Show("课程号不能为空!\n 请重新输入!"); } else { CourseBLL objCourseBLL = new CourseBLL(); CourseModel objCourseModel = new CourseModel(); objCourseModel.CourseNum = txtCourseNum.Text; if (objCourseBLL.DelCourse(objCourseModel) == true) { MessageBox.Show("成功删除!!"); } else { MessageBox.Show("删除失败!"); } ShowCourseInfo(); } }