Ejemplo n.º 1
0
        public ActionResult Create()
        {
            var listGrammar           = this.m_grammarEditService.GetListGrammar();
            AddGrammarViewModel model = new AddGrammarViewModel(listGrammar);

            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult Create(AddGrammarViewModel model)
        {
            // Create grammar
            GrammarArticle article = EntityFactory
                                     .CreateGrammarArticle(model.Article.TitleInVietnamese, model.Article.TitleInEnglish,
                                                           model.Article.Alias,
                                                           model.Article.TextInVietnamese, model.Article.TextInEnglish,
                                                           model.Article.ParentId, model.Article.IsLeaf);

            this.m_grammarEditService.InsertGrammar(article);
            return(RedirectToAction("Index", "GrammarAdmin", new { area = "Assmin" }));
        }
Ejemplo n.º 3
0
 public ActionResult Edit(AddGrammarViewModel model)
 {
     // update
     this.m_grammarEditService.EditGrammar(model.Article);
     return(RedirectToAction("Index", "GrammarAdmin", new { area = "Assmin" }));
 }