using System.Collections.Generic;

namespace Stat.Html
{
    public class Message
    {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static string Get(IList<Stat.Model.Message> list,Model.PageInfo pageModel)
        {


            int st = (pageModel.PageIndex - 1) * pageModel.PageSize;

            System.Text.StringBuilder tep = new System.Text.StringBuilder();

            for (int i = 0; i < list.Count; i++)
            {
                tep.Append("<div class=\"msgBox\">");
                tep.Append("<DIV class=\"Circle_Box_1\"></DIV>");
                tep.Append("<DIV class=\"Circle_Box_2\"></DIV>");
                tep.Append("<DIV class=\"Circle_Box_3\"></DIV>");
                tep.Append("<DIV class=\"Circle_Box\">");
                tep.Append("<DIV >	");
                tep.Append("<div class=\"msgtitle\">");
                tep.Append("<div style=\"width:50%; float:left; text-indent:10px;\"> ("+(++st)+") " + list[i].title + "</div>");
                tep.Append("<div style=\"width:49%; float:right;font-weight:12px;\">访客：" + list[i].Author + " 时间：" + list[i].AddTime + "</div>");
                tep.Append("</div>");
                tep.Append("<div class=\"msgConten\">");
                tep.Append(list[i].content);
                tep.Append("</div>");
                tep.Append("<div class=\"msgRenew\">");

                if (list[i].Source != null)
                {
                    tep.Append(list[i].Source);
                }
                tep.Append("</div>	");
                tep.Append("</DIV>");
                tep.Append("</DIV>");
                tep.Append(" <DIV class=\"Circle_Box_4\"></DIV>");
                tep.Append(" <DIV class=\"Circle_Box_5\"></DIV>");
                tep.Append(" <DIV class=\"Circle_Box_1\"></DIV>");
                tep.Append("</div>");

            }
            return tep.ToString();
        }
    }
}
