예제 #1
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Items.Clear();
                var items = await SprintFirebaseHelper.GetAllSprint();

                foreach (var item in items)
                {
                    Items.Add(item);
                    Console.WriteLine(item.Id);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #2
0
        private async void SignUp()
        {
            //null or empty field validation, check weather email and password is null or empty

            if (string.IsNullOrEmpty(Name))
            {
                await App.Current.MainPage.DisplayAlert("Empty Values", "Please enter Name and Description", "OK");
            }
            else
            {
                //call AddUser function which we define in Firebase helper class
                var Sprint = await SprintFirebaseHelper.AddSprint(Id, Name, StoryPoints);

                //AddUser return true if data insert successfuly
                if (Sprint)
                {
                    await App.Current.MainPage.DisplayAlert("Save Sprint Success", "", "Ok");

                    //Navigate to Wellcom page after successfuly SignUp
                    //pass user email to welcom page
                    await App.Current.MainPage.Navigation.PushModalAsync(new SprintListPage());
                }
                else
                {
                    await App.Current.MainPage.DisplayAlert("Error", "Save Sprint Fail", "OK");
                }
            }
        }
예제 #3
0
 //Delete User
 public async Task <bool> DeleteSprint(Guid Id)
 {
     return(await SprintFirebaseHelper.DeleteSprint(Id));
 }
예제 #4
0
 //Update
 public async Task <bool> UpdateSprint(Guid Id, string Name, int StoryPoints)
 {
     return(await SprintFirebaseHelper.UpdateSprint(Id, Name, StoryPoints));
 }
예제 #5
0
 //Read
 public async Task <ToDoApp.Models.Sprint> GetSprint(Guid Id)
 {
     return(await SprintFirebaseHelper.GetSprint(Id));
 }
예제 #6
0
 public async Task <List <ToDoApp.Models.Sprint> > GetAllSprint()
 {
     return(await SprintFirebaseHelper.GetAllSprint());
 }