Exemplo n.º 1
0
 public ActionResult SaveBatchEdit(string models)
 {
     models = models.Replace("\"pid\":\"\"", "'pid':0");
     try
     {
         var items = JsonConvert.DeserializeObject <Flh.Business.Data.Product[]>(models);
         foreach (var item in items)
         {
             if (item.pid > 0)
             {
                 item.updater = CurrentUser.Uid;
             }
             else
             {
                 item.createUid = CurrentUser.Uid;
             }
         }
         _ProductManager.AddOrUpdateProducts(items);
         return(SuccessJsonResult());
     }
     catch (ArgumentException ex)
     {
         return(JsonResult(ErrorCode.ArgError, ex.Message));
     }
 }