async void AdvertisingUpdate()
        {
            if (PropertiesManager.IsDateAdvertisingTrue())
            {
                PropertiesManager.SaveAdvertisingDate(dateToSend);
            }
            else
            {
                dateToSend = PropertiesManager.GetDataAdvertising();
            }
            if (PropertiesManager.IsDateFirstAdvertisingTrue())
            {
                PropertiesManager.SaveFirstAdvertisingDate(1);
            }
            else
            {
                PropertiesManager.SaveFirstAdvertisingDate(PropertiesManager.GetFirstDataAdvertising() + 1);
            }

            CheckConnection();
            //ShowProgress("Validando");
            String times = "";

            if (PropertiesManager.GetFirstDataAdvertising() > 1)
            {
                times = dateToSend.ToString("yyyy-MM-dd HH:MM:ss");
            }
            else
            {
                times = "0000-00-00 00:00:00";
            }
            //var times = dateToSend.ToString("yyyy-MM-dd HH:MM:ss");
            _advertising = await ClientGuanajoven.getAdvertising(times);

            var publicidad = App.CurrentApp.RealmInstance.All <Publicidad>().ToList();

            if (_advertising != null && _advertising.Count > 0)
            {
                MergeLists(_advertising);
            }

            publicidad = App.CurrentApp.RealmInstance.All <Publicidad>().ToList();
            if (publicidad != null)
            {
                dateToSend = time;
                PropertiesManager.SaveEventDate(dateToSend);
                publicidad = publicidad.OrderByDescending(x => x.fecha_inicio).ToList();
            }
            //HideProgress();
        }
        async void getEvents()
        {
            if (PropertiesManager.IsDateEventTrue())
            {
                PropertiesManager.SaveEventDate(dateToSend);
            }
            else
            {
                dateToSend = PropertiesManager.GetDateEvent();
            }
            if (PropertiesManager.IsFirstDateEventTrue())
            {
                PropertiesManager.SaveFirstEventDate(1);
            }
            else
            {
                PropertiesManager.SaveFirstEventDate(PropertiesManager.GetFirstDataEvent() + 1);
            }
            CheckConnection();
            ShowProgress("Validando");
            String times = "";

            if (PropertiesManager.GetFirstDataEvent() > 1)
            {
                times = dateToSend.ToString("yyyy-MM-dd HH:MM:ss");
            }
            else
            {
                times = "0000-00-00 00:00:00";
            }
            _events = await ClientGuanajoven.getEvents(times);

            var eventos = App.CurrentApp.RealmInstance.All <Evento>().ToList();

            if (_events != null && _events.Count > 0)
            {
                foreach (var item in _events)
                {
                    var fechainicio = DateTime.Parse(item.fecha_inicio).ToString("dd/MM/yyyy");
                    //var fechafin = DateTime.Parse(item.fecha_fin).ToString("dd/MM/yyyy");
                    item.fecha = fechainicio;                     //+ " - " + fechafin;
                    var fecha_fin = DateTime.Parse(item.fecha_fin);
                    if (time <= fecha_fin)
                    {
                        item.evento_estado  = "Evento Abierto";
                        item.IsEventoActivo = false;
                    }
                    else
                    {
                        item.evento_estado  = "Evento Cerrado";
                        item.IsEventoActivo = true;
                    }
                }
                MergeLists(_events);
            }

            eventos = App.CurrentApp.RealmInstance.All <Evento>().ToList();
            if (eventos != null)
            {
                dateToSend = time;
                PropertiesManager.SaveEventDate(dateToSend);
                eventos = eventos.OrderByDescending(x => x.fecha_inicio).ToList();
                _itemsList.Clear();
                //	eventos = App.CurrentApp.RealmInstance.All<Evento>().ToList();
                foreach (var item in eventos)
                {
                    _itemsList.Add(item);
                }


                Device.BeginInvokeOnMainThread(() =>
                {
                    if (ListView.ItemsSource != _itemsList)
                    {
                        ListView.ItemsSource = _itemsList;
                    }
                });
            }
            HideProgress();
        }