Пример #1
0
        public ActionResult Edit(GlCategoryManagement category)
        {
            if (category.Id == 0)
            {
                _category.Save(category);
            }
            else
            {
                var categoryInDb = _category.Get(category.Id);
                var getGlCat     = _glAccount.GetCatName(categoryInDb.Name);
                var glAccount    = _glAccount.Get(getGlCat.Id);
                categoryInDb.Name              = Request.Form["catName"];
                categoryInDb.Description       = Request.Form["catDescription"];
                glAccount.CategoryManagementId = categoryInDb.Name;

                _category.Update(category);
                _glAccount.Update(glAccount);
            }

            return(RedirectToAction("Index", "GlCategoryManagement"));
        }