Example #1
0
        public async Task <ServiceResult <string> > add([FromBody] BillTypeDto billTypeDto)
        {
            var result = new ServiceResult <string>()
            {
                Result = string.Empty
            };

            billtype _billtype = this.mapper.Map <BillTypeDto, billtype>(billTypeDto, opt => opt.Items[Constant.mobilename] = base.UserMobile);

            bool bl = await this.Ibilltype.SaveAsync(_billtype);

            if (!bl)
            {
                result.IsFailed("保存失败");

                return(result);
            }

            return(result);
        }
Example #2
0
        public async Task <bool> SaveAsync(billtype _billtype)
        {
            var ids = await fsql.Insert(_billtype).ExecuteAffrowsAsync();

            return(ids > 0);
        }
Example #3
0
        public bool Save(billtype _billtype)
        {
            var ids = fsql.Insert(_billtype).ExecuteAffrows();

            return(ids > 0);
        }