コード例 #1
0
 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();
 }
コード例 #2
0
        /// <summary>
        /// Create a new MessageLog object.
        /// </summary>
        /// <param name="messageID">Initial value of the messageID property.</param>
        /// <param name="message">Initial value of the message property.</param>
        /// <param name="username">Initial value of the username property.</param>
        /// <param name="messageDate">Initial value of the messageDate property.</param>
        public static MessageLog CreateMessageLog(global::System.Int32 messageID, global::System.String message, global::System.String username, global::System.DateTime messageDate)
        {
            MessageLog messageLog = new MessageLog();

            messageLog.messageID   = messageID;
            messageLog.message     = message;
            messageLog.username    = username;
            messageLog.messageDate = messageDate;
            return(messageLog);
        }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the MessageLogs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMessageLogs(MessageLog messageLog)
 {
     base.AddObject("MessageLogs", messageLog);
 }