Exemplo n.º 1
0
        public async void goToDetail(object sender, RoutedEventArgs e)
        {
            if (validateInput() == false)
            {
                var message = new MessageDialog("Ada field yang masih kosong, harap lengkapi data terlebih dahulu");
                await message.ShowAsync();
            }
            else
            {
                string responseData = await httpObject.GetRequest("settings/checkKecamatanAvailable?lat=" + lat + "&lng=" + lng);

                JObject json = JObject.Parse(responseData);
                if (json["status"].ToString() == "1")
                {
                    string              judulLaporan          = txtJudulLaporan.Text;
                    string              descKejadian          = txtDescKejadian.Text;
                    string              valueKategoriKejadian = cbJenisKejadian.SelectedValue.ToString();
                    string              alamatLaporan         = txtAutocompleteAddress.Text;
                    string              tglLaporan            = DateTime.Now.ToString("dd/MM/yyyy");
                    string              waktuLaporan          = DateTime.Now.ToString("HH:mm:ss");
                    int                 index            = cbJenisKejadian.SelectedIndex;
                    SettingKategori     kategoriSelected = listSetingKategoriKriminalitas[cbJenisKejadian.SelectedIndex];
                    int                 id_kecamatan     = Convert.ToInt32(json["id_kecamatan"].ToString());
                    ConfirmReportParams param            = new ConfirmReportParams("kriminalitas", judulLaporan, null, descKejadian, lat, lng, alamatLaporan, id_kecamatan, tglLaporan, waktuLaporan, kategoriSelected, index, imageLaporan);
                    session.setConfirmreportParam(param);
                    this.Frame.Navigate(typeof(ConfirmReportPage));
                }
                else
                {
                    var message = new MessageDialog(json["message"].ToString());
                    await message.ShowAsync();
                }
            }
        }
Exemplo n.º 2
0
        private async void goToDetail(object sender, RoutedEventArgs e)
        {
            if (validateInput() == false)
            {
                var message = new MessageDialog("Ada field yang masih kosong, harap lengkapi data terlebih dahulu");
                await message.ShowAsync();
            }
            else
            {
                if (imageLaporan != null)
                {
                    string responseData = await httpObject.GetRequest("settings/checkKecamatanAvailable?lat=" + lat + "&lng=" + lng);

                    JObject json = JObject.Parse(responseData);
                    if (json["status"].ToString() == "1")
                    {
                        int                 jenisLaporan     = (bool)rbLostItem.IsChecked ? 1 : 0;
                        string              judulLaporan     = txtJudulLaporan.Text;
                        string              descLaporan      = txtDescBarang.Text;
                        string              alamatLaporan    = txtAutocompleteAddress.Text;
                        SettingKategori     kategoriSelected = listSettingKategoriLostFound[cbJenisBarang.SelectedIndex];
                        string              tglLaporan       = DateTime.Now.ToString("dd/MM/yyyy");
                        string              waktuLaporan     = DateTime.Now.ToString("HH:mm:ss");
                        int                 index            = cbJenisBarang.SelectedIndex;
                        int                 id_kecamatan     = Convert.ToInt32(json["id_kecamatan"].ToString());
                        string              namaFileGambar   = listSettingKategoriLostFound[cbJenisBarang.SelectedIndex].file_gambar_kategori;
                        ConfirmReportParams param            = new ConfirmReportParams("lostfound", judulLaporan, jenisLaporan.ToString(), descLaporan, lat, lng, alamatLaporan, id_kecamatan, tglLaporan, waktuLaporan, kategoriSelected, index, imageLaporan);
                        session.setConfirmreportParam(param);
                        this.Frame.Navigate(typeof(ConfirmReportPage));
                    }
                    else
                    {
                        var message = new MessageDialog(json["message"].ToString());
                        await message.ShowAsync();
                    }
                }
                else
                {
                    var message = new MessageDialog("Wajib menyertakan gambar untuk membuat laporan Lost & Found");
                    await message.ShowAsync();
                }
            }
        }
 public ConfirmReportParams(string tag_laporan, string judul_laporan, string jenis_laporan, string deskripsi_laporan, string lat_laporan, string lng_laporan, string alamat_laporan, int id_kecamatan, string tanggal_laporan, string waktu_laporan, SettingKategori kategori_selected, int combo_box_selected_index, UploadedImage image_laporan)
 {
     this.tag_laporan              = tag_laporan;
     this.judul_laporan            = judul_laporan;
     this.jenis_laporan            = jenis_laporan;
     this.deskripsi_laporan        = deskripsi_laporan;
     this.lat_laporan              = lat_laporan;
     this.lng_laporan              = lng_laporan;
     this.tanggal_laporan          = tanggal_laporan;
     this.alamat_laporan           = alamat_laporan;
     this.id_kecamatan             = id_kecamatan;
     this.waktu_laporan            = waktu_laporan;
     this.kategori_selected        = kategori_selected;
     this.combo_box_selected_index = combo_box_selected_index;
     this.image_laporan            = image_laporan;
 }