public async Task <IHttpActionResult> GetJustificacionSolicitud(BitacoraSolicitudesGI id) { try { log.Info(new MDCSet(this.ControllerContext.RouteData)); var estado = await _repository.GetJustificacionSolicitud(id); return(Ok(estado)); } catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e); return(InternalServerError(e)); } }
public async Task <IHttpActionResult> Create([FromBody] BitacoraSolicitudesGI Obj) { try { log.Info(new MDCSet(this.ControllerContext.RouteData)); var result = await _repository.Create(Obj); return(Ok(result)); } catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e); return(InternalServerError(e)); } }
public async Task <BitacoraSolicitudesGI> Create(BitacoraSolicitudesGI Obj) { try { DateTime hoy = DateTime.Now; Obj.FechaMovimiento = hoy; var result = _ctx.DbSetBitacoraSolicitudesGI.Add(Obj); await _ctx.SaveChangesAsync(); return(result); } catch (Exception e) { throw new Exception(e.Message, e); } }
public async Task <Object> GetJustificacionSolicitud(BitacoraSolicitudesGI model) { try { var entitie = await _ctx.DbSetBitacoraSolicitudesGI .Where(e => e.Descripcion.Contains(model.estadoOC) && e.Descripcion.Contains(model.nombreOC) && e.EstadoFlujoId == model.EstadoFlujoId && e.SolicitudId == (_ctx.DbSetSolicitudGI .Where(x => x.InformacionId == model.informacionId && x.TipoInformacionId == model.tipoInformacionOC) .Select(x => x.SolicitudId) .FirstOrDefault()) ) .OrderByDescending(e => e.FechaMovimiento).FirstOrDefaultAsync(); return(entitie); } catch (Exception e) { throw new Exception(e.Message, e); } }