示例#1
0
        public ActionResult Delete(Guid id, ViewModels.Tasks.TaskTagViewModel viewModel)
        {
            Common.Models.Account.Users currentUser;
            Common.Models.Tasks.TaskTag model;

            currentUser = Data.Account.Users.Get(User.Identity.Name);

            model = Mapper.Map <Common.Models.Tasks.TaskTag>(viewModel);

            model = Data.Tasks.TaskTag.Disable(model, currentUser);

            return(RedirectToAction("Tags", "Tasks", new { Id = model.Task.Id.Value.ToString() }));
        }
示例#2
0
        public ActionResult Edit(Guid id, ViewModels.Tasks.TaskTagViewModel viewModel)
        {
            Common.Models.Account.Users currentUser;
            Common.Models.Tasks.TaskTag model;

            currentUser = Data.Account.Users.Get(User.Identity.Name);

            model             = Mapper.Map <Common.Models.Tasks.TaskTag>(viewModel);
            model.TagCategory = Mapper.Map <Common.Models.Tagging.TagCategory>(viewModel.TagCategory);
            model.Task        = Data.Tasks.TaskTag.Get(id).Task;

            model = Data.Tasks.TaskTag.Edit(model, currentUser);

            return(RedirectToAction("Tags", "Tasks", new { Id = model.Task.Id.Value.ToString() }));
        }
示例#3
0
        public ActionResult Create(ViewModels.Tasks.TaskTagViewModel viewModel)
        {
            Common.Models.Account.Users currentUser;
            Common.Models.Tasks.TaskTag model;

            currentUser = Data.Account.Users.Get(User.Identity.Name);

            model = Mapper.Map <Common.Models.Tasks.TaskTag>(viewModel);

            model.Task = new Common.Models.Tasks.Task()
            {
                Id = long.Parse(RouteData.Values["Id"].ToString())
            };

            model.TagCategory = Mapper.Map <Common.Models.Tagging.TagCategory>(viewModel.TagCategory);

            model = Data.Tasks.TaskTag.Create(model, currentUser);

            return(RedirectToAction("Tags", "Tasks", new { Id = model.Task.Id.Value.ToString() }));
        }