示例#1
0
        /// <summary>
        /// 支付方式添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <R> CreateAsync(PaymentSetting entity, CurrentUser currentUser)
        {
            entity.Id          = entity.CreateId();
            entity.CreatorTime = DateTime.Now;

            var r = await _paymentSettingRep.InsertAsync(entity);

            if (r != 1)
            {
                return(R.Err("添加失败"));
            }

            if (currentUser != null)
            {
                await _operateLogApp.InsertAsync <PaymentSetting>(currentUser, "添加支付方式", entity);
            }

            return(R.Suc(entity));
        }