Exemplo n.º 1
0
                                                                  public async Task create(SeguimientoOportunidad seguimientonON)
                                                                  {
                                                                      try
                                                                      {
                                                                          _db.SeguimientoOportunidad.Add(seguimientonON);
                                                                          await _db.SaveChangesAsync();

//Dispose();
                                                                      }
                                                                      catch (Exception e)
                                                                      {
                                                                          throw new Exception(e.Message, e);
                                                                      }
                                                                  }
Exemplo n.º 2
0
                                                                  public async Task update(SeguimientoOportunidad seguimientoON)
                                                                  {
                                                                      try
                                                                      {
                                                                          var _seguimiento = await _db.SeguimientoOportunidad
                                                                                             .FirstOrDefaultAsync(t => t.SeguimientoOportunidadId == seguimientoON.SeguimientoOportunidadId);

                                                                          if (_seguimiento != null)
                                                                          {
                                                                              _db.Entry(_seguimiento).CurrentValues.SetValues(seguimientoON);
                                                                              await _db.SaveChangesAsync();

//Dispose();
                                                                          }
                                                                          else
                                                                          {
//Dispose();
                                                                          }
                                                                      }
                                                                      catch (Exception e)
                                                                      {
                                                                          throw new Exception(e.Message, e);
                                                                      }
                                                                  }
Exemplo n.º 3
0
                                                                    public async Task <IHttpActionResult> Update(SeguimientoOportunidad seguimientoON)
                                                                    {
                                                                        try { log.Info(new MDCSet(this.ControllerContext.RouteData));
                                                                              await _seguimientoRepo.update(seguimientoON);

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