Exemple #1
0
        public void LogMessage(string message, LogMessageTypes logMessageType)
        {
            var messageType = string.Empty;
            switch(logMessageType)
                {
                    case LogMessageTypes.Error:
                        messageType = "Error";
                        break;
                    case LogMessageTypes.Info:
                        messageType = "Info";
                        break;

                }

            using (var context = DataAccess.GetDataContext())
            {
                var log = new Tbl_ApplicationLog
                {
                    LogMessage = message,
                    LogMessageType = messageType,
                    LoggedDateTime = System.DateTime.Now
                };

                context.Tbl_ApplicationLogs.InsertOnSubmit(log);
                context.SubmitChanges();
            }
        }
 partial void UpdateTbl_ApplicationLog(Tbl_ApplicationLog instance);
 partial void DeleteTbl_ApplicationLog(Tbl_ApplicationLog instance);
 partial void InsertTbl_ApplicationLog(Tbl_ApplicationLog instance);