Ejemplo n.º 1
0
        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 !");
                }
            }
        }