コード例 #1
0
        /// <summary>
        /// 绑定数据源
        /// </summary>
        private void bind()
        {
            User user = Session["User"] as User;

            TeacherBLL teacherBLL = new TeacherBLL();
            Teacher teacher = teacherBLL.getByUserId(user.Id);

            CommonBLL commBLL = new CommonBLL();
            GridView1.DataSource = commBLL.getClassesByTeacherId(teacher.Id);
            GridView1.DataBind();
        }
コード例 #2
0
ファイル: unCheckin.aspx.cs プロジェクト: smilelhh/-web-
        public void bind()
        {
            courTableID = Request.QueryString["courTableID"];

            User user = Session["User"] as User;

            TeacherBLL teachBLL = new TeacherBLL();
            StudentBLL studBLL = new StudentBLL();
            CourseTableBLL ctBLL = new CourseTableBLL();
            CourseTable ct = ctBLL.get(courTableID);

            ClassBLL classBll = new ClassBLL();
            Class cla = classBll.get(ct.ClassID);
            className.Text = cla.Name;

            dt = studBLL.getByClassId(ct.ClassID).Tables[0];

            if (Session["attenList"] != null)
            {
                attenList = Session["attenList"] as List<Attendance>;
            }
            else
            {
                attenList = new List<Attendance>();
                foreach (DataRow dr in dt.Rows)
                {
                    Attendance attend = new Attendance();
                    attend.Status = "正常";
                    attend.Remark = "";
                    attend.Recorder = "教师";
                    attend.RecorderID = teachBLL.getByUserId(user.Id).Id;
                    attend.StudID = dr["ID"].ToString();
                    attend.CourTableID = courTableID;

                    attenList.Add(attend);
                }
            }

            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();

            initStatusAndRemark();
        }
コード例 #3
0
        public void bind()
        {
            User user = (User)Session["user"];
            TeacherBLL teacherBll = new TeacherBLL();
            Teacher teacher = teacherBll.getByUserId(user.Id);
            CommonBLL commonBll = new CommonBLL();

            DataTable dt = commonBll.getAllRecordByRecordId(teacher.Id);

            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();
        }
コード例 #4
0
        private void bind()
        {
            User user = (User)Session["user"];

            TeacherBLL teachBll = new TeacherBLL();
            Teacher teacher = teachBll.getByUserId(user.Id);
            CommonBLL commonBll = new CommonBLL();
            // 根据教师ID得到课程信息
            string filter = "1=1";
            filter += weekId.SelectedIndex == 0 ? "" : " and week='" + weekId.SelectedValue + "'";
            DataTable dt = PageUtil.getProcessedDataTable(commonBll.getWorkAttendanceByTeachID(teacher.Id), filter);

            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();
        }
コード例 #5
0
        /// <summary>
        /// 绑定数据源
        /// </summary>
        private void bind()
        {
            string studID = Request.QueryString["studID"].ToString();

            CommonBLL commBLL = new CommonBLL();

            User user = (User)Session["user"];
            TeacherBLL teacherBll = new TeacherBLL();
            Teacher teacher = teacherBll.getByUserId(user.Id);

            string filter = "teacherID='" + teacher.Id + "'";

            DataTable dt = PageUtil.getProcessedDataTable(commBLL.getDetailStudentAttendStatistics(studID, true), filter);

            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();
        }
コード例 #6
0
        public void bind()
        {
            string classID = Request.QueryString["classID"].ToString();

            string courID = Request.QueryString["courId"].ToString();

            //courseName.Text = new CourseBLL().get(courID).Name;//courseName改成className
            className.Text = new ClassBLL().get(classID).Name;

            User user = (User)Session["user"];
            TeacherBLL teacherBll = new TeacherBLL();
            Teacher teacher = teacherBll.getByUserId(user.Id);
            CommonBLL commBLL = new CommonBLL();

            DataTable dt = commBLL.getClassStudentAttendStatistics(classID,teacher.Id, 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();
        }