Beispiel #1
0
        private void Btncancel_Click(object sender, RoutedEventArgs e)
        {
            this.ClearForm();
            GeneralJournal v = new GeneralJournal();

            Switcher.Switchnewjurnal(v);
        }
Beispiel #2
0
 public NewGeneralJournal(GeneralJournal generalForm)
 {
     InitializeComponent();
     this.generalForm = generalForm;
     Switcher.pageSwitcherNewjurnal = this;
     this.Init();
 }
Beispiel #3
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            if (Tanggaljurnalumum.Text == "" || nojurnal.Text == "" || cbcurrency.Text == "")
            {
                MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            TransaksiJurnalUmumBLL transaksiJurnalUmumBLL = new TransaksiJurnalUmumBLL();
            TransaksiJurnalUmumBLL TransaksiJurnalUmumBLL = new TransaksiJurnalUmumBLL();
            TransaksiJurnalUmum    transaksiJurnal        = new TransaksiJurnalUmum();
            OrderJurnalUmum        jurnalUmum             = new OrderJurnalUmum();
            BukuBesar bukubesar = new BukuBesar();

            transaksiJurnal.TotalDebit            = double.Parse(txttotaldebit.Text);
            transaksiJurnal.TotalKredit           = double.Parse(txttotalkredit.Text);
            transaksiJurnal.Balance               = double.Parse(txtbalance.Text);
            transaksiJurnal.NoTransaksiJurnalUmum = double.Parse(nojurnal.Text);
            transaksiJurnal.Keterangan            = txtnote.Text;
            transaksiJurnal.Tanggal               = DateTime.Parse(Tanggaljurnalumum.Text);
            transaksiJurnal.IdKodeTransaksi       = 1;
            transaksiJurnal.IdReferalTransaksi    = 1;
            transaksiJurnal.IdPeriodeAkuntasi     = 1;
            if (this.dataMataUangselected != null)
            {
                transaksiJurnal.IdMataUang = this.dataMataUangselected.Id;
                transaksiJurnal.MataUang   = this.dataMataUangselected.KodeMataUang;
                transaksiJurnal.Kurs       = this.dataMataUangselected.KursTukar;
            }
            if (this.kontakSelected != null)
            {
                transaksiJurnal.IdPetugas   = this.kontakSelected.Id;
                transaksiJurnal.NamaPetugas = this.kontakSelected.NamaA;
            }
            if (double.Parse(txtbalance.Text) != 0)
            {
                MessageBox.Show("Total Balance Must 0 !");
                return;
            }
            if (this.dokumenSelected != null)
            {
                transaksiJurnal.IdNoRefensiDokumen = this.dokumenSelected.Id;
                transaksiJurnal.NoRefensiDokumen   = this.dokumenSelected.NoReferensiDokumen;
            }
            transaksiJurnal.RealRecordingTime = DateTime.Now;
            if (TransaksiJurnalUmumBLL.AddTransaksiJurnalUmum(transaksiJurnal) > 0)
            {
                //  this.ClearForm();
                MessageBox.Show("General Journal successfully added !");
            }
            else
            {
                MessageBox.Show("General Journal failed to add !");
            }
            if (DGJurnal.Items.Count > 0)
            {
                foreach (var item in DGJurnal.Items)
                {
                    if (item is OrderJurnalUmum)
                    {
                        OrderJurnalUmum oNewData1 = (OrderJurnalUmum)item;
                        oNewData1.IdKodeTransaksi       = 1;
                        oNewData1.IdReferalTransaksi    = 1;
                        oNewData1.IdPeriodeAkuntasi     = 1;
                        oNewData1.Tanggal               = DateTime.Parse(Tanggaljurnalumum.Text);
                        oNewData1.NoTransaksiJurnalUmum = double.Parse(nojurnal.Text);
                        oNewData1.Keterangan            = txtnote.Text;
                        if (this.dataMataUangselected != null)
                        {
                            oNewData1.IdMataUang = this.dataMataUangselected.Id;
                            oNewData1.MataUang   = this.dataMataUangselected.KodeMataUang;
                            oNewData1.Kurs       = this.dataMataUangselected.KursTukar;
                        }
                        if (this.kontakSelected != null)
                        {
                            oNewData1.IdPetugas   = this.kontakSelected.Id;
                            oNewData1.NamaPetugas = this.kontakSelected.NamaA;
                        }
                        oNewData1.IdTransaksiJurnalUmum = transaksiJurnal.IdTransaksiJurnalUmum;
                        oNewData1.Chkaktif = false;
                        if (transaksiJurnalUmumBLL.EditJurnalUmum(oNewData1, transaksiJurnal) == true)
                        {
                        }
                    }
                }
                GeneralJournal v = new GeneralJournal();
                Switcher.Switchnewjurnal(v);
            }
        }