コード例 #1
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;
        }
コード例 #2
0
        public void SaveEvent(Event ev)
        {
            CommunitySecurity.DemandPermissions(PhotoConst.Action_AddEvent);

            if (ev == null) throw new ArgumentNullException("event");

            ev.Id = DbManager.ExecuteScalar<long>(
                Insert("photo_event")
                .InColumns(Mappers.EventColumns)
                .Values(ev.Id, ev.Name, ev.Description, ev.UserID, PrepareTimestamp(ev.Timestamp))
                .Identity<long>(1, 0, true)
            );

            var subscriber = NotifySource.GetSubscriptionProvider();
            subscriber.Subscribe(PhotoConst.NewEventComment, ev.Id.ToString(), NotifySource.GetRecipientsProvider().GetRecipient(SecurityContext.CurrentAccount.ID.ToString()));
        }
コード例 #3
0
        private void LoadAlbumsLinks(Event Event)
        {
            var sb = new StringBuilder();

            albumsContainer.Title = PhotoManagerResource.OtherAlbums;
            albumsContainer.HeaderCSSClass = "studioSideBoxTagCloudHeader";
            albumsContainer.ImageURL = WebImageSupplier.GetAbsoluteWebPath("photo_albums.png", PhotoConst.ModuleID);

            foreach (var album in StorageFactory.GetStorage().GetAlbums(Event.Id, null))
            {
                var caption = string.IsNullOrEmpty(album.Caption) ? DisplayUserSettings.GetFullUserName(new Guid(album.UserID)) : album.Caption.HtmlEncode();

                sb.Append("<div style=\"margin-top: 10px;padding-left:20px;word-wrap: break-word;\">");
                sb.Append("<a class=\"linkAction\" href=\"" + PhotoConst.PAGE_PHOTO + "?" + PhotoConst.PARAM_ALBUM + "=" + album.Id + "\">" + caption + "</a>");
                sb.Append("</div>");
            }

            ltrAlbums.Text = sb.ToString();

        }
コード例 #4
0
        public string CreateEvent(string name, string description, string dateTime)
        {
            CommunitySecurity.DemandPermissions(PhotoConst.Action_AddEvent);

            var storage = StorageFactory.GetStorage();

            DateTime date;
            DateTime.TryParse(dateTime, out date);

            var item = new Event
                           {
                               Name = GetLimitedText(name),
                               Description = GetLimitedText(description),
                               Timestamp = date,
                               UserID = SecurityContext.CurrentAccount.ID.ToString()
                           };

            storage.SaveEvent(item);

            return "<option value=\"" + item.Id.ToString() + "\" onclick=\"javascript:PhotoManager.LoadEvent(" + item.Id.ToString() + ");\">" + HttpUtility.HtmlEncode(item.Name) + "</option>";
        }