예제 #1
0
        public static IHtmlControl GetDialogueView(SiteState state,
                                                   IDataLayer forumConnection, UserStorage userStorage, LightObject user, out string title)
        {
            title = "Диалоги";

            TableLink dialogueLink = DialogueHlp.LoadDialogueLink(forumConnection,
                                                                  "user_id = @userId order by modify_time desc",
                                                                  new DbParameter("userId", user.Id)
                                                                  );

            IHtmlControl[] messageBlocks = new IHtmlControl[dialogueLink.AllRows.Length];
            int            i             = -1;

            foreach (RowLink dialog in dialogueLink.AllRows)
            {
                ++i;
                messageBlocks[i] = GetDialogBlock(forumConnection, userStorage, user, dialog, i);
            }

            return(new HPanel(
                       Decor.Title("Диалоги"),
                       new HPanel(
                           messageBlocks
                           )
                       ));
        }