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(); }
/// <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); }
/// <summary> /// Deprecated Method for adding a new object to the MessageLogs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToMessageLogs(MessageLog messageLog) { base.AddObject("MessageLogs", messageLog); }