Ejemplo n.º 1
0
 public TagItemView(TagItemViewModel viewModel)
 {
     InitializeComponent();
     Size       = new Size(80, 20);
     _viewModel = viewModel;
     SetupBindings();
 }
Ejemplo n.º 2
0
        private TagItemView CreateTagItemView(Tag tag)
        {
            var tagItemViewModel = new TagItemViewModel {
                ParentViewModel = _viewModel
            };
            var tagButton = new TagItemView(tagItemViewModel)
            {
                Tag = tag
            };

            return(tagButton);
        }
Ejemplo n.º 3
0
        public ActionResult DeleteTag(TagItemViewModel tag)
        {
            bool success = GetCommand <DeleteTagCommand>().ExecuteCommand(
                new DeleteTagCommandRequest
            {
                TagId   = tag.Id,
                Version = tag.Version
            });

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

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

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