private void Delete_Click(object sender, RoutedEventArgs e) { if (this.GolonganKontakSelected == null) { MessageBox.Show("Salary Group has not been selected !"); } else { GolonganKontakBLL GolonganKontakBLL = new GolonganKontakBLL(); if (GolonganKontakBLL.RemoveGolonganKontak(this.GolonganKontakSelected.Id) == true) { MessageBox.Show("Salary Group was deleted successfully"); this.LoadGolonganKontak(""); this.GolonganKontakSelected = null; } } }
private void BtnSave_Click(object sender, RoutedEventArgs e) { if (txtPositionGroupName.Text == "" || txtBasicSalary.Text == "" || txtAllowance.Text == "" || txtOvertime.Text == "") { MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error); return; } GolonganKontakBLL GolonganKontakBLL = new GolonganKontakBLL(); if (this.SalaryGroupForm.isEdit == false) { if (GolonganKontakBLL.AddGolonganKontak(this.GetData()) > 0) { this.ClearForm(); MessageBox.Show("Salary Group successfully added !"); this.SalaryGroupForm.LoadGolonganKontak(""); } else { MessageBox.Show("Salary Group failed to add !"); } } else { if (GolonganKontakBLL.EditGolonganKontak(this.GetData()) == true) { this.ClearForm(); MessageBox.Show("Salary Group successfully changed !"); this.SalaryGroupForm.LoadGolonganKontak(""); } else { MessageBox.Show("Salary Group failed to change !"); } } }