public JsonResult AddClaimPosition(SpecificationPosition model)
 {
     var isComplete = false;
     try
     {
         var user = GetUser();
         model.State = 1;
         model.Author = user.Id;
         model.Currency = 1;
         var modelValid = true;
         if (string.IsNullOrEmpty(model.Name)) modelValid = false;
         if (modelValid)
         {
             var db = new DbEngine();
             isComplete = db.SaveSpecificationPosition(model);
             if (string.IsNullOrEmpty(model.CatalogNumber)) model.CatalogNumber = string.Empty;
             if (string.IsNullOrEmpty(model.Replace)) model.Replace = string.Empty;
             if (string.IsNullOrEmpty(model.Comment)) model.Comment = string.Empty;
         }
     }
     catch (Exception)
     {
         isComplete = false;
     }
     return Json(new { IsComplete = isComplete, Model = model });
 }
        public JsonResult AddClaimPositions(IEnumerable<SpecificationPosition> modelList)
        {
            var isComplete = modelList.Count()>0;
            try
            {
                var db = new DbEngine();
                foreach (var model in modelList)
                {
                    //updatec
                    isComplete = isComplete && db.SaveSpecificationPosition(model);
                }

            }
            catch (Exception)
            {

                isComplete = false;
            }
            return Json(new {IsComplete = isComplete, Positions = modelList},JsonRequestBehavior.AllowGet);
        }