public ActionResult EditFS(string fsmodel)
 {
     try
     {
         FlashSaleModel model = (FlashSaleModel)JsonConvert.DeserializeObject(fsmodel, typeof(FlashSaleModel));
         if (Convert.ToDateTime(model.BeginDate) > Convert.ToDateTime(model.EndDate))
         {
             return(Json(new Result {
                 msg = "开始时间不能大于结束时间!", success = false
             }));
         }
         model.ShopId = CurrentSellerManager.ShopId;
         if (SiteSettingApplication.SiteSettings.LimitTimeBuyNeedAuditing)
         {
             model.Status = FlashSaleInfo.FlashSaleStatus.WaitForAuditing;
         }
         _iLimitTimeBuyService.UpdateFlashSale(model);
         ProductManagerApplication.SaveCaculateMinPrice(model.ProductId, CurrentShop.Id);
         //delete-pengjiangxiong
         //foreach (var d in model.Details)
         //{
         //    LimitOrderHelper.ModifyLimitStock(d.SkuId, d.TotalCount, DateTime.Parse(model.EndDate));
         //}
         return(Json(new Result {
             msg = "修改活动成功!", success = true
         }));
     }
     catch (Exception ex)
     {
         return(Json(new Result {
             msg = ex.Message, success = false
         }));
     }
 }
Beispiel #2
0
 public ActionResult EditFS(string fsmodel)
 {
     try
     {
         FlashSaleModel model = (FlashSaleModel)JsonConvert.DeserializeObject(fsmodel, typeof(FlashSaleModel));
         if (Convert.ToDateTime(model.BeginDate) > Convert.ToDateTime(model.EndDate))
         {
             return(Json(new Result {
                 msg = "开始时间不能大于结束时间!", success = false
             }));
         }
         model.ShopId = CurrentSellerManager.ShopId;
         _iLimitTimeBuyService.UpdateFlashSale(model);
         foreach (var d in model.Details)
         {
             LimitOrderHelper.ModifyLimitStock(d.SkuId, d.Stock, DateTime.Parse(model.EndDate));
         }
         return(Json(new Result {
             msg = "添加活动成功!", success = true
         }));
     }
     catch (Exception ex)
     {
         return(Json(new Result {
             msg = ex.Message, success = false
         }));
     }
 }