Example #1
0
 /// <summary>
 /// 返回树形菜单的HTML代码
 /// </summary>
 /// <returns></returns>
 private string _getTreeHtml(int rootid, string type)
 {
     Song.Entities.ManageMenu[] mm = Business.Do <IManageMenu>().GetAll(rootid, null, null, type);
     WeiSha.WebControl.MenuTree mt = new WeiSha.WebControl.MenuTree();
     mt.Title           = type == "sys" ? "系统菜单" : "功能菜单";
     mt.Root            = rootid;
     mt.DataTextField   = "MM_Name";
     mt.IdKeyName       = "MM_Id";
     mt.ParentIdKeyName = "MM_PatId";
     mt.TaxKeyName      = "MM_Tax";
     mt.SourcePath      = "/manage/Images/tree";
     mt.TypeKeyName     = "";
     mt.IsUseKeyName    = "MM_IsUse";
     mt.IsShowKeyName   = "MM_IsShow";
     mt.DataSource      = mm;
     mt.DataBind();
     return(mt.HTML);
 }
Example #2
0
 protected override void InitPageTemplate(HttpContext context)
 {
     //所有资源库的分类
     Song.Entities.KnowledgeSort[] ncs = Business.Do <IKnowledge>().GetSortAll(Organ.Org_ID, -1, true);
     WeiSha.WebControl.MenuTree    mt  = new WeiSha.WebControl.MenuTree();
     mt.Title           = "全部";
     mt.DataTextField   = "Kns_Name";
     mt.IdKeyName       = "Kns_Id";
     mt.ParentIdKeyName = "Kns_PID";
     mt.TaxKeyName      = "Kns_Tax";
     mt.SourcePath      = "/manage/Images/tree";
     //mt.TypeKeyName = "Kns_Type";
     mt.IsUseKeyName = "Kns_IsUse";
     //mt.IsShowKeyName = "Nc_IsShow";
     mt.DataSource = ncs;
     mt.DataBind();
     this.Document.Variables.SetValue("tree", mt.HTML);
 }
Example #3
0
 /// <summary>
 /// 返回树形菜单的HTML代码
 /// </summary>
 /// <returns></returns>
 private string _getTreeHtml()
 {
     //所属机构的所有课程
     Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
     Song.Entities.Columns[]    ncs = Business.Do <IColumns>().All(org.Org_ID, null);
     WeiSha.WebControl.MenuTree mt  = new WeiSha.WebControl.MenuTree();
     mt.Title           = "全部栏目";
     mt.DataTextField   = "Col_Name";
     mt.IdKeyName       = "Col_Id";
     mt.ParentIdKeyName = "Col_PID";
     mt.TaxKeyName      = "Col_Tax";
     mt.SourcePath      = "/manage/Images/tree";
     mt.TypeKeyName     = "Col_Type";
     mt.IsUseKeyName    = "Col_IsUse";
     //mt.IsShowKeyName = "Nc_IsShow";
     mt.DataSource = ncs;
     mt.DataBind();
     return(mt.HTML);
 }
Example #4
0
 /// <summary>
 /// 返回树形菜单的HTML代码
 /// </summary>
 /// <returns></returns>
 private string _getTreeHtml()
 {
     //当前机构
     Song.Entities.Organization    org = Business.Do <IOrganization>().OrganCurrent();
     Song.Entities.KnowledgeSort[] ncs = Business.Do <IKnowledge>().GetSortAll(org.Org_ID, -1, null);
     WeiSha.WebControl.MenuTree    mt  = new WeiSha.WebControl.MenuTree();
     mt.Title           = "全部分类";
     mt.DataTextField   = "Kns_Name";
     mt.IdKeyName       = "Kns_Id";
     mt.ParentIdKeyName = "Kns_PID";
     mt.TaxKeyName      = "Kns_Tax";
     mt.SourcePath      = "/manage/Images/tree";
     //mt.TypeKeyName = "Kns_Type";
     mt.IsUseKeyName = "Kns_IsUse";
     //mt.IsShowKeyName = "Nc_IsShow";
     mt.Root       = 0;
     mt.DataSource = ncs;
     mt.DataBind();
     return(mt.HTML);
 }
Example #5
0
        protected override void InitPageTemplate(HttpContext context)
        {
            //当前课程信息
            int id = WeiSha.Common.Request.QueryString["id"].Int32 ?? 0;

            Song.Entities.Course cou = Business.Do <ICourse>().CourseSingle(id);
            if (cou != null)
            {
                if ((WeiSha.Common.Request.Cookies["Course_" + cou.Cou_ID].Int32 ?? 0) == 0)
                {
                    cou.Cou_ViewNum++;
                    Business.Do <ICourse>().CourseSave(cou);
                    context.Response.Cookies["Course_" + cou.Cou_ID].Value = cou.Cou_ID.ToString();
                }
                cou.Cou_Logo      = string.IsNullOrWhiteSpace(cou.Cou_Logo) ? "" : Upload.Get["Course"].Virtual + cou.Cou_Logo;
                cou.Cou_LogoSmall = string.IsNullOrWhiteSpace(cou.Cou_LogoSmall) ? "" : Upload.Get["Course"].Virtual + cou.Cou_LogoSmall;
                this.Document.Variables.SetValue("course", cou);
            }
            //是否学习当前课程
            if (this.Account != null)
            {
                //是否购买
                isBuy = Business.Do <ICourse>().StudyIsCourse(this.Account.Ac_ID, cou.Cou_ID);
                this.Document.Variables.SetValue("isStudy", isBuy);
                //是否在试用中
                bool istry = Business.Do <ICourse>().IsTryout(cou.Cou_ID, this.Account.Ac_ID);
                this.Document.Variables.SetValue("isTry", istry);
            }
            //课程章节列表
            outline = Business.Do <IOutline>().OutlineAll(cou.Cou_ID, true);
            this.Document.Variables.SetValue("Outline", outline);
            //树形章节输出
            this.Document.Variables.SetValue("olTree", buildOutlineHtml(outline, 0, 0, ""));
            //课程公告
            Song.Entities.Guide[] guides = Business.Do <IGuide>().GuideCount(-1, cou.Cou_ID, -1, 20);
            this.Document.Variables.SetValue("guides", guides);
            //当前课程的主讲老师
            Song.Entities.Teacher teacher = Business.Do <ITeacher>().TeacherSingle(cou.Th_ID);
            if (teacher != null)
            {
                teacher.Th_Photo = Upload.Get["Teacher"].Virtual + teacher.Th_Photo;
                this.Document.Variables.SetValue("th", teacher);
            }
            //所有资源库的分类
            Song.Entities.KnowledgeSort[] ncs = Business.Do <IKnowledge>().GetSortAll(Organ.Org_ID, id, true);
            WeiSha.WebControl.MenuTree    mt  = new WeiSha.WebControl.MenuTree();
            mt.Title           = "全部";
            mt.DataTextField   = "Kns_Name";
            mt.IdKeyName       = "Kns_Id";
            mt.ParentIdKeyName = "Kns_PID";
            mt.TaxKeyName      = "Kns_Tax";
            mt.SourcePath      = "/manage/Images/tree";
            //mt.TypeKeyName = "Kns_Type";
            mt.IsUseKeyName = "Kns_IsUse";
            //mt.IsShowKeyName = "Nc_IsShow";
            mt.DataSource = ncs;
            mt.DataBind();
            this.Document.Variables.SetValue("tree", mt.HTML);
            //上级专业
            List <Subject> sbjs = Business.Do <ISubject>().Parents(cou.Sbj_ID, true);

            this.Document.Variables.SetValue("parentsbjs", sbjs);
            //当前课程的学员
            Tag stTag = this.Document.GetChildTagById("students");

            if (stTag != null)
            {
                int count = int.Parse(stTag.Attributes.GetValue("count", "5"));
                Song.Entities.Accounts[] eas = null;
                eas = Business.Do <ICourse>().Student4Course(cou.Cou_ID, null, null, count, 1, out count);
                this.Document.SetValue("students", eas);
            }
        }