コード例 #1
0
        /// <summary>
        /// 修改活动信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static async Task <OperationResult <bool> > UpdateActivityAsync(SalePromotionActivityModel model)
        {
            OperationResult <bool> result;
            //检查名称重复
            var is_repeat = await DalSalePromotionActivity.CheckNameRepeatAsync(model.Name, model.ActivityId);

            if (!is_repeat)
            {
                return(OperationResult.FromError <bool>("1", "活动名称已存在"));
            }
            else
            {
                var updateResult = await DalSalePromotionActivity.UpdateActivityAsync(model);

                if (!updateResult)
                {
                    result = OperationResult.FromResult(false);
                }
                else
                {
                    result = OperationResult.FromResult(true);
                }
            }
            return(result);
        }