Ejemplo n.º 1
0
 //Crear Beca interna
 public async Task Create(BecaInterna BecaInterna)
 {
     try
     {
         _ctx.BecaInterna.Add(BecaInterna);
         await _ctx.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message, e);
     }
 }
Ejemplo n.º 2
0
                                                       //Actualizar Beca interna
                                                       public async Task Update(BecaInterna BecaInterna)
                                                       {
                                                           try
                                                           {
                                                               var _BecaInterna = await _ctx.BecaInterna.FirstOrDefaultAsync(e => e.BecaInternaId == BecaInterna.BecaInternaId);

                                                               if (_BecaInterna != null)
                                                               {
                                                                   _BecaInterna.Descripcion      = BecaInterna.Descripcion;
                                                                   _BecaInterna.DescripcionCorta = BecaInterna.DescripcionCorta;

                                                                   await _ctx.SaveChangesAsync();
                                                               }
                                                           }
                                                           catch (Exception e)
                                                           {
                                                               throw new Exception(e.Message, e);
                                                           }
                                                       }
Ejemplo n.º 3
0
                                                         public async Task <IHttpActionResult> UpdateEstado(BecaInterna BecaInterna)
                                                         {
                                                             try { log.Info(new MDCSet(this.ControllerContext.RouteData));
                                                                   await _BecaInternaRepo.UpdateEstado(BecaInterna);

                                                                   return(Ok()); }
                                                             catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e);

                                                                                   return(InternalServerError(e)); }
                                                         }
Ejemplo n.º 4
0
                                                         public async Task <IHttpActionResult> Update(BecaInterna BecaInterna)
                                                         {
                                                             try { log.Info(new MDCSet(this.ControllerContext.RouteData));
                                                                   await _BecaInternaRepo.Update(BecaInterna);

                                                                   return(Ok("Registro actualizado correctamente!")); }
                                                             catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e);

                                                                                   return(InternalServerError(e)); }
                                                         }