Ejemplo n.º 1
0
        public static string /*board id*/ CreateBoard(string board_name)
        {
            int    next_id  = NextIdStore.Next(Warehouse.BoardListTable, null);
            string board_id = SandId.MakeBoardId(next_id);

            DynamicTableEntity entity = new DynamicTableEntity(board_id, EMPTY_ROW_KEY);

            entity["boardname"] = new EntityProperty(board_name);
            entity.OperateFlags(new FlagMergeOperation(SandFlags.MT_LOW_KEY + "1"));
#if OLD
            entity["createtime"] = new EntityProperty(DateTime.Now);

            entity["creatoruid"] = new EntityProperty(WebSecurity.CurrentUserId);
            entity["creatormid"] = new EntityProperty(UserStore.CurrentUserMId);
#else
            CreatorConverter.FillEntity(entity, CreatorConverter.Status.Editor, null);
#endif
            Warehouse.BoardListTable.Execute(TableOperation.Insert(entity));

            DiscussionListStore.CreateSkeleton(board_id);
            //don't work for child action. //HttpResponse.RemoveOutputCacheItem("/boardlist");
            Warehouse.BsMapPond.Notify();

            return(board_id);
        }
Ejemplo n.º 2
0
        public DiscussionList(string board_id)
        {
            this.BoardId   = board_id;
            this.BoardName = Warehouse.BsMapPond.Get().GetBoardName(board_id);
            //this.BoardName = BoardInfoStore.GetBoardName(board_id);

            DiscussionListStore.GetLastDiscussions(board_id, COUNT, entity => AddDiscussion(entity));
        }
Ejemplo n.º 3
0
        public BubblingRoll(string id, int list_size)
        {
            this.ListSize = list_size;
            this.Id       = id;
#if OLD
            DiscussionListStore.GetLastDiscussions(board_id, LIST_SIZE, entity => ll.AddFirst(entity.RowKey));
#else
            string key        = SandId.CombineId(PAR_KEY_PREFIX, id);
            string serialized = Warehouse.TemporalTable.LoadLongString(key, "segment0");

            if (serialized != null)
            {
                this.list = Util.DeserializeToLinkedList(serialized);
            }
            else
            {
                this.list = new LinkedList <string>();
            }
#endif
        }