public ActionResult Delete(int id) { var service = new MeaningService(); var model = service.GetMeaningById(id); return(View(model)); }
//Get Edit public ActionResult MeaningEdit(int id) { var service = new MeaningService(); var detail = service.GetMeaningById(id); return(View(detail)); }
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)); }
// GET: Meaning public ActionResult Index() { var service = new MeaningService(); var model = service.GetAllMeanings(); return(View(model)); }
public ActionResult DeleteMeaningWId(int id) { var service = new MeaningService(); service.DeleteMeaning(id); return(RedirectToAction("Index")); }
public ActionResult DeleteMeaning(int id) { var service = new MeaningService(); var meaningToDelete = service.GetMeaningById(id); return(View(meaningToDelete)); }
public ActionResult EditMeaning(MeaningListItem oldMeaning) { var service = new MeaningService(); var update = service.UpdateMeaning(oldMeaning); return(RedirectToAction("Index")); }
public ActionResult EditMeaning(int id) { var service = new MeaningService(); var oldMeaning = service.GetMeaningById(id); return(View(oldMeaning)); }
public ActionResult CreateRating(int id, RatingCreate ratingModel) { var serviceRating = new RatingService(); var serviceMeaning = new MeaningService(); var meaning = serviceMeaning.GetMeaningById(id); serviceRating.CreateRating(id, ratingModel); return(RedirectToAction("DisplayComments", "Word", new { id = meaning.MeaningId })); }
public ActionResult CreateRating(int id) { var service = new MeaningService(); var model = service.GetMeaningById(id); var rating = new RatingCreate() { MeaningId = model.MeaningId, }; return(View(rating)); }
public ActionResult Create(MeaningCreate model) { if (!ModelState.IsValid) { return(View(model)); } var service = new MeaningService(); //service.CreateMeaning(model); return(RedirectToAction("index")); }
public ActionResult DeleteMeaning(int id) { if (!ModelState.IsValid) { return(View()); } var service = new MeaningService(); service.DeleteMeaning(id); TempData["SaveResult"] = "Your note was deleted"; return(RedirectToAction("Index")); }
public ActionResult CreateMeaning(int id, MeaningCreate model) { if (!ModelState.IsValid) { return(View(model)); } //if(is null) // { return View(model); } var serviceMeaning = new MeaningService(); var serviceWord = new WordService(); var word = serviceWord.GetWordById(id); serviceMeaning.CreateMeaning(word, model); return(RedirectToAction("Details", "Word", new { id = word.WordId })); }