Esempio n. 1
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            //
            int thCount = int.Parse(this.Tag.Attributes.GetValue("count", "10"));

            Song.Entities.Teacher[] teachers = Business.Do <ITeacher>().TeacherCount(Organ.Org_ID, true, thCount);
            foreach (Song.Entities.Teacher t in teachers)
            {
                Song.Entities.Accounts acc = Business.Do <IAccounts>().AccountsSingle(t.Ac_ID);
                //教师照片
                if (string.IsNullOrWhiteSpace(t.Th_Photo))
                {
                    if (acc != null)
                    {
                        t.Th_Photo = acc.Ac_Photo;
                        Business.Do <ITeacher>().TeacherSave(t);
                    }
                }
                if (!string.IsNullOrWhiteSpace(t.Th_Photo))
                {
                    t.Th_Photo = Upload.Get["Teacher"].Virtual + t.Th_Photo;
                }
                //是否显示电话
            }
            tag.DataSourse = teachers;
        }
Esempio n. 2
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            //
            int count = int.Parse(this.Tag.Attributes.GetValue("count", "-1"));
            int sort  = 0; //友情链接分类id
            //object sortStr = this.ListTag.Sort.GetValue();
            //int.TryParse(sortStr.ToString(), out sort);
            //分类名称
            string sortName = this.Tag.Attributes.GetValue("sortname", "");

            Song.Entities.Links[] links = null;
            if (!string.IsNullOrWhiteSpace(sortName))
            {
                links = Business.Do <ILinks>().GetLinks(Organ.Org_ID, sortName, true, true, count);
            }
            else
            {
                links = Business.Do <ILinks>().GetLinks(Organ.Org_ID, sort, true, true, count);
            }
            foreach (Song.Entities.Links s in links)
            {
                s.Lk_Logo      = Upload.Get["Links"].Virtual + s.Lk_Logo;
                s.Lk_LogoSmall = Upload.Get["Links"].Virtual + s.Lk_LogoSmall;
            }
            tag.DataSourse = links;
        }
Esempio n. 3
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            //
            int count = int.Parse(this.Tag.Attributes.GetValue("count", "10")); //要取的记录数
            int sbjid = int.Parse(this.Tag.Attributes.GetValue("sbjid", "-1")); //所属专业的id
            //int thid = int.Parse(this.ListTag.Attributes.GetValue("thid", "-1"));   //教师id
            //int pid = int.Parse(this.ListTag.Attributes.GetValue("pid", "-1"));     //上级课程
            string search = this.Tag.Attributes.GetValue("search", "");       //按课程名检索
            string order  = this.Tag.Attributes.GetValue("order", "");        //排序方式,flux流量最大优先,def推荐、流量,tax排序号,new最新,rec推荐
            object from   = this.Tag.Attributes.GetValue("from", null);

            if (from == null)
            {
                List <Song.Entities.Course> cours = Business.Do <ICourse>().CourseCount(this.Organ.Org_ID, sbjid, search, true, order, count);
                foreach (Song.Entities.Course c in cours)
                {
                    c.Cou_LogoSmall = string.IsNullOrWhiteSpace(c.Cou_LogoSmall) ? "" : Upload.Get["Course"].Virtual + c.Cou_LogoSmall;
                    c.Cou_Logo      = string.IsNullOrWhiteSpace(c.Cou_Logo) ? "" : Upload.Get["Course"].Virtual + c.Cou_Logo;
                    c.Cou_Intro     = HTML.ClearTag(c.Cou_Intro);
                }
                tag.DataSourse = cours;
            }
        }
Esempio n. 4
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            //
            int    count   = int.Parse(this.Tag.Attributes.GetValue("count", "10"));   //要取的记录数
            int    columns = int.Parse(this.Tag.Attributes.GetValue("columns", "-1")); //新闻栏目id,默认取所有
            string order   = this.Tag.Attributes.GetValue("order", "hot");             //排序方式
            object from    = this.Tag.Attributes.GetValue("from", null);

            if (from == null)
            {
                Song.Entities.Article[] news = Business.Do <IContents>().ArticleCount(this.Organ.Org_ID, columns, count, order);
                foreach (Song.Entities.Article n in news)
                {
                    n.Art_Logo = Upload.Get["News"].Virtual + n.Art_Logo;
                    if (string.IsNullOrWhiteSpace(n.Art_Intro))
                    {
                        n.Art_Intro = WeiSha.Common.HTML.ClearTag(n.Art_Details, 200);
                    }
                }
                //指定数据源
                tag.DataSourse = news;
            }
        }
Esempio n. 5
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            //
            int noCount = int.Parse(this.Tag.Attributes.GetValue("count", "10"));

            Song.Entities.Notice[] notice = Business.Do <INotice>().GetCount(Organ.Org_ID, true, noCount);
            tag.DataSourse = notice;
        }
Esempio n. 6
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            //
            int count = int.Parse(this.Tag.Attributes.GetValue("count", "10"));
            //内容分类的类别,产品Product,新闻news,图片Picture,视频video,下载download,单页article
            string type = this.Tag.Attributes.GetValue("ctype", "News");

            Song.Entities.Columns[] sts = Business.Do <IColumns>().ColumnCount(Organ.Org_ID, type, true, count);
            tag.DataSourse = sts;
        }
Esempio n. 7
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            int size = 20, index = 1;
            int sumcount = 0;
            //
            int couid   = int.Parse(this.Tag.Attributes.GetValue("couid", "-1"));   //所属课程的id
            int noCount = int.Parse(this.Tag.Attributes.GetValue("count", "10"));

            Song.Entities.Guide[] entities = Business.Do <IGuide>().GetGuidePager(Organ.Org_ID, couid, -1, null, true, size, index, out sumcount);
            tag.DataSourse = entities;
        }
Esempio n. 8
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            //
            string site = this.Tag.Attributes.GetValue("site", "web");

            Song.Entities.ShowPicture[] shp = Business.Do <IStyle>().ShowPicAll(true, site, Organ.Org_ID);
            foreach (Song.Entities.ShowPicture s in shp)
            {
                s.Shp_File = Upload.Get["ShowPic"].Virtual + s.Shp_File;
            }
            tag.DataSourse = shp;
        }
Esempio n. 9
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            //
            int    count  = tag.Count;
            int    start  = int.Parse(this.Tag.Attributes.GetValue("start", "0")); //起始索引号
            string search = this.Tag.Attributes.GetValue("search", "");            //检索字符
            //上级专业的id
            int pid = 0;

            int.TryParse(this.Tag.Attributes.GetValue("pid", "0"), out pid);
            //排序方式,def默认排序(先推荐,后排序号),tax按排序号,rec按推荐
            string order = this.Tag.Attributes.GetValue("order", "def");

            //取上传标签的数据源
            if (this.Tag.Parent != null)
            {
                VTemplate.Engine.ListTag t = this.Tag.Parent as VTemplate.Engine.ListTag;
                if (t != null && t.DataSourse != null)
                {
                    Song.Entities.Subject[] sbjt = t.DataSourse as Song.Entities.Subject[];
                    int    sid = sbjt[0].Sbj_ID;
                    object o   = tag.Index.Value;
                }
            }
            //数据来源
            string from = this.Tag.Attributes.GetValue("from");

            //如果没有指定数据来源(如果指定了但值为空,仍然认为已经指定),才会读取数据库。
            if (string.IsNullOrWhiteSpace(from))
            {
                Song.Entities.Subject[] sbjs = Business.Do <ISubject>().SubjectCount(this.Organ.Org_ID, search, true, pid, order, start, count);
                //sbjs[0].child = 3;
                foreach (Song.Entities.Subject c in sbjs)
                {
                    c.Sbj_Logo      = Upload.Get["Subject"].Virtual + c.Sbj_Logo;
                    c.Sbj_LogoSmall = Upload.Get["Subject"].Virtual + c.Sbj_LogoSmall;
                    c.Sbj_Intro     = HTML.ClearTag(c.Sbj_Intro);
                }
                tag.DataSourse = sbjs;
            }
        }
Esempio n. 10
0
        public override void DataBind()
        {
            VTemplate.Engine.ListTag tag = this.Tag as VTemplate.Engine.ListTag;
            if (tag == null)
            {
                return;
            }
            //
            int count = int.Parse(this.Tag.Attributes.GetValue("count", "-1"));

            Song.Entities.LinksSort[] sorts = Business.Do <ILinks>().GetSortCount(Organ.Org_ID, true, true, count);
            foreach (Song.Entities.LinksSort s in sorts)
            {
                s.Ls_Logo = Upload.Get["Links"].Virtual + s.Ls_Logo;
            }
            tag.DataSourse = sorts;
        }