コード例 #1
0
        async void OnItemSelected(Truck truck)
        {
            try
            {
                if (truck == null)
                {
                    return;
                }


                if (truck.KIM == null)
                {
                    throw new SystemException("Truck Belum memilik KIM.");
                }

                var lastItem = await GateService.TruckLastChencUp(truck.Id);

                if (lastItem == null)
                {
                    throw new SystemException("Truck Belum Diajukan Untuk Dibuatkan KIM.");
                }

                var page = new DetailTruckPage();
                page.BindingContext = new DetailTruckPageViewModel(lastItem);
                await Shell.Current.Navigation.PushAsync(page);
            }
            catch (Exception ex)
            {
                MessagingCenter.Send <MessagingCenterAlert>(new MessagingCenterAlert {
                    Message = ex.Message, Title = "Error", Cancel = "Keluar"
                }, "message");
            }
        }
コード例 #2
0
        private async void ApproveAction()
        {
            var page     = new DetailTruckPage();
            var lastItem = await GateService.TruckLastChencUp(Model.TruckId);

            page.BindingContext = new DetailTruckPageViewModel(lastItem);
            await Shell.Current.Navigation.PushAsync(page);

            await Shell.Current.Navigation.PopModalAsync();
        }