Beispiel #1
0
        public static void SeleccionarTradePerdedor(Action <IRestResponse> callback, General fechas)
        {
            try
            {
                var rest = new Rest(Local.Api.UrlApi, Resumen.Anual.TradeLoss, Method.POST);
                rest.Peticion.AddHeader(Constantes.Http.ObtenerTipoDeContenido, Constantes.Http.TipoDeContenido.Json);
                rest.Peticion.AddJsonBody(fechas);
                rest.Cliente.ExecuteAsync(rest.Peticion, response =>
                {
                    switch (response.StatusCode)
                    {
                    case HttpStatusCode.OK:
                        callback(response);
                        break;

                    default:
                        callback(null);
                        break;
                    }
                });
            }
            catch (Exception e)
            {
                Opcion.Log(Log.Interno.ResSemanal, "EXCEPCION: " + e.Message);
            }
        }
Beispiel #2
0
        public static void Guardar(Action <IRestResponse> callback, List <Guardar> guardar)
        {
            try
            {
                var rest = new Rest(Local.Api.UrlApi, Resumen.Semanal.GuardarResumen, Method.POST);
                rest.Peticion.AddHeader(Constantes.Http.ObtenerTipoDeContenido, Constantes.Http.TipoDeContenido.Json);
                rest.Peticion.AddJsonBody(guardar);
                rest.Cliente.ExecuteAsync(rest.Peticion, response =>
                {
                    switch (response.StatusCode)
                    {
                    case HttpStatusCode.OK:
                        callback(response);
                        break;

                    default:
                        throw new Exception(@"error al buscar articulo");
                    }
                });
            }
            catch (Exception e)
            {
                Opcion.Log(Log.Interno.ResMensual, "EXCEPCION: " + e.Message);
                // callback("CONTINUAR");
            }
        }
Beispiel #3
0
 public static void Consultar(Action <IRestResponse> callback)
 {
     try
     {
         var rest = new Rest(Externa.Api.UrlApi,
                             Externa.Sucursal.Seleccionar,
                             Method.POST,
                             callback,
                             new{ idGenerico = 1 }
                             );
     }
     catch (Exception e)
     {
         Opcion.Log(Log.Interno.Categoria, "EXCEPCION: " + e.Message);
         // callback("CONTINUAR");
     }
 }
 public static void Ajustar(Action <IRestResponse> callback, object parametros)
 {
     try
     {
         var rest = new Rest(Externa.Api.UrlApi,
                             Externa.AjusteInventario.Ajustar,
                             Method.POST,
                             callback,
                             parametros
                             );
     }
     catch (Exception e)
     {
         Opcion.Log(Log.Interno.Categoria, "EXCEPCION: " + e.Message);
         // callback("CONTINUAR");
     }
 }