Ejemplo n.º 1
0
 partial void DeleteSystemEventLog(SystemEventLog instance);
Ejemplo n.º 2
0
 partial void InsertSystemEventLog(SystemEventLog instance);
Ejemplo n.º 3
0
 partial void UpdateSystemEventLog(SystemEventLog instance);
Ejemplo n.º 4
0
        //Own methods
        private void BookingLog(string ErrorType, string Message)
        {
            //First we write to the normal windows application log
            writeToLog("Computer: " + System.Environment.MachineName + " " + ErrorType, Message);

            //Then try to sende error message til a gmail account
            sendToGmail("Computer: " + System.Environment.MachineName + " " + ErrorType + " " + Message);

            //And last we try to write to the SQL log tabel if possible
            try
            {
                DataClasses1DataContext db = new DataClasses1DataContext();

                Thread.Sleep(100);

                Random _rn = new Random(DateTime.Today.Millisecond);

                SystemEventLog _log = new SystemEventLog();

                _log.bookingLogID = _rn.Next().ToString();
                _log.bookingLogErrorType = "Computer: " + System.Environment.MachineName + " " + ErrorType;
                _log.bookingLogMessage = Message;
                _log.bookingLogDateTime = DateTime.Now;

                db.SystemEventLogs.InsertOnSubmit(_log);

                db.SubmitChanges();
            }
            catch (Exception E)
            {
            }
        }