Exemple #1
0
 private void Delete_Click(object sender, RoutedEventArgs e)
 {
     if (this.KontakSelected == null)
     {
         MessageBox.Show("Customer belum dipilih!");
     }
     else
     {
         KontakBLL KontakBLL = new KontakBLL();
         if (KontakBLL.RemoveKontak(this.KontakSelected.Id) == true)
         {
             MessageBox.Show("Customer berhasil dihapus");
             this.LoadKontak("");
             this.KontakSelected = null;
         }
     }
 }
Exemple #2
0
 private void BtnSave_Click(object sender, RoutedEventArgs e)
 {
     if (cbClasification.Text == "" || txtVendorID.Text == "" || txtName.Text == "" || txtPhone.Text == "" || txtEmail.Text == "")
     {
         MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error);
         return;
     }
     KontakBLL KontakBLL = new KontakBLL();
     if (KontakBLL.AddKontak(this.GetData()) > 0)
     {
         this.ClearForm();
         MessageBox.Show("Vendor successfully added !");
         VendorForm.LoadVendor();
     }
     else
     {
         MessageBox.Show("Vendor failed to add !");
     }
     this.Close();
 }