public ActionResult Delete(Guid id, ViewModels.Events.EventTagViewModel viewModel) { Common.Models.Account.Users currentUser; Common.Models.Events.EventTag model; currentUser = Data.Account.Users.Get(User.Identity.Name); model = Mapper.Map <Common.Models.Events.EventTag>(viewModel); model = Data.Events.EventTag.Disable(model, currentUser); return(RedirectToAction("Tags", "Events", new { Id = model.Event.Id.Value.ToString() })); }
public ActionResult Tags(Guid id) { List <ViewModels.Events.EventTagViewModel> list; list = new List <ViewModels.Events.EventTagViewModel>(); Data.Events.EventTag.ListForEvent(id).ForEach(x => { ViewModels.Events.EventTagViewModel vm = Mapper.Map <ViewModels.Events.EventTagViewModel>(x); list.Add(vm); }); return(View(list)); }
public ActionResult Edit(Guid id, ViewModels.Events.EventTagViewModel viewModel) { Common.Models.Account.Users currentUser; Common.Models.Events.EventTag model; currentUser = Data.Account.Users.Get(User.Identity.Name); model = Mapper.Map <Common.Models.Events.EventTag>(viewModel); model.TagCategory = Mapper.Map <Common.Models.Tagging.TagCategory>(viewModel.TagCategory); model.Event = Data.Events.EventTag.Get(id).Event; model = Data.Events.EventTag.Edit(model, currentUser); return(RedirectToAction("Tags", "Events", new { Id = model.Event.Id.Value.ToString() })); }
public ActionResult Create(ViewModels.Events.EventTagViewModel viewModel) { Common.Models.Account.Users currentUser; Common.Models.Events.EventTag model; currentUser = Data.Account.Users.Get(User.Identity.Name); model = Mapper.Map <Common.Models.Events.EventTag>(viewModel); model.Event = new Common.Models.Events.Event() { Id = Guid.Parse(RouteData.Values["Id"].ToString()) }; model.TagCategory = Mapper.Map <Common.Models.Tagging.TagCategory>(viewModel.TagCategory); model = Data.Events.EventTag.Create(model, currentUser); return(RedirectToAction("Tags", "Events", new { Id = model.Event.Id.Value.ToString() })); }