Example #1
0
        public ActionResult Edit(int id, MeaningListItem model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (model.MeaningId != id)
            {
                ModelState.AddModelError("", "Word is null");
                return(View(model));
            }

            var service = new MeaningService();



            if (service.UpdateMeaning(model))
            {
                TempData["SaveResult"] = "Your note was updated.";
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Your meaning could not be updated.");
            return(View(model));
        }
        public ActionResult EditMeaning(MeaningListItem oldMeaning)
        {
            var service = new MeaningService();
            var update  = service.UpdateMeaning(oldMeaning);

            return(RedirectToAction("Index"));
        }