Ejemplo n.º 1
0
        public ActionResult Smilies(SmileyViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (_smileyRepository.First(item => item.Code.ToLower() == model.Code.ToLower()) != null)
                {
                    ModelState.AddModelError("Code", "A smiley with this code already exists.");
                }
            }

            if (IsModelValidAndPersistErrors())
            {
                Smiley smiley = new Smiley()
                {
                    Code     = model.Code,
                    ImageURL = model.ImageURL,
                    Title    = model.Title
                };
                _smileyRepository.Add(smiley);
                SetSuccess("Smiley created");
            }

            return(RedirectToSelf());
        }
Ejemplo n.º 2
0
 private void LoadMoreSmilies(object sender, System.Windows.Input.GestureEventArgs e)
 {
     // TODO: Add event handler implementation here.
     SmileyViewModel.AppendNextPage();
 }