Exemplo n.º 1
0
 public EventWrapper(ASC.Web.Community.News.Code.Feed feed)
 {
     Id=feed.Id;
     Title=feed.Caption;
     Updated = Created=(ApiDateTime) feed.Date;
     Type =feed.FeedType;
     CreatedBy = EmployeeWraper.Get(Core.CoreContext.UserManager.GetUsers(new Guid(feed.Creator)));
 }
Exemplo n.º 2
0
 public CommentWrapper(Comment comment)
 {
     ParentId = comment.Parent;
     Text=comment.Content;
     Id=comment.ID;
     Updated = Created=(ApiDateTime) comment.CreateOn;
     
     CreatedBy = EmployeeWraper.Get(comment.CreateBy);
 }
Exemplo n.º 3
0
        public PhotoEventWrapper(Event @event)
        {
            Id = @event.Id;
            Title = @event.Name;
            Updated = Created = (ApiDateTime)@event.Timestamp;

            Author = EmployeeWraper.Get(Core.CoreContext.UserManager.GetUsers(new Guid(@event.UserID)));
            Description = @event.Description;
        }
Exemplo n.º 4
0
 public ForumThreadWrapper(Thread thread)
 {
     Id = thread.ID;
     Title = thread.Title;
     Description = thread.Description;
     Created = (ApiDateTime)thread.RecentTopicCreateDate;
     Updated = (ApiDateTime)thread.RecentPostCreateDate;
     RecentTopicTitle = thread.RecentTopicTitle;
     UpdatedBy = EmployeeWraper.Get(thread.RecentPosterID);
 }
Exemplo n.º 5
0
 public BookmarkWrapper(Bookmark bookmark)
 {
     Id=bookmark.ID;
     CreatedBy = EmployeeWraper.Get(Core.CoreContext.UserManager.GetUsers(bookmark.UserCreatorID)); 
     Title = bookmark.Name;
     Url = bookmark.URL;
     Description = bookmark.Description;
     Updated = Created = (ApiDateTime) bookmark.Date;
     Thumbnail = ThumbnailHelper.Instance.GetThumbnailUrl(bookmark.URL, BookmarkingSettings.ThumbSmallSize);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="entry"></param>
 protected FileEntryWrapper(FileEntry entry)
 {
     Id = entry.ID;
     Title = entry.Title;
     Access = entry.Access;
     SharedByMe = entry.SharedByMe;
     Created = (ApiDateTime)entry.CreateOn;
     CreatedBy = EmployeeWraper.Get(entry.CreateBy);
     Updated = (ApiDateTime)entry.ModifiedOn;
     UpdatedBy = EmployeeWraper.Get(entry.ModifiedBy);
     RootFolderType = entry.RootFolderType;
 }
Exemplo n.º 7
0
        public EventWrapper(Event @event)
        {
            Created = (ApiDateTime) @event.CreateOn;
            CreatedBy = EmployeeWraper.Get(@event.CreateBy);
            Updated = (ApiDateTime) @event.LastModifiedOn;

            if (@event.CreateBy != @event.LastModifiedBy)
                UpdatedBy = EmployeeWraper.Get(@event.LastModifiedBy);
            Id = @event.ID;
            Desription = @event.Description;
            Title = @event.Title;
            ProjectId = @event.Project.ID;
            From = (ApiDateTime) @event.FromDate;
            To = (ApiDateTime) @event.ToDate;
        }
Exemplo n.º 8
0
 ///<summary>
 ///</summary>
 ///<param name="group"></param>
 ///<param name="includeMembers"></param>
 public GroupWrapperFull(GroupInfo group, bool includeMembers)
 {
     Id          = group.ID;
     Category    = group.CategoryID;
     Parent      = group.Parent != null?group.Parent.ID:Guid.Empty;
     Name        = group.Name;
     Description = group.Description;
     Manager     = EmployeeWraper.Get(Core.CoreContext.UserManager.GetUsers(Core.CoreContext.UserManager.GetDepartmentManager(group.ID)));
     if (includeMembers)
     {
         Members = new List <EmployeeWraper>(Core.CoreContext.UserManager.GetUsersByGroup(group.ID).Select(x => EmployeeWraper.Get(x)));
     }
 }
Exemplo n.º 9
0
 ///<summary>
 ///</summary>
 ///<param name="userInfo"></param>
 ///<returns></returns>
 /// NOTE: static methods is a hell!!!
 public static EmployeeWraper Get(UserInfo userInfo)
 {
     EmployeeWraper employeeWraper;
     try
     {
         var cacheManager = ServiceLocator.Current.GetInstance<ICacheManager>();
         if (cacheManager != null)
         {
             employeeWraper = (EmployeeWraper)cacheManager[userInfo.ID.ToString()];
             if (employeeWraper == null)
             {
                 employeeWraper = new EmployeeWraper(userInfo);
                 cacheManager.Add(userInfo.ID.ToString(), employeeWraper, CacheItemPriority.Normal, null, new SlidingTime(TimeSpan.FromMinutes(1)));
             }
         }
         else
         {
             employeeWraper = new EmployeeWraper(userInfo);
         }
     }
     catch (NullReferenceException)
     {
         //Service locator is'n configured
         employeeWraper = new EmployeeWraper(userInfo);
     }
     return employeeWraper;
 }