예제 #1
0
 private void process_Click(object sender, EventArgs e)
 {
     if (cusName.Text == null || string.IsNullOrWhiteSpace(cusName.Text))
     {
         MessageBox.Show("Mohon isi nama perusahaan");
     }
     else
     {
         DialogResult result = MessageBox.Show("Menyimpan ke database ? ", "SAVE TO DATABASE", MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             cusEditTarget.updToDatabase(cusName.Text, cusAlamat.Text, cusPhone.Text);
             form.Close();
             EditCusForm editForm = new EditCusForm();
             editForm.Show();
             this.Close();
         }
     }
 }
예제 #2
0
 private void deleteData_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         string       idCustomer = listView1.SelectedItems[0].Text;
         DialogResult result     = MessageBox.Show("Data ini sudah tersimpan dari database. Menghapus dari database ?", "Delete", MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             Customer cusDelTarget = new Customer();
             cusDelTarget.getFromDatabase(Int32.Parse(idCustomer));
             if (cusDelTarget.delFromDatabase() == false)
             {
                 MessageBox.Show("Data ini tidak dapat dihapus karena terhubung ke Tabel Transaksi");
             }
             else
             {
                 EditCusForm form = new EditCusForm();
                 form.Show();
                 this.Close();
             }
         }
     }
 }
예제 #3
0
        private void button7_Click(object sender, EventArgs e)
        {
            EditCusForm form = new EditCusForm();

            form.Show();
        }