private void BtnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.ClearForm();
            GroupProducts v = new GroupProducts();

            Switcher.Switchnewgrupproduk(v);
        }
 public NewGroupProduct(GroupProducts groupProductForm)
 {
     InitializeComponent();
     this.groupProductForm = groupProductForm;
     Switcher.pageSwitcherNewgrupproduk = this;
     this.Init();
 }
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            if (txtGroupName.Text == "" || cbCategory.Text == "" || dtTanggalMulaiDiskon.Text == "" || dtTanggalAkhirDiskon.Text == "")
            {
                MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            GrupProdukBLL GroupProdukBLL = new GrupProdukBLL();

            if (this.groupProductForm.isEdit == false)
            {
                if (GroupProdukBLL.AddGrupProduk(this.GetData()) > 0)
                {
                    this.ClearForm();
                    MessageBox.Show("Product Group successfully added !");
                    this.groupProductForm.LoadGrupProduk();
                }
                else
                {
                    MessageBox.Show("Product Group failed to add !");
                }
            }
            else
            {
                if (GroupProdukBLL.EditGrupProduk(this.GetData()) == true)
                {
                    this.ClearForm();
                    MessageBox.Show("Product Group successfully changed !");
                    this.groupProductForm.LoadGrupProduk();
                }
                else
                {
                    MessageBox.Show("Product Group failed to change !");
                }
            }
            GroupProducts v = new GroupProducts();

            Switcher.Switchnewgrupproduk(v);
        }