Example #1
0
        public bool SendReporte(ReporteSql rep)
        {
            try
            {
                Log.Info("Send Reporte","");
                var r = ServiceClient.Send<ResponseRegistroProgreso>(rep.GetRegistroProgreso());
                if (SaveReporte(rep) > 0)
                {
                    return true;
                }
            }
            catch (Exception ex)
            {
                Log.Error("SendReporte", ex.Message);
            }

            return false;
        }
Example #2
0
        private void EnvioReporte()
        {
            lockMethod(() => {

                ReporteSql rep = new ReporteSql();
                rep.Calorias = mCalories;
                rep.Pasos = contPasos - pasosUltimaActualizacion;
                rep.UserName = lr.User;
                rep.Fecha = DateTime.Now;
                rep.IdReto = lr.Reto.Id;

                if (rep.Pasos > 0)
                {
                    bool sw = false;
                    //if (rep.Pasos > 0)
                    if (isOnline())
                    {
                        sw = manager.SendReporte(rep);
                        if (sw)
                        {
                            pasosUltimaActualizacion = contPasos;
                            mCaloriesAnterior = mCalories;
                            Toast.MakeText(this, "Se ha Enviado Reporte", ToastLength.Long);
                        }

                        Log.Info("Envio Reporte", String.Format("Se ha enviado reporte de pasos al servidor " + rep.Pasos));
                    }
                    else
                        sw = (manager.SaveReporte(rep) > 0 ? true : false);
                }
            });
        }
Example #3
0
 public int SaveReporte(ReporteSql rep)
 {
     try
     {
         return Db.SaveReporte(rep);
     }
     catch (Exception ex)
     {
         Log.Error("SaveReto", ex.Message);
         return -1;
     }
 }