Exemplo n.º 1
0
        private async void EditClub_Click(object sender, EventArgs e)
        {
            bool hasError = false;

            if (string.IsNullOrWhiteSpace(_clubName.Text))
            {
                _clubName.Error = "Въведете име";
                hasError        = true;
            }

            if (!hasError)
            {
                HttpResponseMessage response = await RestManager.EditClub(new EditClub
                {
                    ClubId    = _club.Id,
                    Email     = Intent.GetStringExtra("email"),
                    Name      = _clubName.Text,
                    ClubPhoto = _imageStream
                });

                if (response.IsSuccessStatusCode)
                {
                    Intent intent = new Intent(this, typeof(UserProfileActivity));
                    StartActivity(intent);
                }
                else
                {
                    string message = await response.Content.ReadAsStringAsync();

                    Toast.MakeText(this, message, ToastLength.Long).Show();
                }
            }
        }