コード例 #1
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            KelompokHartaTetapBLL kelompokHartaTetapBLL = new KelompokHartaTetapBLL();

            if (kelompokHartaTetapBLL.EditKelompokHartaTetap(this.GetData()) == true)
            {
                this.ClearForm();
                MessageBox.Show("Fixed Assets Group successfully changed !");
                this.fixedAssetCategoryForm.LoadKelompokHartaTetap();
            }
            else
            {
                MessageBox.Show("Fixed Assets Group failed to change !");
            }
            this.Close();
        }
コード例 #2
0
 private void Delete_Click(object sender, RoutedEventArgs e)
 {
     if (this.kelompokHartaTetapSelected == null)
     {
         MessageBox.Show("Fixed Asset Category not selected yet !");
     }
     else
     {
         KelompokHartaTetapBLL KelompokHartaTetapBLL = new KelompokHartaTetapBLL();
         if (KelompokHartaTetapBLL.RemoveKelompokHartaTetap(this.kelompokHartaTetapSelected.Id) == true)
         {
             MessageBox.Show("Fixed Asset Category successfully deleted");
             this.LoadKelompokHartaTetap();
             this.kelompokHartaTetapSelected = null;
         }
     }
 }
コード例 #3
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            if (TxtNamaKelompokHartaTetap.Text == "" || CBKelompokHartaTetapParent.Text == "" || CBTabelPenyusutan.Text == "" || TxtKeterangan.Text == "")
            {
                MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            KelompokHartaTetapBLL kelompokHartaTetapBLL = new KelompokHartaTetapBLL();

            if (kelompokHartaTetapBLL.AddKelompokHartaTetap(this.GetData()) > 0)
            {
                this.ClearForm();
                MessageBox.Show("Fixed Assets Group successfully added !");
                this.fixedAssetCategoryForm.LoadKelompokHartaTetap();
            }
            else
            {
                MessageBox.Show("Fixed Assets Groups failed to be added !");
            }
            this.Close();
        }
コード例 #4
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            if (this.DataMataUangSelected != null)
            {
                using (var uow = new UnitOfWork(AppConfig.Current.ContextName))
                {
                    var oDBData = uow.DefaultAkunMataUang.Get(this.DataMataUangSelected.IdDefaultMataUang.GetValueOrDefault(0));
                    if (oDBData != null)
                    {
                        if (cbAccountReceivable.SelectedItem != null)
                        {
                            oDBData.IdPiutangUsaha = Convert.ToInt32(cbAccountReceivable.SelectedValue);
                        }
                        if (cbAccountPayable.SelectedItem != null)
                        {
                            oDBData.IdHutangUsaha = Convert.ToInt32(cbAccountPayable.SelectedValue);
                        }
                        if (cbBankpayment.SelectedItem != null)
                        {
                            oDBData.IdPembayaranBank = Convert.ToInt32(cbBankpayment.SelectedValue);
                        }
                        if (cbCashpayment.SelectedItem != null)
                        {
                            oDBData.IdPembayaranTunai = Convert.ToInt32(cbCashpayment.SelectedValue);
                        }
                        if (cbPurchasedownpayment.SelectedItem != null)
                        {
                            oDBData.IdUangMukaPembelian = Convert.ToInt32(cbPurchasedownpayment.SelectedValue);
                        }
                        if (cbSalesdownpayment.SelectedItem != null)
                        {
                            oDBData.IdUangMukaPenjualan = Convert.ToInt32(cbSalesdownpayment.SelectedValue);
                        }
                        if (cbReceivedpostdatecheque.SelectedItem != null)
                        {
                            oDBData.IdPiutangGiro = Convert.ToInt32(cbReceivedpostdatecheque.SelectedValue);
                        }
                        if (cbPostdatecheque.SelectedItem != null)
                        {
                            oDBData.IdHutangGiro = Convert.ToInt32(cbPostdatecheque.SelectedValue);
                        }
                        uow.DefaultAkunMataUang.Update(oDBData);
                        uow.Save();

                        MessageBox.Show("Important Account Currency berhasil diupdate ! \n");
                    }
                }
            }

            if (this.DataPajakSelected != null)
            {
                if (cbAccountBuy.SelectedItem != null)
                {
                    this.DataPajakSelected.IdAkunBeli = Convert.ToInt32(cbAccountBuy.SelectedValue);
                }
                if (cbSellAccount.SelectedItem != null)
                {
                    this.DataPajakSelected.IdAkunJual = Convert.ToInt32(cbSellAccount.SelectedValue);
                }

                DataPajakBLL DataPajakBLL = new DataPajakBLL();
                if (DataPajakBLL.EditPajak(this.DataPajakSelected) == true)
                {
                    MessageBox.Show("Important Account Tax berhasil diupdate ! \n");
                }
            }

            if (this.KelompokHartaTetapSelected != null)
            {
                if (cbAssetaccount.SelectedItem != null)
                {
                    this.KelompokHartaTetapSelected.IdAkunAsset = Convert.ToInt32(cbAssetaccount.SelectedValue);
                }
                if (cbAkumulasiAccounDept.SelectedItem != null)
                {
                    this.KelompokHartaTetapSelected.IdAkunAkumulasiPenyusutan = Convert.ToInt32(cbAkumulasiAccounDept.SelectedValue);
                }
                if (cbDeprectiation.SelectedItem != null)
                {
                    this.KelompokHartaTetapSelected.IdAkunPenyusutan = Convert.ToInt32(cbDeprectiation.SelectedValue);
                }

                KelompokHartaTetapBLL KelompokHartaTetapBLL = new KelompokHartaTetapBLL();
                if (KelompokHartaTetapBLL.EditKelompokHartaTetap(this.KelompokHartaTetapSelected) == true)
                {
                    MessageBox.Show("Important Account Fixed Asset Category berhasil diupdate ! \n");
                }
            }

            this.ClearForm();
            AccountData.AccountData v = new AccountData.AccountData();
            Switcher.Switchimport(v);
        }