private string GetLogMessages()
        {
            string returnMessages = string.Empty;

            returnMessages += "<table border=1><tr><th>User</th><th>Message</th><th>PostDate</th></tr>";

            using (DAL.LCDMessageDBEntities db = new DAL.LCDMessageDBEntities())
            {
                var messages = (
                    from p in db.MessageLogs
                    orderby p.messageID descending
                    select p).Take(20);
                foreach (var item in messages)
                {
                    returnMessages += "<tr>";
                    returnMessages += "<td>" + item.username + "</td>";
                    string msg = item.message;
                    if (msg.Length > 1000)
                    {
                        msg = msg.Substring(0, 1000) + "....";
                    }
                    msg             = FormatDisplayString(msg, "</br>");
                    returnMessages += "<td nowrap='nowrap'>" + msg + "</td>";
                    returnMessages += "<td>" + item.messageDate + "</td>";
                    returnMessages += "</tr>";
                }
            }
            returnMessages += "</table>";
            return(returnMessages);
        }
 private void LogMessage(string inputMessage)
 {
     DAL.LCDMessageDBEntities ent  = new DAL.LCDMessageDBEntities();
     DAL.MessageLog           mess = DAL.MessageLog.CreateMessageLog(0, inputMessage, lblUser.Text, DateTime.Now);
     ent.AddToMessageLogs(mess);
     ent.SaveChanges();
 }