private void insertButton(object sender, RoutedEventArgs e)
 {
     if (IDPelanggan.Text != "" && NamaPelanggan.Text != "" && VA.Text != "")
     {
         DBConnection dBConnection = new DBConnection();
         dBConnection.Insert(NamaPelanggan.Text, IDPelanggan.Text, VA.Text);
         PowerMeter powerMeter = new PowerMeter(NamaPelanggan.Text, IDPelanggan.Text, VA.Text);
         powerMeter.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("Data Harus di Isi");
     }
 }
Exemple #2
0
        private void searchButton(object sender, RoutedEventArgs e)
        {
            DBConnection dBConnection = new DBConnection();

            List <string>[] list = dBConnection.Select(Pelanggan.Text);
            //MessageBox.Show(list[0].Count.ToString());
            if (list[0].Count > 0)
            {
                PowerMeter powerMeter = new PowerMeter(list[0][0], list[1][0], list[2][0]);
                powerMeter.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("Data Tidak Ditemukan");
            }
        }