Beispiel #1
0
        public DailyLogger()
        {
            InitializeComponent();

            var viewModel = JsonConvert.DeserializeObject <DailyLoggerViewModels>(DailyLoggerSetting.Default.DailyLoggerViewModels);

            if (viewModel != null)
            {
                DailyLoggerViewModels = viewModel;
            }
            else
            {
                DailyLoggerViewModels = new DailyLoggerViewModels();
                DailyLoggerSetting.Default.DailyLoggerViewModels = JsonConvert.SerializeObject(DailyLoggerViewModels);
                DailyLoggerSetting.Default.Save();
            }

            Timer = new Timer
            {
                Interval = DailyLoggerViewModels.AppSettingModels.AutoSaveTime * 60 * 1000,
                Enabled  = true
            };
            Timer.Tick += Timer_Tick;

            this.txtLogger.Font = DailyLoggerViewModels.AppSettingModels.Font;
            this.TopMost        = DailyLoggerViewModels.AppSettingModels.AlwaysOnTop;

            SearchingForm        = new SearchingForm();
            AboutForm            = new AboutForm();
            HelpForm             = new HelpForm();
            NofiyIconContextMenu = new ContextMenu();
            NofiyIconContextMenu.MenuItems.Add("Show", NotifyShowEvent);
            NofiyIconContextMenu.MenuItems.Add("Quit DailyLogger", NotifyQuitEvent);
            DLoggerNotifyIcon.ContextMenu = NofiyIconContextMenu;
        }
        public void PilihRepackID()
        {
            var searchForm   = new SearchingForm <RepackSearchModel>(_repackBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var repackID = searchForm.SelectedDataKey;
                var repack   = _repackBL.GetData(repackID);
                if (repack == null)
                {
                    return;
                }

                _view.RepackID = repack.RepackID;
                _view.Tgl      = repack.Tgl;
                _view.Jam      = repack.Jam;
                _view.BPStokID = repack.BPStokID;

                _view.BrgIDMaterial   = repack.BrgIDMaterial;
                _view.BrgNameMaterial = repack.BrgNameMaterial;
                _view.QtyMaterial     = repack.QtyMaterial;
                _view.HppMaterial     = repack.HppMaterial;

                _view.BrgIDHasil   = repack.BrgIDHasil;
                _view.BrgNameHasil = repack.BrgNameHasil;
                _view.QtyHasil     = repack.QtyHasil;
                _view.HppHasil     = repack.HppHasil;
                _view.SlotControl  = repack.SlotControl;
            }
        }
Beispiel #3
0
        public void PilihMutasiKas()
        {
            var searchForm   = new SearchingForm <MutasiKasSearchModel>(_dep.MutasiKasBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog != DialogResult.OK)
            {
                return;
            }

            var mutasiKasID = searchForm.SelectedDataKey;
            var mutasiKas   = _dep.MutasiKasBL.GetData(mutasiKasID);

            if (mutasiKas != null)
            {
                _view.MutasiKasID        = mutasiKasID;
                _view.Tgl                = mutasiKas.Tgl;
                _view.Jam                = mutasiKas.Jam;
                _view.Keterangan         = mutasiKas.Keterangan;
                _view.PegawaiID          = mutasiKas.PegawaiID;
                _view.PegawaiName        = mutasiKas.PegawaiName;
                _view.JenisKasIDAsal     = mutasiKas.JenisKasIDAsal;
                _view.JenisKasNameAsal   = mutasiKas.JenisKasNameAsal;
                _view.JenisKasIDTujuan   = mutasiKas.JenisKasIDTujan;
                _view.JenisKasNameTujuan = mutasiKas.JenisKasNameTujuan;
                _view.NilaiKas           = mutasiKas.NilaiKas;
            }
        }
        private void SearchJenisBayar(int rowIndex)
        {
            var searchForm   = new SearchingForm <JenisBayarModel>(_jenisBayarBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                DetilBayarTable.Rows[rowIndex]["JenisBayarIDCol"] = result;
            }
        }
Beispiel #5
0
        private void SearchKodeTrs()
        {
            var searchForm   = new SearchingForm <PenjualanSearchModel>(_penjualanBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                NoTrsTextBox.Text = result;
            }
        }
        private void SearchBPHutang()
        {
            var searchForm   = new SearchingForm <BPHutangSearchModel>(_bpHutangBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                DepositIDText.Text = result;
            }
        }
        private void SearchPenjualan(int rowIndex)
        {
            var searchForm   = new SearchingForm <PenjualanSearchModel>(_penjualanBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                ListLunasTable.Rows[rowIndex]["PenjualanID"] = result;
            }
        }
        private void SearchKodeTrs()
        {
            var searchForm   = new SearchingForm <ReturDepositSearchModel>(_returDepositBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                ReturDepositIDText.Text = result;
            }
        }
Beispiel #9
0
        private void SearchKodeTrs()
        {
            var searchForm   = new SearchingForm <KasBonSearchModel>(_kasBonBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                BiayaIDText.Text = result;
            }
        }
        private void SearchJenisLunas(int rowIndex)
        {
            var searchForm   = new SearchingForm <JenisLunasModel>(_jenisLunasBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                ListLunasTable.Rows[rowIndex]["JenisLunasIDCol"] = result;
            }
        }
Beispiel #11
0
        private void SearchKodeTrs()
        {
            var searchForm   = new SearchingForm <StokAdjustmentSearchModel>(_stokAdjustmentBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                NoTrsTextBox.Text = result;
            }
        }
Beispiel #12
0
        private void SearchBrg2(int rowIndex)
        {
            var searchForm   = new SearchingForm <BrgSearchResultModel>(_brgBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                DetilAdjTable.Rows[rowIndex]["BrgID"] = result;
            }
        }
Beispiel #13
0
        private void SearchPihakKetiga()
        {
            var searchForm   = new SearchingForm <PihakKetigaModel>(_pihakKetigaBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                PihakKetigaText.Text = result;
            }
        }
Beispiel #14
0
        private void SearchBukuKas()
        {
            var searchForm   = new SearchingForm <BukuKasSearchModel>(_bukuKasBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                BukuKasIDTextBox.Text = result;
            }
        }
        public void PilihBrgIDHasil()
        {
            var searchForm   = new SearchingForm <BrgSearchResultModel>(_brgBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var brg = _brgBL.GetData(searchForm.SelectedDataKey);
                _view.BrgIDHasil   = brg.BrgID;
                _view.BrgNameHasil = brg.BrgName;
            }
        }
        public void PilihLunasPiutang()
        {
            var searchForm   = new SearchingForm <LunasPiutangSearchModel>(_dep.LunasPiutangBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog != DialogResult.OK)
            {
                return;
            }

            _view.LunasPiutangID = searchForm.SelectedDataKey;
        }
Beispiel #17
0
 private void SearchBrg()
 {
     using (var searchForm = new SearchingForm <BrgStokHargaModel>(_brgStokHargaBL))
     {
         var resultDialog = searchForm.ShowDialog();
         if (resultDialog == DialogResult.OK)
         {
             var result = searchForm.SelectedDataKey;
             BrgIDTextBox.Text = result;
         }
     }
 }
Beispiel #18
0
 private void SearchBrg(int rowIndex)
 {
     using (var searchForm = new SearchingForm <BrgStokHargaModel>(_brgStokHargaBL))
     {
         var resultDialog = searchForm.ShowDialog();
         if (resultDialog == DialogResult.OK)
         {
             var result = searchForm.SelectedDataKey;
             DetilPenjualanTable.Rows[rowIndex]["BrgID"] = result;
         }
     }
 }
Beispiel #19
0
        private void SearchBukuPiutang()
        {
            var pihakKetiga = PihakKetigaText.Text;

            _bukuPiutangBL.SearchFilter.StaticKeyword = pihakKetiga;
            var searchForm   = new SearchingForm <BukuPiutangSearchModel>(_bukuPiutangBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var result = searchForm.SelectedDataKey;
                ReffIDText.Text = result;
            }
        }
        public void PilihBPStokIDMaterial()
        {
            var searchForm   = new SearchingForm <BPStokSearchModel>(_bpStokBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var bpStok = _bpStokBL.GetData(searchForm.SelectedDataKey);
                _view.BPStokID        = bpStok.BPStokID;
                _view.BrgIDMaterial   = bpStok.BrgID;
                _view.BrgNameMaterial = bpStok.BrgName;
                _view.HppMaterial     = bpStok.NilaiHpp;
            }
        }
Beispiel #21
0
        private void SearchStok(int rowIndex)
        {
            var brg = DetilPenjualanTable.Rows[rowIndex]["BrgID"].ToString();

            _bpStokBL.SearchFilter.StaticKeyword = brg;
            using (var searchForm = new SearchingForm <BPStokSearchModel>(_bpStokBL))
            {
                var resultDialog = searchForm.ShowDialog();
                if (resultDialog == DialogResult.OK)
                {
                    var bpStok = _bpStokBL.GetData(searchForm.SelectedDataKey);
                    DetilPenjualanTable.Rows[rowIndex]["BPStokID"] = bpStok.BPStokID;
                }
            }
        }
Beispiel #22
0
        private void Searching()
        {
            if (SearchingForm == null)
            {
                SearchingForm = new SearchingForm();
            }
            else
            if (SearchingForm.IsDisposed)
            {
                SearchingForm = new SearchingForm();
            }

            SearchingForm.Show();
            SearchingForm.BringToFront();
        }
Beispiel #23
0
        public void PilihKasir()
        {
            var searchForm   = new SearchingForm <PegawaiSearchModel>(_dep.PegawaiBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog != DialogResult.OK)
            {
                return;
            }

            var pegawaiID = searchForm.SelectedDataKey;
            var pegawai   = _dep.PegawaiBL.GetData(pegawaiID);

            if (pegawai != null)
            {
                _view.PegawaiID   = pegawaiID;
                _view.PegawaiName = pegawai.PegawaiName;
            }
        }
Beispiel #24
0
        public void PilihJenisKasTujuan()
        {
            var searchForm   = new SearchingForm <JenisKasModel>(_dep.JenisKasBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog != DialogResult.OK)
            {
                return;
            }

            var jenisKasID = searchForm.SelectedDataKey;
            var jenisKas   = _dep.JenisKasBL.GetData(jenisKasID);

            if (jenisKas != null)
            {
                _view.JenisKasIDTujuan   = jenisKasID;
                _view.JenisKasNameTujuan = jenisKas.JenisKasName;
            }
        }
        public void PilihCustomer()
        {
            var searchForm   = new SearchingForm <CustomerSearchModel>(_dep.CustomerBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog != DialogResult.OK)
            {
                return;
            }

            var customerID = searchForm.SelectedDataKey;
            var customer   = _dep.CustomerBL.GetData(customerID);

            if (customer != null)
            {
                _view.CustomerID   = customerID;
                _view.CustomerName = customer.CustomerName;
            }
        }
Beispiel #26
0
        public string PilihSupplier()
        {
            var result       = "";
            var searchForm   = new SearchingForm <SupplierSearchModel>(_supplierBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                result = searchForm.SelectedDataKey;
            }
            var supplier = _supplierBL.GetData(result);

            if (supplier != null)
            {
                _view.SupplierName = supplier.SupplierName;
                _view.Alamat       = supplier.Alamat;
                _view.NoTelp       = supplier.NoTelp;
            }

            return(result);
        }
Beispiel #27
0
        public void PilihReceipt()
        {
            var searchForm   = new SearchingForm <ReceiptSearchResultModel>(_receiptBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var receiptID = searchForm.SelectedDataKey;
                var receipt   = _receiptBL.GetData(receiptID);
                if (receipt == null)
                {
                    return;
                }
                _view.ReceiptID    = receipt.ReceiptID;
                _view.Tgl          = receipt.Tgl;
                _view.Jam          = receipt.Jam;
                _view.PurchaseID   = receipt.PurchaseID;
                _view.SupplierID   = receipt.SupplierID;
                _view.SupplierName = receipt.SupplierName;
                _view.Catatan      = receipt.Keterangan;
                var tempList = receipt.ListBrg.ToList();
                tempList.Add(new ReceiptDetilModel());

                _view.ListBrg = tempList;

                _view.BiayaLain  = receipt.BiayaLain;
                _view.DiskonLain = receipt.Diskon;

                CalculateTotal();

                var supplier = _supplierBL.GetData(receipt.SupplierID);
                if (supplier == null)
                {
                    return;
                }
                _view.Alamat = supplier.Alamat;
                _view.NoTelp = supplier.NoTelp;
            }
        }
Beispiel #28
0
        public void PilihPurchase()
        {
            var searchForm   = new SearchingForm <PurchaseSearchResultModel>(_purchaseBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var purchaseID = searchForm.SelectedDataKey;
                var purchase   = _purchaseBL.GetData(purchaseID);
                if (purchase == null)
                {
                    return;
                }
                _view.PurchaseID   = purchase.PurchaseID;
                _view.Tgl          = purchase.Tgl;
                _view.Jam          = purchase.Jam;
                _view.SupplierID   = purchase.SupplierID;
                _view.SupplierName = purchase.SupplierName;
                _view.Catatan      = purchase.Keterangan;
                _view.IsClosedPO   = purchase.IsClosed;
                var tempList = purchase.ListBrg.ToList();
                tempList.Add(new PurchaseDetilModel());

                _view.ListBrg = tempList;

                _view.BiayaLain  = purchase.BiayaLain;
                _view.DiskonLain = purchase.Diskon;

                CalculateTotal();

                var supplier = _supplierBL.GetData(purchase.SupplierID);
                if (supplier == null)
                {
                    return;
                }
                _view.Alamat = supplier.Alamat;
                _view.NoTelp = supplier.NoTelp;
            }
        }
        public string PilihPegawai()
        {
            var result       = "";
            var searchForm   = new SearchingForm <PegawaiSearchModel>(_pegawaiBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                result = searchForm.SelectedDataKey;
            }
            var pegawai = _pegawaiBL.GetData(result);

            if (pegawai != null)
            {
                _view.PegawaiID   = result;
                _view.PegawaiName = pegawai.PegawaiName;
                _view.Alamat      = pegawai.Alamat;
                _view.NoTelp      = pegawai.NoTelp;
            }

            return(result);
        }
        public void PilihPurchase()
        {
            var searchForm   = new SearchingForm <OrderJualSearchModel>(_orderJualBL);
            var resultDialog = searchForm.ShowDialog();

            if (resultDialog == DialogResult.OK)
            {
                var orderJualID = searchForm.SelectedDataKey;
                var orderJual   = _orderJualBL.GetData(orderJualID);
                if (orderJual == null)
                {
                    return;
                }
                _view.OrderJualID  = orderJual.OrderJualID;
                _view.TglOrderJual = orderJual.TglOrderJual;
                _view.JamOrderJual = orderJual.JamOrderJual;
                _view.CustomerID   = orderJual.CustomerID;
                _view.BuyerName    = orderJual.BuyerName;
                _view.Catatan      = orderJual.Catatan;

                var tempList = orderJual.ListBrg.ToList();
                tempList.Add(new OrderJual2Model());

                _view.ListBrg = tempList;

                _view.NilaiBiayaLain  = orderJual.NilaiBiayaLain;
                _view.NilaiDiskonLain = orderJual.NilaiDiskonLain;

                CalculateTotal();

                var customer = _customerBL.GetData(orderJual.CustomerID);
                if (customer == null)
                {
                    return;
                }
                _view.Alamat   = customer.Alamat1;
                _view.NoTelpon = customer.NoTelp;
            }
        }