Beispiel #1
0
        public ActionResult Edit(int?id, int?seriesId)
        {
            if (id != null)
            {
                CheckConcurrentEdit(EntryType.ReleaseEvent, id.Value);
            }

            var model = (id != null ? new EventEdit(queries.GetEventForEdit(id.Value), PermissionContext)
                                : new EventEdit(seriesId != null ? Service.GetReleaseEventSeriesForEdit(seriesId.Value) : null, PermissionContext));

            return(View(model));
        }
        private ReleaseEventForEditContract Update(ReleaseEventForEditContract contract)
        {
            return(context.RunTest(repository => {
                var queries = new EventQueries(repository, entryLinkFactory, userContext, imageStore, userIconFactory, enumTranslations, mailer);

                var updated = queries.Update(contract, null);

                return queries.GetEventForEdit(updated.Id);
            }));
        }
        private ReleaseEventForEditContract Update(ReleaseEventForEditContract contract)
        {
            return(context.RunTest(repository => {
                var queries = new EventQueries(repository, entryLinkFactory, userContext, imageStore, userIconFactory, enumTranslations, mailer,
                                               new FollowedArtistNotifier(new FakeEntryLinkFactory(), new FakeUserMessageMailer(), new EnumTranslations(), new EntrySubTypeNameFactory()));

                var updated = queries.Update(contract, null);

                return queries.GetEventForEdit(updated.Id);
            }));
        }