Beispiel #1
0
        public ActionResult DeleteTag(TagItemViewModel tag)
        {
            bool success = GetCommand<DeleteTagCommand>().ExecuteCommand(
                new DeleteTagCommandRequest
                    {
                        TagId = tag.Id,
                        Version = tag.Version
                    });

            if (success)
            {
                Messages.AddSuccess(PagesGlobalization.DeleteTag_DeletedSuccessfully_Message);
            }

            return Json(new WireJson(success));
        }
Beispiel #2
0
        public ActionResult SaveTag(TagItemViewModel tag)
        {
            if (ModelState.IsValid)
            {
                var response = GetCommand<SaveTagCommand>().ExecuteCommand(tag);
                if (response != null)
                {
                    if (tag.Id.HasDefaultValue())
                    {
                        Messages.AddSuccess(PagesGlobalization.CreateTag_CreatedSuccessfully_Message);
                    }
                    return Json(new WireJson { Success = true, Data = response });
                }
            }

            return Json(new WireJson { Success = false });
        }