Ejemplo n.º 1
0
        public ActionResult Find(ReleaseEventFindResultContract model, string query, string EventTarget)
        {
            bool skipSeries = false;

            if (EventTarget != "Series")
            {
                skipSeries = true;

                if (string.IsNullOrEmpty(model.EventName))
                {
                    ModelState.AddModelError("EventName", "Name must be specified");
                }
            }

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var contract = new ReleaseEventDetailsContract {
                Name         = model.EventName,
                Series       = (skipSeries ? null : model.Series),
                SeriesNumber = model.SeriesNumber,
                SeriesSuffix = string.Empty                     // TODO: add support for entering this
            };

            var ev = queries.Update(contract);

            return(RedirectToAction("Edit", new { id = ev.Id }));
        }
Ejemplo n.º 2
0
        public ActionResult Find(ReleaseEventFindResultContract model, string query, string EventTarget)
        {
            bool skipSeries = false;

            if (EventTarget != "Series")
            {
                skipSeries = true;

                if (string.IsNullOrEmpty(model.EventName))
                {
                    ModelState.AddModelError("EventName", "Name must be specified");
                }
            }

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var contract = new ReleaseEventDetailsContract {
                Name = model.EventName, Series = (skipSeries ? null : model.Series), SeriesNumber = model.SeriesNumber
            };

            var ev = Service.UpdateEvent(contract);

            if (query != ev.Name)
            {
                Services.Albums.UpdateAllReleaseEventNames(query, ev.Name);
            }

            return(RedirectToAction("Edit", new { id = ev.Id }));
        }
Ejemplo n.º 3
0
 private void AreEqual(ReleaseEvent expected, ReleaseEventFindResultContract actual)
 {
     actual.Should().NotBeNull("Result");
     actual.EventName.Should().Be(expected.DefaultName, "EventName");
     actual.EventId.Should().Be(expected.Id, "EventId");
 }
Ejemplo n.º 4
0
 private void AreEqual(ReleaseEvent expected, ReleaseEventFindResultContract actual)
 {
     Assert.IsNotNull(actual, "Result");
     Assert.AreEqual(expected.Name, actual.EventName, "EventName");
     Assert.AreEqual(expected.Id, actual.EventId, "EventId");
 }