Ejemplo n.º 1
0
        public static void NewLogInformation(STATIONNAME StationName, DateTime LogDate, String Message, LogType LogCategory, long?UserID)
        {
            InformationLogs NewLog = new InformationLogs();

            NewLog.LogID       = (long)(DateTime.UtcNow - DateTime.MinValue).TotalMilliseconds;
            NewLog.UserID      = UserID;
            NewLog.LogName     = "Log from " + StationName.ToString();
            NewLog.LogDate     = LogDate;
            NewLog.LogValue    = null;
            NewLog.LogMessage  = Message;
            NewLog.LogCategory = LogCategory;
            NewLog.StationName = StationName;

            TTCSLogInformation.Add(NewLog);
            TTCSTempLogInformation.Add(NewLog);

            if (!TTCSLog.IsSearchByAllStation)
            {
                AddLogToGrid(StationName, LogDate, Message, LogCategory, null, UserID);
            }
            else if (TTCSLog.IsSearchByAllStation && LogDate >= StartDate && LogDate <= EndDate)
            {
                AddLogToGrid(StationName, LogDate, Message, LogCategory, null, UserID);
            }
        }
Ejemplo n.º 2
0
        public static void NewLogInformation(STATIONNAME StationName, DateTime LogDate, String LogName, Object[] Value, String Message, LogType LogCategory, long?UserID)
        {
            InformationLogs NewLog = new InformationLogs();

            NewLog.LogID    = (long)(DateTime.UtcNow - DateTime.MinValue).TotalMilliseconds;
            NewLog.UserID   = UserID;
            NewLog.LogName  = LogName;
            NewLog.LogDate  = LogDate;
            NewLog.LogValue = Value != null?String.Join(", ", Value) : null;

            NewLog.LogMessage  = Message;
            NewLog.LogCategory = LogCategory;
            NewLog.StationName = StationName;

            if (DateTime.UtcNow.Hour == 1)
            {
                TTCSTempLogInformation.Clear();
            }

            TTCSLogInformation.Add(NewLog);
            TTCSTempLogInformation.Add(NewLog);

            if (!TTCSLog.IsSearchByAllStation)
            {
                AddLogToGrid(StationName, LogDate, Message, LogCategory, NewLog.LogValue, UserID);
            }
            else if (TTCSLog.IsSearchByAllStation && LogDate >= StartDate && LogDate <= EndDate)
            {
                AddLogToGrid(StationName, LogDate, Message, LogCategory, NewLog.LogValue, UserID);
            }
        }
Ejemplo n.º 3
0
        public static ReturnLogInformation GetLogList()
        {
            List <InformationLogs> TempLogs = new List <InformationLogs>();

            for (int i = 0; i < TTCSTempLogInformation.Count; i++)
            {
                TempLogs.Add(TTCSTempLogInformation[i]);
            }

            TTCSTempLogInformation.Clear();
            return(ReturnLogInformation.DefineReturn(ReturnStatus.SUCESSFUL, null, TempLogs));
        }