Exemple #1
0
        public ActionResult CreateNew(int?parentId)
        {
            var artCatSrv = IoC.Resolve <IArticleCategoryService>();
            var model     = new ArcticleCategory();

            model.ParentId      = parentId;
            ViewData["Parents"] = artCatSrv.GetParents();
            return(View(model));
        }
Exemple #2
0
        public ActionResult Update(ArcticleCategory model)
        {
            var artCatSrv = IoC.Resolve <IArticleCategoryService>();

            try
            {
                model.UpdateBy   = CurrentInstance.Instance.CurrentUser.UserName;
                model.UpdateDate = DateTime.Now;
                model.URL        = "/" + UnsignToString(model.CatName);
                artCatSrv.Update(model);
                artCatSrv.CommitChange();
                AlertSuccess(InfoString.UPDATE_SUCCESSFULL);
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                LogError(ex);
                AlertError(InfoString.ERROR_SYSTEM);
                ViewData["Parents"] = artCatSrv.GetParents();
                return(View(model));
            }
        }
 public void Update(ArcticleCategory arcticleCat)
 {
     _artRp.Update(arcticleCat);
 }
 public void CreateNew(ArcticleCategory arcticleCat)
 {
     _artRp.CreateNew(arcticleCat);
 }