コード例 #1
0
        public async void editProcess(Button btn)
        {
            HealthAgency dataObject = btn.DataContext as HealthAgency;

            Console.WriteLine("index: " + dataObject.id);

            EditHealthAgencyPage editPage = new EditHealthAgencyPage();

            editPage.idHA = dataObject.id;
            //FrameService.Frame.Navigate(editPage);
        }
コード例 #2
0
        public async void deleteProcess(HealthAgency healthAgency)
        {
            ApiClient client  = ApiAntrianSehat.getInstance().GetApiClient();
            var       request = new ApiRequestBuilder();

            var req = request.buildHttpRequest()
                      .setEndpoint("health-agency/" + healthAgency.id)
                      .setRequestMethod(HttpMethod.Delete);

            client.setOnSuccessRequest(setViewSuccessDelete);
            client.setOnFailedRequest(setViewErrorDelete);
            var response = await client.sendRequest(request.getApiRequestBundle());
        }
コード例 #3
0
        void edit_OnClick(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            if (button != null)
            {
                HealthAgency dataObject = button.DataContext as HealthAgency;
                //getController().callMethod("editProcess", dataObject.id);

                //dgHealthAgencies.ItemsSource = new List<HealthAgency>();
                //navigate ke halaman edit dgn mengirimkan id HA
                FrameService.frame.Navigate(editHealthAgencyPage);
                ((EditHealthAgencyPage)editHealthAgencyPage).idHA = dataObject.id;
            }

            editHealthAgencyPage.callMethod("fetchHAData");
        }