public async Task <IActionResult> Delete(OperadorEmpresaDto.RQDelete oItem) { try { var oUserInfo = await this._jwtApplication.GetUserInfo(User); if (!oUserInfo.IsSuccess) { return(Ok(oUserInfo)); } oItem.nIdSession = int.Parse(oUserInfo.Data.sIdSession); oItem.sUsuario = oUserInfo.Data.sUsername; var oResult = await this._operadorEmpresaApplication.Delete(oItem); return(Ok(oResult)); } catch (Exception ex) { _ = this._logApplication.SetLog(EnumLogType.TEXT_N_EMAIL, EnumLogCategory.ERROR, "OperadorEmpresa-Delete", ex, oItem); return(Ok(new Response <string> { Message = "ERR-Fallo en el servidor" })); } }
public async Task <Response <int> > Delete(OperadorEmpresaDto.RQDelete input) { try { var responseDelete = new Response <int>(); var modelReq = this._mapper.Map <TM_OPERADOR_EMPRESA>(input); var result = await this._operadorEmpresaDomain.Delete(modelReq); var nestadoProceso = Int32.Parse(result.STR_ESTADOPROCESO); if (nestadoProceso == 1) { responseDelete.IsSuccess = true; responseDelete.Data = result.NUM_IDNOMINAXEMP.Value; responseDelete.Message = result.STR_MENSAJE; } else if (nestadoProceso > 1) { responseDelete.Message = result.STR_MENSAJE; } else if (nestadoProceso == 0) { throw new Exception(result.STR_MENSAJE); } return(responseDelete); } catch (Exception ex) { throw ex; } }