public ActionResult Edit(BeautyHomePageConfig model) { try { if (model.Id != 0) { if (BeautyHomePageConfigManager.UpdateBeautyHomePageConfig(model)) { CleanCahce(model.Channel, model.Type); } } else { int outId = 0; if (BeautyHomePageConfigManager.InsertBeautyHomePageConfig(model, ref outId)) { CleanCahce(model.Channel, model.Type); } } return(Json(true)); } catch (Exception ex) { return(Json(false)); throw ex; } }
public async Task <ActionResult> Edit(BeautyHomePageConfig model) { try { if (model.Id != 0) { if (BeautyHomePageConfigManager.UpdateBeautyHomePageConfig(model)) { CleanCahce(model.Channel, model.Type); } var beautyServiceProxy = new BeautyServiceProxy(); await beautyServiceProxy.RefreshModuleCacheAsync(model.Id); await beautyServiceProxy.RemoveCacheKeyAsync($"BeautyCategoriesPrefixV2-{model.Id}"); } else { int outId = 0; if (BeautyHomePageConfigManager.InsertBeautyHomePageConfig(model, ref outId)) { CleanCahce(model.Channel, model.Type); } } return(Json(true)); } catch (Exception ex) { return(Json(false)); throw ex; } }
public ActionResult EditShopConfig(BeautyHomePageConfig model) { var result = false; model.StartTime = DateTime.Now; model.EndTime = new DateTime(2999, 12, 31); model.Type = (short)(model.Type + 1000); if (model.Id != 0) { result = BeautyHomePageConfigManager.UpdateBeautyHomePageConfig(model); } else { int outId = 0; result = BeautyHomePageConfigManager.InsertBeautyHomePageConfig(model, ref outId); } return(Json(new { Status = result })); }