Beispiel #1
0
        public int CompareTo(object obj)
        {
            FooterMenu t = obj as FooterMenu;

            if (this.OrderId > t.OrderId)
            {
                return(-1);
            }
            if (this.OrderId < t.OrderId)
            {
                return(1);
            }
            if (this.Id > t.Id)
            {
                return(1);
            }
            if (this.Id < t.Id)
            {
                return(-1);
            }
            return(0);
        }
Beispiel #2
0
 private FooterMenu validate( FooterMenu data )
 {
     data = ctx.PostValue( data ) as FooterMenu;
     if (strUtil.IsNullOrEmpty( data.Name )) errors.Add( lang( "exName" ) );
     if (strUtil.IsNullOrEmpty( data.Link )) errors.Add( lang( "exLink" ) );
     return data;
 }
Beispiel #3
0
 private void log( String msg, FooterMenu data )
 {
     String dataInfo = "{Id:" + data.Id + ", Name:'" + data.Name + "'}";
     logService.Add( (User)ctx.viewer.obj, msg, dataInfo, typeof( FooterMenu ).FullName, ctx.Ip );
 }
Beispiel #4
0
        private void createPage( String title, PageCategory category, Boolean isFooter )
        {
            Page page = new Page();
            page.Creator = new User( 1 );
            page.OwnerType = typeof( Site ).FullName;
            page.OwnerUrl = "/";
            page.Title = title;
            page.Content = title;
            page.Category = category;
            page.EditReason = "创建页面";

            pageService.Insert( page );

            // FooterMenu
            if (isFooter == false) return;

            FooterMenu fm = new FooterMenu();
            fm.Name = page.Name;
            fm.Link = Link.To( Site.Instance, new Common.PageController().Show, page.Id );
            fm.insert();
        }