public ActionResult UpsertBeautyServiceCodeTypeConfig(BeautyServiceCodeTypeConfig config)
        {
            var isSuccess = false;
            var msg       = "";

            if (config != null && !string.IsNullOrEmpty(config.PID) && !string.IsNullOrEmpty(config.Name))
            {
                config.PID = config.PID.Trim();
                var product        = BeautyProductManager.GetBeautyProductByPid(config.PID);
                var vipCategoryIds = BeautyProductManager.GetBeautyChildAndSelfCategoryIdsByCategoryId(67);
                if (product != null && vipCategoryIds != null && vipCategoryIds.Contains(product.CategoryId))
                {
                    isSuccess = config.PKID > 0 ? BeautyServicePackageManager.UpdateBeautyServiceCodeTypeConfig(config)
                                        : BeautyServicePackageManager.InsertBeautyServiceCodeTypeConfig(config);
                    msg = isSuccess ? "插入成功" : "更新失败";
                }
                else
                {
                    msg = "产品PID不正确";
                }
            }
            else
            {
                msg = "数据不完善";
            }

            return(Json(new { IsSuccess = isSuccess, Msg = msg }, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        /// <summary>
        /// 更新服务码配置
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        public static bool UpdateBeautyServiceCodeTypeConfig(BeautyServiceCodeTypeConfig config)
        {
            bool result = false;

            try
            {
                result = BeautyServicePackageDal.UpdateBeautyServiceCodeTypeConfig(config);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message, ex);
            };

            return(result);
        }