private void process_Click(object sender, EventArgs e)
 {
     if (splName.Text == null || string.IsNullOrWhiteSpace(splName.Text))
     {
         MessageBox.Show("Mohon isi nama perusahaan");
     }
     else
     {
         DialogResult result = MessageBox.Show("Menyimpan ke database ? ", "SAVE TO DATABASE", MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             splEditTarget.updToDatabase(splName.Text, splAlamat.Text, splPhone.Text);
             form.Close();
             EditSplForm editForm = new EditSplForm();
             editForm.Show();
             this.Close();
         }
     }
 }
예제 #2
0
 private void deleteData_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count > 0)
     {
         string       idSupplier = listView1.SelectedItems[0].Text;
         DialogResult result     = MessageBox.Show("Data ini sudah tersimpan dari database. Menghapus dari database ?", "Delete", MessageBoxButtons.YesNo);
         if (result == DialogResult.Yes)
         {
             Supplier splDelTarget = new Supplier();
             splDelTarget.getFromDatabase(Int32.Parse(idSupplier));
             if (splDelTarget.delFromDatabase() == false)
             {
                 MessageBox.Show("Data ini tidak dapat dihapus karena terhubung ke Tabel Transaksi");
             }
             else
             {
                 EditSplForm form = new EditSplForm();
                 form.Show();
                 this.Close();
             }
         }
     }
 }
 public EditSupplier(EditSplForm form)
 {
     InitializeComponent();
     this.form = form;
 }
예제 #4
0
        private void editSpl_Click(object sender, EventArgs e)
        {
            EditSplForm form = new EditSplForm();

            form.Show();
        }