public static string SaveChartOfAccountValue(AccountValueViewModel model)
 {
     if (model.Id > 0)
     {
         return(service.Update(getEntityByModel(model)));
     }
     else
     {
         return(service.Insert(getEntityByModel(model)));
     }
 }
        public ActionResult Edit(AccountValueViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (model.Id > 0)
                {
                    string result = service.Update(mapModel(model));
                    return(RedirectToAction("Index"));
                }
                else
                {
                    string result = service.Insert(mapModel(model));
                    return(RedirectToAction("Index"));
                }
            }

            return(View(model));
        }