/// <summary>
        /// 获取老师有效班级(统计二级页面)xpy 2016-04-22
        /// </summary>
        /// <returns></returns>
        public static string GetTeacherClass(string TeacherId, string ClassID, string ClassName, string ResourceToResourceFolder_Id)
        {
            StringBuilder classStr = new StringBuilder();

            //if (string.IsNullOrEmpty(ClassID))
            //{
            ClassID = "-1";
            string    classActive = string.Empty;
            DataTable dt          = new CommonHandel().GetTeacherAllClassByRTRFolder_Id(TeacherId, ResourceToResourceFolder_Id).Tables[0];

            DataRow[] dr = dt.Select("AnalysisDataCount=1");
            if (HttpContext.Current.Session["StatsClassClassId"] == null || HttpContext.Current.Session["StatsClassClassId"].ToString() == "" || HttpContext.Current.Session["StatsClassClassId"].ToString() == "-1")
            {
                classStr.Append("<li><a href='javascript:;' tt='1' cs='-1' class='active' ajax-value=''>全部</a></li>");
                foreach (DataRow item in dr)
                {
                    string strClassId = item["ClassId"].ToString().Trim();
                    classStr.AppendFormat("<li><a href='javascript:;' tt='1' cs='{0}' >{1}</a></li>"
                                          , strClassId
                                          , item["ClassName"].ToString());
                }
            }
            else
            {
                classStr.Append("<li><a href='javascript:;' tt='1' cs='-1'  ajax-value=''>全部</a></li>");
                foreach (DataRow item in dr)
                {
                    string strClassId = item["ClassId"].ToString().Trim();
                    classActive = (HttpContext.Current.Session["StatsClassClassId"].ToString() == strClassId) ? "active" : "";
                    classStr.AppendFormat("<li><a href='javascript:;' tt='1' cs='{0}' class='{2}' >{1}</a></li>"
                                          , strClassId
                                          , item["ClassName"].ToString()
                                          , classActive);
                }
            }

            return(classStr.ToString());
            //}
            //else
            //{
            //    classStr.AppendFormat("<li><a href='javascript:;' tt='1' cs='{0}' class=\"{2}\">{1}</a></li>"
            //                           , ClassID
            //                           , ClassName
            //                           , "active");
            //    return classStr.ToString();
            //}
        }
        /// <summary>
        /// 获取老师有效班级(班主任、代课老师)2016-04-22
        /// </summary>
        /// <returns></returns>
        public static string GetTeacherClassBySubject(string TeacherId, string Subject)
        {
            StringBuilder strHtml = new StringBuilder();

            try
            {
                TeacherId = TeacherId.Filter();
                DataTable dt = new CommonHandel().GetTeacherAllClassBySubject(TeacherId, Subject).Tables[0];
                DataRow[] dr = dt.Select("AnalysisDataCount=1");
                strHtml.Append("<li><a href='javascript:;' class='active' ajax-value=''>全部</a></li>");
                foreach (DataRow item in dr)
                {
                    strHtml.AppendFormat("<li><a href='javascript:;' ajax-value='{0}'>{1}</a></li>"
                                         , item["ClassId"].ToString()
                                         , item["ClassName"].ToString());
                }
            }
            catch (Exception)
            {
                strHtml = new StringBuilder();
            }
            return(strHtml.ToString());
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Model_F_User modelFUser = (Model_F_User)Session["FLoginUser"];

            UserId = modelFUser.UserId;
            ResourceToResourceFolder_Id = Request.QueryString["ResourceToResourceFolder_Id"].Filter();
            HomeWork_ID = Request.QueryString["HomeWork_ID"].Filter();

            ClassID   = Request.QueryString["ClassID"].Filter();
            TeacherID = Request.QueryString["TeacherID"].Filter();
            ClassName = Request.QueryString["ClassName"].Filter();
            if (!string.IsNullOrEmpty(HomeWork_ID))
            {
                if (!string.IsNullOrEmpty(ClassID))//判断查看的统计是否为此老师的
                {
                    StrTemp = "&ClassID=" + ClassID + "&ClassName=" + ClassName + "&TeacherID=" + TeacherID;
                    DataTable dt = new CommonHandel().GetTeacherAllClassByRTRFolder_Id(TeacherID, ResourceToResourceFolder_Id).Tables[0];
                    DataRow[] dr = dt.Select("AnalysisDataCount=1");
                    if (dr.Length < 2)
                    {
                        Judge = true;
                    }
                }
                else
                {
                    DataTable dt = new CommonHandel().GetTeacherAllClassByRTRFolder_Id(UserId, ResourceToResourceFolder_Id).Tables[0];
                    DataRow[] dr = dt.Select("AnalysisDataCount=1");
                    if (dr.Length < 2)
                    {
                        Judge = true;
                    }
                }

                LoadDate();
                GetLeftNAV();
            }
        }