Esempio n. 1
0
        //Create
        public bool Create(TagViewCreateModel model)
        {
            var tag = new Tag
            {
                UserId      = model.UserId,
                Name        = model.Name,
                Description = model.Description
            };

            tag = tagRepo.Create(tag);
            return(tag.Id != 0);
        }
Esempio n. 2
0
        public ActionResult Create(TagViewCreateModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            model.UserId = Guid.Parse(User.Identity.GetUserId());

            if (TagService.Create(model))
            {
                TempData["SaveResult"] = "Your tag was created.";
                return(RedirectToAction("Index"));
            }
            ;
            ModelState.AddModelError("", "Tag could not be created.");
            return(View(model));
        }
Esempio n. 3
0
        //GET
        public ActionResult Create()
        {
            TagViewCreateModel model = new TagViewCreateModel();

            return(View(model));
        }