Esempio n. 1
0
        private void AddLogFileRecord(int index, ust_LogFile lf)
        {
            db_logfileRecord lfr = new db_logfileRecord();

            lfr.Errors = new List <db_errorRecord>();
            lfr.Data   = new List <ust_LogSmetaData>();

            string Code = DB[index].Smeta.Code;
            int    ind  = alfr_findSmetaIndex(Code, lf);

            lfr.File = lf.File;
            lfr.Data.AddRange(lf.Body[ind].Data);
            lfr.SmetaDescription = lf.Body[ind].Description;
            alfr_fillErrors(ref lfr);
            DB[index].Logs.Add(lfr);
        }
Esempio n. 2
0
        private void AddUstLogSmeta(int DBindex, int BodyIndex, ust_LogFile lf)
        {
            db_logfileRecord lfr = new db_logfileRecord();

            lfr.Errors = new List <db_errorRecord>();
            lfr.Data   = new List <ust_LogSmetaData>();

            lfr.File = lf.File;
            if (lf.Body[BodyIndex].Data != null)
            {
                lfr.Data = lf.Body[BodyIndex].Data.ToList();
            }
            lfr.SmetaDescription = lf.Body[BodyIndex].Description;
            alfr_fillErrors(ref lfr);
            DB[DBindex].Logs.Add(lfr);
        }
Esempio n. 3
0
        private void alfr_fillErrors(ref db_logfileRecord lfr)
        {
            if (lfr.Data == null)
            {
                return;
            }
            if (lfr.Data.Count < 1)
            {
                return;
            }

            List <ust_LogSmetaData> errors = lfr.Data.FindAll(
                delegate(ust_LogSmetaData lsd)
                { return(lsd.Event.Contains("Ошибка")); });
            db_errorRecord eR = new db_errorRecord();

            foreach (ust_LogSmetaData err in errors)
            {
                eR.Description = null; eR.Number = 0; //reinit
                int iOfDot = err.Event.IndexOf('.');
                int iOfSpc = err.Event.IndexOf(' ');

                if (iOfDot > 0 && iOfSpc > 0)
                {
                    eR.Number      = int.Parse(err.Event.Substring(iOfSpc + 1, iOfDot - iOfSpc - 1));
                    eR.Description = err.Event.Substring(iOfDot + 2);
                }
                else
                {
                    eR.Number      = 0;
                    eR.Description = err.Event;
                }

                lfr.Errors.Add(eR);
            }
        }