Пример #1
0
 // GET: Phrase
 public ActionResult Index()
 {
     PhrasesListViewModel phListVM = new PhrasesListViewModel();
     PhraseHelper helper = new PhraseHelper();
     phListVM.Phrases = helper.GetPhrases();
     return View("ProblematicPhrases", phListVM);
 }
Пример #2
0
        public ActionResult Delete(int pID)
        {
            PhraseHelper helper = new PhraseHelper();
            helper.DeletePhraseByID(pID);
            
            Log.Logger = logger;
            Log.Information("Deleted phrase");

            PhrasesListViewModel phListVM = new PhrasesListViewModel();
            phListVM.Phrases = helper.GetPhrases();
            return View("ProblematicPhrases", phListVM);
        }
Пример #3
0
        public ActionResult Update(string phrase, int pID)
        {
            PhraseHelper helper = new PhraseHelper();
            Phrase p = new Phrase
            {
                phrase = phrase,
                PhraseID = pID
            };
            helper.UpdatePhrase(p);

            //ILogger logger = new LoggerConfiguration().WriteTo.File("c:\\logs\\logfile2.txt").CreateLogger();
            Log.Logger = logger;
            Log.Information("Updated phrase {phrase}", phrase);

            PhrasesListViewModel phListVM = new PhrasesListViewModel();            
            phListVM.Phrases = helper.GetPhrases();
            return View("ProblematicPhrases", phListVM);
        }