public async Task <ResponseMessage> DeleteStationInfo(UserInfo User, [FromBody] PositionInfoRequest position) { var pagingResponse = new ResponseMessage(); if (!ModelState.IsValid) { pagingResponse.Code = ResponseCodeDefines.ModelStateInvalid; Logger.Warn($"用户{User?.UserName ?? ""}({User?.Id ?? ""})查询人事条件(PostCustomerListSaleMan)模型验证失败:\r\n{pagingResponse.Message ?? ""},\r\n请求参数为:\r\n" + (position != null ? JsonHelper.ToJson(position) : "")); return(pagingResponse); } try { await _stationManage.DeleteStation(position, HttpContext.RequestAborted); pagingResponse.Message = "deletestation ok"; } catch (Exception e) { pagingResponse.Code = ResponseCodeDefines.ServiceError; pagingResponse.Message = "服务器错误:" + e.ToString(); Logger.Error($"用户{User?.UserName ?? ""}({User?.Id ?? ""})查询业务员条件(PostCustomerListSaleMan)请求失败:\r\n{pagingResponse.Message ?? ""},\r\n请求参数为:\r\n" + (position != null ? JsonHelper.ToJson(position) : "")); } return(pagingResponse); }
public virtual async Task DeleteStation(PositionInfoRequest departement, CancellationToken cancellationToken = default(CancellationToken)) { if (string.IsNullOrEmpty(departement.ID)) { throw new ArgumentNullException(nameof(departement)); } await _Store.DeleteStationAsync(_mapper.Map <PositionInfo>(departement), cancellationToken); }
public virtual async Task SetStation(PositionInfoRequest departmentid, CancellationToken cancellationToken = default(CancellationToken)) { if (departmentid == null) { throw new ArgumentNullException(nameof(departmentid)); } if (string.IsNullOrEmpty(departmentid.ID)) { departmentid.ID = Guid.NewGuid().ToString(); } await _Store.SetStationAsync(_mapper.Map <PositionInfo>(departmentid), cancellationToken); }