Ejemplo n.º 1
0
 //Crear  nivel curso
 public async Task Create(NivelSNI NivelSNI)
 {
     try
     {
         _ctx.NivelSNI.Add(NivelSNI);
         await _ctx.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message, e);
     }
 }
Ejemplo n.º 2
0
                                                    //Actualizar nivel curso
                                                    public async Task UpdateEstado(NivelSNI NivelSNI)
                                                    {
                                                        try
                                                        {
                                                            var _NivelSNI = await _ctx.NivelSNI.FirstOrDefaultAsync(e => e.NivelSNIId == NivelSNI.NivelSNIId);

                                                            if (_NivelSNI != null)
                                                            {
                                                                _NivelSNI.Estado = NivelSNI.Estado;

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

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

                                                                                return(InternalServerError(e)); }
                                                      }
Ejemplo n.º 4
0
                                                      //crear nivel curso
                                                      [HttpPost][Authorize] public async Task <IHttpActionResult> Create(NivelSNI NivelSNI)
                                                      {
                                                          try { log.Info(new MDCSet(this.ControllerContext.RouteData));
                                                                await _nivelRepo.Create(NivelSNI);

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

                                                                                return(InternalServerError(e)); }
                                                      }