public static List <ExceptionInfo> ReadN(List <long> idList)
        {
            if (idList.Count > Constants.MaxListSize)
            {
                throw new Exception("Maximum list size is exceeded in ExceptionInfoTools.ReadN(list) !");
            }

            List <ExceptionInfo> result = CurrDBContext.Get().tblExceptionInfo.Where(x => idList.Contains(x.Id)).
                                          Select
                                          (
                x =>
                new ExceptionInfo
                (
                    x.Id,
                    x.InnerExceptionId,
                    x.DateTime,
                    x.Levels,
                    x.Value,
                    x.Data,
                    x.TargetSite,
                    x.Message,
                    x.StackTrace,
                    x.Sources
                )
                                          ).ToList();

            return(result);
        }
Esempio n. 2
0
        public static List <LogItem> ReadN(List <long> idList)
        {
            if (idList.Count > Constants.MaxListSize)
            {
                throw new Exception("Maximum list size is exceeded in LogItemTools.ReadN(list) !");
            }

            List <LogItem> result = CurrDBContext.Get().tblLogItem.Where(x => idList.Contains(x.Id)).
                                    Select
                                    (
                x =>
                new LogItem
                (
                    x.Id,
                    x.DateTime,
                    x.Value,
                    x.Comment,
                    x.ApplicationId,
                    x.LayerId,
                    x.SubsystemId,
                    x.MethodId,
                    x.MethodName,
                    x.StringNumber,
                    x.SystemInfoId,
                    x.ExceptionInfoId
                )
                                    ).ToList();

            return(result);
        }
Esempio n. 3
0
        public static List <TranslatedString> ReadN(List <long> idList)
        {
            List <TranslatedString> result = CurrDBContext.Get().tblTranslatedString.Where(x => idList.Contains(x.Id)).
                                             Select(x => new TranslatedString(x.Id, (long)x.Language, (TranslatedStringType)x.Type, x.ReferencedItemId, x.Value)).ToList();

            return(result);
        }
Esempio n. 4
0
        public static TranslatedString Read1(long id)
        {
            TranslatedString result = CurrDBContext.Get().tblTranslatedString.Where(x => x.Id == id).
                                      Select(x => new TranslatedString(x.Id, (long)x.Language, (TranslatedStringType)x.Type, x.ReferencedItemId, x.Value)).SingleOrDefault();

            return(result);
        }
        public static Directory Read(long id)
        {
            Directory result = CurrDBContext.Get().tblDirectory.Where(x => x.Id == id).
                               Select(x => new Directory(x.Id, x.EnumName, x.IsReadOnly)).SingleOrDefault();

            return(result);
        }
Esempio n. 6
0
        public static List <Language> Read(List <long> idList)
        {
            List <Language> result = CurrDBContext.Get().tblLanguage.Where(x => idList.Contains(x.Id)).
                                     Select(x => new Language(x.Id, x.EnumName, x.UIName)).ToList();

            return(result);
        }
        public static List <DirectoryValue> ReadN(List <long> idList)
        {
            List <DirectoryValue> result = CurrDBContext.Get().tblDirectoryValue.Where(x => idList.Contains(x.Id)).
                                           Select(x => new DirectoryValue(x.Id, x.EnumName, x.IsReadOnly, x.DirectoryId)).ToList();

            return(result);
        }
        public static DirectoryValue Read1(long currItemId)
        {
            DirectoryValue result = CurrDBContext.Get().tblDirectoryValue.Where(x => x.Id == currItemId).
                                    Select(x => new DirectoryValue(x.Id, x.EnumName, x.IsReadOnly, x.DirectoryId)).SingleOrDefault();

            return(result);
        }
Esempio n. 9
0
        public static Language Read(long id)
        {
            Language result = CurrDBContext.Get().tblLanguage.Where(x => x.Id == id).
                              Select(x => new Language(x.Id, x.EnumName, x.UIName)).SingleOrDefault();

            return(result);
        }
Esempio n. 10
0
        public static List <TranslatedString> ReadWithFilter(long referencedItemId, TranslatedStringType type)
        {
            List <TranslatedString> result = CurrDBContext.Get().tblTranslatedString.Where(x => x.ReferencedItemId == referencedItemId && x.Type == (int)type).
                                             Select(x => new TranslatedString(x.Id, (long)x.Language, (TranslatedStringType)x.Type, x.ReferencedItemId, x.Value)).ToList();

            return(result);
        }
        public static void UnDelete1(long currItemId)
        {
            tblDirectoryValue dataItem = CurrDBContext.Get().tblDirectoryValue.Where(x => x.Id == currItemId).Single();

            dataItem.IsDeleted = false;
            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 12
0
        public static void Delete1(long id)
        {
            tblLogItem item = CurrDBContext.Get().tblLogItem.Where(x => x.Id == id).SingleOrDefault();

            CurrDBContext.Get().tblLogItem.Remove(item);
            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 13
0
        public static List <SystemInfo> ReadN(List <long> idList)
        {
            if (idList.Count > Constants.MaxListSize)
            {
                throw new Exception("Maximum list size is exceeded in SystemInfoTools.ReadN(list) !");
            }

            List <SystemInfo> result = CurrDBContext.Get().tblSystemInfo.Where(x => idList.Contains(x.Id)).
                                       Select
                                       (
                x =>
                new SystemInfo
                (
                    x.Id,
                    x.CommandLine,
                    x.CurrentDirectory,
                    x.MachineName,
                    x.OSVersion,
                    x.ProcessorCount,
                    x.StackTrace,
                    x.SystemDirectory,
                    x.SystemPageSize,
                    x.UserName,
                    x.UserDomainName,
                    x.Is64BitOperatingSystem,
                    x.GetLogicalDrives
                )
                                       ).ToList();

            return(result);
        }
Esempio n. 14
0
        public static SystemInfo Read1(long id)
        {
            SystemInfo result = CurrDBContext.Get().tblSystemInfo.Where(x => x.Id == id).
                                Select
                                (
                x =>
                new SystemInfo
                (
                    x.Id,
                    x.CommandLine,
                    x.CurrentDirectory,
                    x.MachineName,
                    x.OSVersion,
                    x.ProcessorCount,
                    x.StackTrace,
                    x.SystemDirectory,
                    x.SystemPageSize,
                    x.UserName,
                    x.UserDomainName,
                    x.Is64BitOperatingSystem,
                    x.GetLogicalDrives
                )
                                ).SingleOrDefault();

            return(result);
        }
Esempio n. 15
0
        public static LogItem Read1(long id)
        {
            LogItem result = CurrDBContext.Get().tblLogItem.Where(x => x.Id == id).
                             Select
                             (
                x =>
                new LogItem
                (
                    x.Id,
                    x.DateTime,
                    x.Value,
                    x.Comment,
                    x.ApplicationId,
                    x.LayerId,
                    x.SubsystemId,
                    x.MethodId,
                    x.MethodName,
                    x.StringNumber,
                    x.SystemInfoId,
                    x.ExceptionInfoId
                )
                             ).SingleOrDefault();

            return(result);
        }
Esempio n. 16
0
        public static void Update(Language updLang)
        {
            tblLanguage dataItem = CurrDBContext.Get().tblLanguage.Where(x => x.Id == updLang.Id).Single();

            dataItem.EnumName = updLang.EnumName;
            dataItem.UIName   = updLang.UIName;

            CurrDBContext.Get().SaveChanges();
        }
        public static void Update(Directory item)
        {
            tblDirectory dataItem = CurrDBContext.Get().tblDirectory.Where(x => x.Id == item.Id).Single();

            dataItem.EnumName   = item.EnumName;
            dataItem.IsReadOnly = item.IsReadOnly;
            dataItem.IsDeleted  = item.IsDeleted;

            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 18
0
        public static void Create(Language lng)
        {
            tblLanguage currItem = new tblLanguage
            {
                EnumName = lng.EnumName,
                UIName   = lng.UIName
            };

            CurrDBContext.Get().tblLanguage.Add(currItem);
            CurrDBContext.Get().SaveChanges();
        }
        public static void Create(Directory item)
        {
            tblDirectory currItem = new tblDirectory
            {
                EnumName   = item.EnumName,
                IsReadOnly = item.IsReadOnly
            };

            CurrDBContext.Get().tblDirectory.Add(currItem);
            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 20
0
        public static void Update1(TranslatedString item)
        {
            tblTranslatedString dataItem = CurrDBContext.Get().tblTranslatedString.Where(x => x.Id == item.Id).Single();

            dataItem.Language         = item.Language;
            dataItem.ReferencedItemId = item.ReferencedItemId;
            dataItem.Type             = (int)item.Type;
            dataItem.Value            = item.Value;

            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 21
0
        public static void UnDeleteN(List <long> idList)
        {
            List <tblTranslatedString> tableItemsList = CurrDBContext.Get().tblTranslatedString.Where(x => idList.Contains(x.Id)).ToList();

            foreach (tblTranslatedString currTableItem in tableItemsList)
            {
                currTableItem.IsDeleted = true;
            }

            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 22
0
        public static void DeleteN(List <long> idList)
        {
            if (idList.Count > Constants.MaxListSize)
            {
                throw new Exception("Maximum list size is exceeded in LogItemTools.DeleteN(list) !");
            }

            List <tblLogItem> items = CurrDBContext.Get().tblLogItem.Where(x => idList.Contains(x.Id)).ToList();

            CurrDBContext.Get().tblLogItem.RemoveRange(items);
            CurrDBContext.Get().SaveChanges();
        }
        public static void Create1(DirectoryValue item)
        {
            tblDirectoryValue currItem = new tblDirectoryValue
            {
                DirectoryId = item.DirectoryId,
                EnumName    = item.EnumName,
                IsReadOnly  = item.IsReadOnly
            };

            CurrDBContext.Get().tblDirectoryValue.Add(currItem);
            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 24
0
        public static void Create1(TranslatedString item)
        {
            tblTranslatedString currItem = new tblTranslatedString
            {
                Language         = item.Language,
                ReferencedItemId = item.ReferencedItemId,
                Type             = (int)item.Type,
                Value            = item.Value
            };

            CurrDBContext.Get().tblTranslatedString.Add(currItem);
            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 25
0
 public static void CreateN(List <TranslatedString> itemList)
 {
     foreach (TranslatedString currItem in itemList)
     {
         tblTranslatedString currNewItem = new tblTranslatedString
         {
             Language         = currItem.Language,
             ReferencedItemId = currItem.ReferencedItemId,
             Type             = (int)currItem.Type,
             Value            = currItem.Value
         };
         CurrDBContext.Get().tblTranslatedString.Add(currNewItem);
     }
     CurrDBContext.Get().SaveChanges();
 }
        public static void Update1(ExceptionInfo item)
        {
            tblExceptionInfo dataItem = CurrDBContext.Get().tblExceptionInfo.Where(x => x.Id == item.Id).Single();

            dataItem.Id = item.Id;
            dataItem.InnerExceptionId = item.InnerExceptionId;
            dataItem.DateTime         = item.DateTime;
            dataItem.Levels           = item.Levels;
            dataItem.Value            = item.Value;
            dataItem.Data             = item.Data;
            dataItem.TargetSite       = item.TargetSite;
            dataItem.Message          = item.Message;
            dataItem.StackTrace       = item.StackTrace;
            dataItem.Sources          = item.Sources;

            CurrDBContext.Get().SaveChanges();
        }
        public static void Update1(Configuration item)
        {
            tblConfiguration dataItem = CurrDBContext.Get().tblConfiguration.Where(x => x.Id == item.Id).Single();

            dataItem.Id = item.Id;
            dataItem.DisableSavingToFile       = item.DisableSavingToFile;
            dataItem.DisableSavingToWebService = item.DisableSavingToWebService;
            dataItem.DisableSystemMessage      = item.DisableSystemMessage;
            dataItem.DisableMessageForUser     = item.DisableMessageForUser;
            dataItem.DisableInformation        = item.DisableInformation;
            dataItem.DisableWarning            = item.DisableWarning;
            dataItem.DisableError        = item.DisableError;
            dataItem.DisableFatalError   = item.DisableFatalError;
            dataItem.DisableDebugMessage = item.DisableDebugMessage;

            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 28
0
        public static void UpdateN(List <TranslatedString> itemList)
        {
            List <long> idList = itemList.Select(x => x.Id).ToList();
            List <tblTranslatedString> tableItemsList = CurrDBContext.Get().tblTranslatedString.Where(x => idList.Contains(x.Id)).ToList();

            foreach (tblTranslatedString currTableItem in tableItemsList)
            {
                var currNewItem = itemList.SingleOrDefault(x => x.Id == currTableItem.Id);
                if (currNewItem != null)
                {
                    currTableItem.Language         = currNewItem.Language;
                    currTableItem.ReferencedItemId = currNewItem.ReferencedItemId;
                    currTableItem.Type             = (int)currNewItem.Type;
                    currTableItem.Value            = currNewItem.Value;
                }
            }

            CurrDBContext.Get().SaveChanges();
        }
        public static void Create1(ExceptionInfo item)
        {
            tblExceptionInfo currItem = new tblExceptionInfo
            {
                Id = item.Id,
                InnerExceptionId = item.InnerExceptionId,
                DateTime         = item.DateTime,
                Levels           = item.Levels,
                Value            = item.Value,
                Data             = item.Data,
                TargetSite       = item.TargetSite,
                Message          = item.Message,
                StackTrace       = item.StackTrace,
                Sources          = item.Sources,
            };

            CurrDBContext.Get().tblExceptionInfo.Add(currItem);
            CurrDBContext.Get().SaveChanges();
        }
Esempio n. 30
0
        //private static IQueryable<tblLogItem> HasID(this IQueryable<tblLogItem> query, IFilterItem fi)
        //{
        //    switch (fi.ItemType)
        //    {
        //        case enFilterItemTypes.SingleValue:
        //            var query1 = query.Where( x => x.)
        //                break;
        //        case enFilterItemTypes.RangeOfValues:

        //            break;
        //        case enFilterItemTypes.ListOfValues:

        //            break;
        //        default:
        //            throw new Exception("Wrong enFilterItemTypes value in LogItemTools.ReadWithFilterAndSort() !");
        //    }

        //    return id.HasValue ? query.Where(o => i.ID.Equals(id.Value)) : query;
        //}

        //public static ResponseRowsRange<LogItem> ReadWithFilterAndSort(
        //    List<IFilterItem> filterItemsList, List<String> sortingFields, RequestRowsRange range )
        //{
        //    if (range.RowsCount > Constants.MaxListSize)
        //    {
        //        throw new Exception("Maximum list size is exceeded in LogItemTools.ReadWithFilter() !");
        //    }

        //    IQueryable<tblLogItem> query = CurrDBContext.Get().tblLogItem;
        //    foreach (IFilterItem currItem in filterItemsList)
        //    {
        //        switch( currItem.ItemType )
        //        {
        //            case enFilterItemTypes.SingleValue:
        //                var query1 = query.
        //                break;
        //            case enFilterItemTypes.RangeOfValues:

        //                break;
        //            case enFilterItemTypes.ListOfValues:

        //                break;
        //            default:
        //                throw new Exception("Wrong enFilterItemTypes value in LogItemTools.ReadWithFilterAndSort() !");
        //        }
        //        var query = query.Where
        //    }


        //    List<LogItem> result = CurrDBContext.Get().tblLogItem.Where(x => idList.Contains(x.Id)).
        //        Select
        //        (
        //            x =>
        //            new LogItem
        //            (
        //                x.Id,
        //                x.DateTime,
        //                x.Value,
        //                x.Comment,
        //                x.ApplicationId,
        //                x.LayerId,
        //                x.SubsystemId,
        //                x.MethodId,
        //                x.MethodName,
        //                x.StringNumber,
        //                x.SystemInfoId,
        //                x.ExceptionInfoId
        //            )
        //        ).ToList();

        //    return result;
        //}

        public static void Update1(LogItem item)
        {
            tblLogItem dataItem = CurrDBContext.Get().tblLogItem.Where(x => x.Id == item.Id).Single();

            dataItem.Id              = item.Id;
            dataItem.DateTime        = item.DateTime;
            dataItem.Value           = item.Value;
            dataItem.Comment         = item.Comment;
            dataItem.ApplicationId   = item.ApplicationId;
            dataItem.LayerId         = item.LayerId;
            dataItem.SubsystemId     = item.SubsystemId;
            dataItem.MethodId        = item.MethodId;
            dataItem.MethodName      = item.MethodName;
            dataItem.StringNumber    = item.StringNumber;
            dataItem.SystemInfoId    = item.SystemInfoId;
            dataItem.ExceptionInfoId = item.ExceptionInfoId;

            CurrDBContext.Get().SaveChanges();
        }