private async void OpenCollectorMaterialExecute(Material material)
        {
            Collector collector = CollectorVM.Collector;

            if (collector.MaterialCollection == null)
            {
                collector.MaterialCollection = new List <string>();
            }
            collector.MaterialCollection.Add(material.MaterialID);
            await CollectorAuth.UpdateCollector(collector);


            if (material.CollectorList == null)
            {
                material.CollectorList = new List <string>();
            }
            material.CollectorList.Add(collector.Username);
            await MaterialAuth.UpdateMaterial(material);

            CollectorMaterialList.Remove(material);

            await Application.Current.MainPage.DisplayAlert("Materials", "Material " + material.MaterialName + " is successfully added into collection.", "OK");

            //await Application.Current.MainPage.Navigation.PopAsync();
        }
Esempio n. 2
0
        //to update collector profile

        private async void UpdateCollectorExecute()
        {
            await CollectorAuth.UpdateCollector(Collector);

            await Application.Current.MainPage.DisplayAlert("Profile update",
                                                            "Profile successfully updated ", "OK");

            await Application.Current.MainPage.Navigation.PopAsync();
        }
Esempio n. 3
0
        private async void UpdateAllSub()
        {
            Submission.Material     = Material.MaterialID;
            Submission.MaterialName = Material.MaterialName;
            Submission.Status       = StatusApproved;
            Submission.Points       = Weight * Material.PointsPK;
            Submission.ApprovedDate = DateTime.Today;
            Recycler.TotalPoints   += Submission.Points;
            UpdateRecyclerLevel();
            await RecyclerAuth.UpdateRecycler(Recycler);

            Collector.TotalPoints += Submission.Points;
            await CollectorAuth.UpdateCollector(Collector);

            await SubmissionAuth.UpdateSubmission(Submission);
        }