private void njkppbbklik_Click(object sender, EventArgs e) { double njoptkp; double.TryParse(njoptkpbox.Text, out njoptkp); if (!double.TryParse(njoptkpbox.Text, out njoptkp)) { MessageBox.Show("Mohon isi data dengan benar."); } else { if (objekpajak.SelectedItem.ToString() == "Pertambangan" || objekpajak.SelectedItem.ToString() == "Perkebunan" || objekpajak.SelectedItem.ToString() == "Kehutanan") { njkp = (htotal - njoptkp) * 0.4f; njkpbox.Text = Convert.ToString(njkp); njkppersen.Text = "(40%)"; } else if (objekpajak.SelectedItem.ToString() == "Lainnya (pedesaan dan perkotaan)") { if (htotal >= 1000000000) { njkp = (htotal - njoptkp) * 0.4f; njkpbox.Text = Convert.ToString(Math.Round(njkp)); njkppersen.Text = "(40%)"; } else if (htotal < 1000000000) { njkp = (htotal - njoptkp) * 0.2f; njkpbox.Text = Convert.ToString(Math.Round(njkp)); njkppersen.Text = "(20%)"; } } hitungpbb pbb = new hitungpbb(); pbb.hitungpbbnya(njkp); //pbbfinal = 0.005f * njkp; pbb.hasilhitungpbb(); pbbbox.Text = Convert.ToString(pbb.hasilhitungpbb()); } }
// Hitung semuanya private void button1_Click(object sender, EventArgs e) { double lt1, lb1; double njoptkp; double.TryParse(ltanah.Text, out lt1); double.TryParse(lbangunan.Text, out lb1); double.TryParse(njoptkpbox.Text, out njoptkp); if (!double.TryParse(ltanah.Text, out lt1) || !double.TryParse(lbangunan.Text, out lb1) || !double.TryParse(njoptkpbox.Text, out njoptkp)) { MessageBox.Show("Mohon isi data dengan benar."); } else { if (tanahAB.SelectedItem.ToString() == "A") { for (tanah00.SelectedIndex = tanah00.SelectedIndex; tanah00.ItemHeight == 50; tanah00.SelectedIndex++) { ; } htanah = lt1 * hta[tanah00.SelectedIndex]; htanahbox.Text = Convert.ToString(htanah); } else if (tanahAB.SelectedItem.ToString() == "B") { for (tanah00.SelectedIndex = tanah00.SelectedIndex; tanah00.ItemHeight == 50; tanah00.SelectedIndex++) { ; } htanah = lt1 * htb[tanah00.SelectedIndex]; htanahbox.Text = Convert.ToString(htanah); } else if (tanahAB.SelectedItem.ToString() == null) { htanah = 0; htanahbox.Text = Convert.ToString(htanah); } if (bangunanAB.SelectedItem.ToString() == "A") { for (bangunan00.SelectedIndex = bangunan00.SelectedIndex; bangunan00.ItemHeight == 20; bangunan00.SelectedIndex++) { ; } hbangunan = lb1 * hba[bangunan00.SelectedIndex]; hbangunanbox.Text = Convert.ToString(hbangunan); } else if (bangunanAB.SelectedItem.ToString() == "B") { for (bangunan00.SelectedIndex = bangunan00.SelectedIndex; bangunan00.ItemHeight == 20; bangunan00.SelectedIndex++) { ; } hbangunan = lb1 * hbb[bangunan00.SelectedIndex]; hbangunanbox.Text = Convert.ToString(hbangunan); } else if (bangunanAB.SelectedItem.ToString() == null) { hbangunan = 0; hbangunanbox.Text = Convert.ToString(hbangunan); } htotal = htanah + hbangunan; njopbox.Text = Convert.ToString(htotal); njopmilikpbb = htotal - njoptkp; njopppbb.Text = Convert.ToString(njopmilikpbb); if (objekpajak.SelectedItem.ToString() == "Pertambangan" || objekpajak.SelectedItem.ToString() == "Perkebunan" || objekpajak.SelectedItem.ToString() == "Kehutanan") { njkp = (htotal - njoptkp) * 0.4f; njkpbox.Text = Convert.ToString(Math.Round(njkp)); njkppersen.Text = "(40%)"; } else if (objekpajak.SelectedItem.ToString() == "Lainnya (pedesaan dan perkotaan)") { if (htotal >= 1000000000) { njkp = (htotal - njoptkp) * 0.4f; njkpbox.Text = Convert.ToString(Math.Round(njkp)); njkppersen.Text = "(40%)"; } else if (htotal < 1000000000) { njkp = (htotal - njoptkp) * 0.2f; njkpbox.Text = Convert.ToString(Math.Round(njkp)); njkppersen.Text = "(20%)"; } } hitungpbb pbb = new hitungpbb(); pbb.hitungpbbnya(njkp); //pbbfinal = 0.005f * njkp; pbb.hasilhitungpbb(); pbbbox.Text = Convert.ToString(pbb.hasilhitungpbb()); } }