예제 #1
0
        // GET: Admin/MatchTheWords/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MatchTheWord matchTheWord = db.MatchTheWords.Find(id);

            if (matchTheWord == null)
            {
                return(HttpNotFound());
            }

            db.MatchTheWords.Remove(matchTheWord);
            db.SaveChanges();
            return(RedirectToAction("Create", "MatchTheWords", new { id = matchTheWord.BloqueId }));
        }
예제 #2
0
        // GET: Admin/MatchTheWords/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MatchTheWord matchTheWord = db.MatchTheWords.Find(id);

            if (matchTheWord == null)
            {
                return(HttpNotFound());
            }


            MatchTheWordEditViewModel viewModel = new MatchTheWordEditViewModel();

            viewModel.Inicializar(matchTheWord.BloqueId);
            viewModel.MatchTheWord = matchTheWord;
            return(View(viewModel));
        }