| | |
| | | entity.createBy = $"{_contextUser.Name}"; |
| | | return await _dal.InsertAsync(entity); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写异步插入方法 |
| | | /// </summary> |
| | | /// <param name="entity">实体数据</param> |
| | | /// <returns></returns> |
| | | public async Task<AdminUiCallBack> UserInsertAsync(OfflineDistributor entity) |
| | | { |
| | | entity.createTime = DateTime.Now; |
| | | entity.createBy = $"{_contextUser.Name}"; |
| | | var bol = await _unitOfWork.GetDbClient().InsertNav(entity).Include(x => x.meetings).ExecuteCommandAsync(); |
| | | if (bol) |
| | | { |
| | | return new AdminUiCallBack() |
| | | { |
| | | code = 0, |
| | | data = bol, |
| | | msg = "操作成功" |
| | | |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | |
| | | return new AdminUiCallBack() |
| | | { |
| | | code = 1, |
| | | data = bol, |
| | | msg = "操作失败" |
| | | |
| | | }; |
| | | |
| | | } |
| | | return await _dal.InsertAsync(entity); |
| | | } |
| | | public async Task<AdminUiCallBack> GetInfo(int id) |
| | | { |
| | | var data = await _unitOfWork.GetDbClient().Queryable<OfflineDistributor>().Where(x => x.Id == id) |
| | |
| | | return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |