private void Client_GetAllRestaurantsCompleted(object sender, GetAllCompletedEventArgs e)
        {
            //Thread.Sleep(2000);

            restaurantsModel = e.Result.ToList();
            reseter.Set();
        }
        private void LoginCompleted(object sender, GetAllCompletedEventArgs getAllCompletedEventArgs)
        {
            string msg = null;

            if (getAllCompletedEventArgs.Error != null)
            {
                msg  = getAllCompletedEventArgs.Error.Message;
                msg += getAllCompletedEventArgs.Error.InnerException;
            }

            else if (getAllCompletedEventArgs.Cancelled)
            {
                msg = "Request was cancelled.";
            }

            else
            {
                UserEntity user = getAllCompletedEventArgs.Result.Where(u => u.Username == username.Text && u.Password == password.Text).FirstOrDefault();

                if (user != null)
                {
                    Auth.loggedUser = user;
                }

                else
                {
                    msg = "Error";
                }
            }
            RunOnUiThread(() => result.Text = msg);
        }
Exemplo n.º 3
0
        /// <summary>
        /// The service get all completed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void ServiceGetAllCompleted(object sender, GetAllCompletedEventArgs e)
        {
            this.ResultList = (from x in e.Result
                               select
                               new ViewContact
            {
                FullName = x.FullName,
                Street = x.Street,
                City = x.City,
                Picture = GetBitmapFromBytes(x.Picture),
            }).ToList();

            this.RaisePropertyChanged("ResultList");
        }
Exemplo n.º 4
0
 /// <summary>
 /// 初始化同步完成事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void client_GetAllCompleted(object sender, GetAllCompletedEventArgs e)
 {
     try
     {
         if (e.Error == null)
         {
             if (this.GetAllCallBack != null)
             {
                 this.GetAllCallBack(e.Result);
             }
         }
     }
     catch (Exception ex)
     {
         LogManage.WriteLog(this.GetType(), ex);
     }
 }
Exemplo n.º 5
0
        private void GetAllCompleted(object sender, GetAllCompletedEventArgs e)
        {
            string message = null;

            if (e.Cancelled)
            {
                message = "Cancelled";
            }
            if (e.Error != null)
            {
                DialogService.ShowDialog("Exception", e.Error.Message, false, null);
            }
            else
            {
                Clients.Clear();
                foreach (var client in e.Result)
                {
                    Clients.Add(client);
                }
            }

            Messenger.Default.Send(new StatusBarMessage(message));
        }
Exemplo n.º 6
0
        private void GetAllCompleted(object sender, GetAllCompletedEventArgs e)
        {
            string message = null;

            if (e.Cancelled)
            {
                message = "Cancelled";
            }
            if (e.Error != null)
            {
                DialogService.ShowDialog("Exception", e.Error.Message, false, null);
            }
            else
            {
                Clients.Clear();
                foreach (var client in e.Result)
                {
                    Clients.Add(client);
                }
            }

            Messenger.Default.Send(new StatusBarMessage(message));
        }
 private void ListViewPopulatedCompleted(object sender, GetAllCompletedEventArgs getAllCompletedEventArgs)
 {
     restaurantsModel = getAllCompletedEventArgs.Result;
     RunOnUiThread(() => ListAdapter = new RestaurantsListAdapter(this, restaurantsModel));
 }