Example #1
0
        async private void Edit_Clicked(object sender, EventArgs e)
        {
            if ((CrossConnectivity.Current.IsConnected == false))
            {
                await DisplayAlert(Constants.internetAlertTittle, Constants.internetAlertMessage, null, Constants.internetButton);
            }
            else
            {
                activity.IsVisible = true;
                activity.IsRunning = true;

                if (newDog.Text != null)
                {
                    App.currentDog.DogName = newDog.Text;
                }
                if (raceS.Text != null)
                {
                    App.currentDog.Race = raceS.Text;
                }
                if (genderS.Text != null)
                {
                    App.currentDog.Gender = genderS.Text;
                }
                if (hasImageChanged)
                {
                    App.currentDog.ImageD = Utils.ImageStream.ConvertStreamToString(memStream);
                }
                await manager.SaveTaskAsync(App.currentDog);

                activity.IsVisible = false;
                activity.IsRunning = false;

                bool answer = await DisplayAlert("", string.Format("{0} updated succefully", App.currentDog.DogName), null, "OK");

                if (!answer)
                {
                    MasterDetailSideMenucs.CreateMasterPage();
                    await Navigation.PushModalAsync(MasterDetailSideMenucs.MasterDetailPage);
                }
            }
        }
Example #2
0
 async private void AddDistanceToDogTatalWalk()
 {
     App.currentDog.Walk += (int)map.totalDistance;
     await dogManager.SaveTaskAsync(App.currentDog);
 }
Example #3
0
 async Task AddItem(Dog item)
 {
     await manager.SaveTaskAsync(item);
 }