public async Task <Response <int> > Insert([FromBody] OperadorESDto.RQInsert input) { try { input.nIdSession = 0; input.sUsuario = ""; var oUserInfo = await this._jwtApplication.GetUserInfo(User); if (oUserInfo.IsSuccess) { input.nIdSession = Int32.Parse(oUserInfo.Data.sIdSession); input.sUsuario = oUserInfo.Data.sUsername; } // AGREGANDO LINEA DE CODIGO HASTA QUE DEFINAN COMO GUARDARAN LA FOTO QUE VIENE EN BASE 64 input.sFoto = ""; // END var responseInsert = new Response <int>(); return(await this._operadorESApplication.Insert(input)); } catch (Exception ex) { _ = this._logApplication.SetLog(EnumLogType.TEXT_N_EMAIL, EnumLogCategory.ERROR, "OperadorES-Insert", ex, input); return(new Response <int> { Message = "ERR-Fallo en el servidor" }); } }
public async Task <Response <int> > Insert(OperadorESDto.RQInsert input) { try { var responseInsert = new Response <int>(); var modelReq = this._mapper.Map <TM_OPERADOR_ES>(input); var result = await this._operadorESDomain.Insert(modelReq); var nestadoProceso = Int32.Parse(result.STR_ESTADOPROCESO); if (nestadoProceso == 1) { responseInsert.IsSuccess = true; responseInsert.Data = result.NUM_IDNOMINAXSUCURSAL.Value; responseInsert.Message = result.STR_MENSAJE; } else if (nestadoProceso > 1) { responseInsert.Message = result.STR_MENSAJE; } else if (nestadoProceso == 0) { throw new Exception(result.STR_MENSAJE); } return(responseInsert); } catch (Exception ex) { throw ex; } }