Inheritance: WsJournalDataContext
Ejemplo n.º 1
0
        public static JournalItem GetSingleItem(int id)
        {
            var db = new WorkspaceJournalsDataContext();

            return((from item in db.JournalItems
                    where item.Id == id
                    select item).FirstOrDefault());
        }
Ejemplo n.º 2
0
        public static JournalItem GetSingleItem(int id)
        {
            var db = new WorkspaceJournalsDataContext();

            return (from item in db.JournalItems
                    where item.Id == id
                    select item).FirstOrDefault();
        }
Ejemplo n.º 3
0
        public static IEnumerable <JournalItem> GetItemsForContent(int nodeid)
        {
            var db = new WorkspaceJournalsDataContext();

            return(from item in db.JournalItems
                   where item.NodeId == nodeid && !item.Wherewith.Contains("/Like-") && !item.Wherewith.Contains("/Post-") && !item.Wherewith.Contains("/Comment-") && !item.Wherewith.EndsWith("/Likes") && !item.Wherewith.EndsWith("/Posts") && !item.Wherewith.EndsWith("/Comments")
                   orderby item.When descending
                   select item);
        }
Ejemplo n.º 4
0
        public static IEnumerable <JournalItem> GetItemsForWorkspace(string path)
        {
            var db = new WorkspaceJournalsDataContext();

            return(from item in db.JournalItems
                   where (item.Wherewith == path || item.Wherewith.StartsWith(path + "/")) && !item.Wherewith.Contains("/Like-") && !item.Wherewith.Contains("/Post-") && !item.Wherewith.Contains("/Comment-") && !item.Wherewith.EndsWith("/Likes") && !item.Wherewith.EndsWith("/Posts") && !item.Wherewith.EndsWith("/Comments")
                   orderby item.When descending
                   select item);
        }
Ejemplo n.º 5
0
        public static IEnumerable <JournalItem> GetItemsForUser(IUser user)
        {
            var db = new WorkspaceJournalsDataContext();

            return(from item in db.JournalItems
                   where item.Who == user.Name && !item.Wherewith.Contains("/Like-") && !item.Wherewith.Contains("/Post-") && !item.Wherewith.Contains("/Comment-") && !item.Wherewith.EndsWith("/Likes") && !item.Wherewith.EndsWith("/Posts") && !item.Wherewith.EndsWith("/Comments")
                   orderby item.When descending
                   select item);
        }
Ejemplo n.º 6
0
        public static IEnumerable<JournalItem> GetItemsForContent(int nodeid)
        {
            var db = new WorkspaceJournalsDataContext();

            return (from item in db.JournalItems
                    where item.NodeId == nodeid && !item.Wherewith.Contains("/Like-") && !item.Wherewith.Contains("/Post-") && !item.Wherewith.Contains("/Comment-") && !item.Wherewith.EndsWith("/Likes") && !item.Wherewith.EndsWith("/Posts") && !item.Wherewith.EndsWith("/Comments")
                    orderby item.When descending
                    select item);
        }
Ejemplo n.º 7
0
        public static IEnumerable<JournalItem> GetItemsForWorkspace(string path)
        {
            var db = new WorkspaceJournalsDataContext();

            return (from item in db.JournalItems
                    where (item.Wherewith == path || item.Wherewith.StartsWith(path + "/")) && !item.Wherewith.Contains("/Like-") && !item.Wherewith.Contains("/Post-") && !item.Wherewith.Contains("/Comment-") && !item.Wherewith.EndsWith("/Likes") && !item.Wherewith.EndsWith("/Posts") && !item.Wherewith.EndsWith("/Comments")
                    orderby item.When descending
                    select item);
        }
Ejemplo n.º 8
0
        public static IEnumerable<JournalItem> GetItemsForUser(IUser user)
        {
            var db = new WorkspaceJournalsDataContext();

            return (from item in db.JournalItems
                    where item.Who == user.Name && !item.Wherewith.Contains("/Like-") && !item.Wherewith.Contains("/Post-") && !item.Wherewith.Contains("/Comment-") && !item.Wherewith.EndsWith("/Likes") && !item.Wherewith.EndsWith("/Posts") && !item.Wherewith.EndsWith("/Comments")
                    orderby item.When descending
                    select item);
        }
Ejemplo n.º 9
0
        public static IEnumerable <JournalItem> Get(string path, int maxCount, int skip, bool descending)
        {
            var db = new WorkspaceJournalsDataContext();

            if (descending)
            {
                return((from item in db.JournalItems
                        where item.Wherewith == path || item.Wherewith.StartsWith(path + "/")
                        orderby item.When descending
                        select item).Skip(skip).Take(maxCount));
            }
            else
            {
                return((from item in db.JournalItems
                        where item.Wherewith == path || item.Wherewith.StartsWith(path + "/")
                        select item).Skip(skip).Take(maxCount));
            }
        }
Ejemplo n.º 10
0
 public static void Add(string what, string wherewith, string who, DateTime when, int nodeId, string displayName, string nodeTypeName, string sourcePath, string targetPath, string targetDisplayName, string details, bool hidden)
 {
     var db = new WorkspaceJournalsDataContext();
     db.JournalItems.InsertOnSubmit(
         new JournalItem
         {
             What = what,
             When = when,
             Wherewith = wherewith,
             Who = who,
             NodeId = nodeId,
             DisplayName = displayName,
             NodeTypeName = nodeTypeName,
             SourcePath = sourcePath,
             TargetPath = targetPath,
             TargetDisplayName = targetDisplayName,
             Details = details,
             Hidden = hidden
         });
     db.SubmitChanges();
 }
Ejemplo n.º 11
0
        public static void Add(string what, string wherewith, string who, DateTime when, int nodeId, string displayName, string nodeTypeName, string sourcePath, string targetPath, string targetDisplayName, string details, bool hidden)
        {
            var db = new WorkspaceJournalsDataContext();

            db.JournalItems.InsertOnSubmit(
                new JournalItem
            {
                What              = what,
                When              = when,
                Wherewith         = wherewith,
                Who               = who,
                NodeId            = nodeId,
                DisplayName       = displayName,
                NodeTypeName      = nodeTypeName,
                SourcePath        = sourcePath,
                TargetPath        = targetPath,
                TargetDisplayName = targetDisplayName,
                Details           = details,
                Hidden            = hidden
            });
            db.SubmitChanges();
        }
Ejemplo n.º 12
0
        public static IEnumerable<JournalItem> Get(string path, int maxCount, int skip, bool descending)
        {
            var db = new WorkspaceJournalsDataContext();

            if (descending)
            {
                return (from item in db.JournalItems
                        where item.Wherewith == path || item.Wherewith.StartsWith(path + "/")
                        orderby item.When descending
                        select item).Skip(skip).Take(maxCount);
            }
            else
            {
                return (from item in db.JournalItems
                        where item.Wherewith == path || item.Wherewith.StartsWith(path + "/")
                        select item).Skip(skip).Take(maxCount);
            }
        }