Example #1
0
        private void setSuccessStoreHealthAgency(HttpResponseBundle _response)
        {
            string message = _response.getHttpResponseMessage().Content.ReadAsStringAsync().Result;

            Console.WriteLine("sukses: " + _response.getJObject());

            HealthAgency healthAgency = _response.getParsedObject <RootSingleHealthAgency>().data;

            getView().callMethod("successStore", healthAgency);
        }
Example #2
0
        public void store(object sender, RoutedEventArgs e)
        {
            HealthAgency healthAgency = (HealthAgency)health_agency_cbx.SelectedItem;

            if (name.Text == "" || email.Text == "" || phone.Text == "" || healthAgency == null)
            {
                MessageBox.Show("Nama, Email, Nomor HP, dan Puskesmas wajib diisi", "ERROR");
            }
            else
            {
                String res_number = residence_number.Text;
                if (residence_number.Text == "")
                {
                    res_number = "0";
                }
                getController().callMethod("store", name.Text, email.Text, phone.Text, res_number, healthAgency.id);
            }
        }
        private void update(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("UPDATE");
            HealthAgency healthAgency = (HealthAgency)health_agency_cbx.SelectedItem;

            if (name.Text == "" || email.Text == "" || phone.Text == "" || healthAgency == null)
            {
                MessageBox.Show("Nama, Email, Nomor HP, dan Puskesmas wajib diisi", "ERROR");
            }
            else
            {
                String res_number = residence_number.Text;
                if (residence_number.Text == "")
                {
                    res_number = "0";
                }
                getController().callMethod("update", userId, name.Text, email.Text, phone.Text, res_number, healthAgency.id);
            }
        }
        public void successStore(HealthAgency healthAgency)
        {
            this.Dispatcher.Invoke(() =>
            {
                this.NavigationService.GoBack();
                this.NavigationService.RemoveBackEntry();

                nameTxtBox.setText("");
                emailTxtBox.setText("");
                addressTxtBox.setText("");
                callCenterTxtBox.setText("");

                MessageBox.Show(
                    "Nama : " + healthAgency.name + Environment.NewLine +
                    "Email : " + healthAgency.email + Environment.NewLine +
                    "Call center : " + healthAgency.call_center + Environment.NewLine +
                    "Alamat : " + healthAgency.address + Environment.NewLine
                    );
            });
        }
        private void setViewSuccessFetchHA(HttpResponseBundle _response)
        {
            HealthAgency healthAgency = _response.getParsedObject <RootSingleHealthAgency>().data;

            getView().callMethod("setHAData", healthAgency);
        }