예제 #1
0
        // GET: Talks/Delete/5
        public ActionResult Delete(int id)
        {
            var            talkToDelete = talkService.GetTalkById(id);
            TalksViewModel model        = new TalksViewModel();

            model.InjectFrom(talkToDelete);
            return(View(model));
        }
예제 #2
0
        // GET: Talks/Details/5
        public ActionResult Details(int id)
        {
            Talks          talk  = talkService.GetTalkById(id);
            TalksViewModel model = new TalksViewModel();

            model.InjectFrom(talk);
            return(View(talk));
        }
        // GET: Talks/Details/5
        public ActionResult Details(int id)
        {
            var            getTalkById = talksService.GetTalksById(id);
            TalksViewModel model       = new TalksViewModel();

            model.InjectFrom(getTalkById);

            return(View(model));
        }
예제 #4
0
        public ActionResult Delete(int id, TalksViewModel model)
        {
            Talks talkToDelete = new Talks();

            talkToDelete = talkService.GetTalkById(id);
            model.InjectFrom(talkToDelete);
            talkService.Delete(talkToDelete);
            talkService.Save();
            return(RedirectToAction(nameof(Index)));
        }
        // GET: Talks/Delete/5
        public ActionResult Delete(int id)
        {
            var deleteTalk = talksService.GetTalksById(id);

            TalksViewModel model = new TalksViewModel();

            model.InjectFrom(deleteTalk);

            return(View(model));
        }
        public ActionResult Delete(int id, TalksViewModel model)
        {
            Talks deleteTalk = new Talks();

            deleteTalk = talksService.GetTalksById(id);

            model.InjectFrom(deleteTalk);

            talksService.DeleteATalk(deleteTalk);

            return(RedirectToAction(nameof(Index)));
        }