Exemplo n.º 1
0
        public void AsyncListarAgendaAtivo()
        {
            List <string> _list = new List <string>();

            _list.Add(DateTime.Now.ToShortDateString());
            _list.Add("31/12/" + DateTime.Now.Year);

            _list.Add("1");
            _list.Add("1");

            _list.Add("0");
            _list.Add("99");

            _list.Add("1");
            _list.Add("1");


            Task.Factory.StartNew(() => mdata.Agenda(_list))
            .ContinueWith(task =>
            {
                if (task.IsCompleted)
                {
                    ListarAgenda = task.Result;
                }
            },
                          System.Threading.CancellationToken.None,
                          TaskContinuationOptions.None,
                          TaskScheduler.FromCurrentSynchronizationContext());
        }
Exemplo n.º 2
0
        private void AsyncListarAgenda()
        {
            List <string> _list = new List <string>();

            _list.Add(DateTime.Now.ToShortDateString());
            _list.Add("1");
            _list.Add("1");

            Task.Factory.StartNew(() => mdata.Agenda(_list))
            .ContinueWith(task =>
            {
                if (task.IsCompleted)
                {
                    ListarAgenda = task.Result;
                }
            });
        }
Exemplo n.º 3
0
        private void AsyncListarEventos()
        {
            List <string> _list = new List <string>();

            if (!IsActive)
            {
                _list.Add(string.Format("{0}/{1}/{2}", DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year));
                _list.Add("31/12/3000");
            }
            else
            {
                _list.Add("01/01/1900");
                _list.Add("31/12/3000");
            }

            if (setEstado == 0)
            {
                _list.Add("0");
                _list.Add("99");
            }
            else
            {
                _list.Add(setEstado.ToString());
                _list.Add(setEstado.ToString());
            }

            if (setTipo == 0)
            {
                _list.Add("0");
                _list.Add("99");
            }
            else
            {
                _list.Add(setTipo.ToString());
                _list.Add(setTipo.ToString());
            }

            if (setSetor == 0)
            {
                _list.Add("0");
                _list.Add("99");
            }
            else
            {
                _list.Add(setSetor.ToString());
                _list.Add(setSetor.ToString());
            }

            //ViewListaEventos = Visibility.Visible;
            Task <ObservableCollection <mAgenda> > .Factory.StartNew(() => mdata.Agenda(_list))
            .ContinueWith(task =>
            {
                if (task.IsCompleted)
                {
                    ListarEventos = task.Result;
                }
            },
                          System.Threading.CancellationToken.None,
                          TaskContinuationOptions.None,
                          TaskScheduler.FromCurrentSynchronizationContext());
        }