Ejemplo n.º 1
0
        private void LpPembelian_Click(object sender, RoutedEventArgs e)
        {
            var form = new ReportFilter();
            var vm   = new ReportFilterViewModel("LAPORAN PEMBELIAN")
            {
                WindowClose = form.Close
            };

            form.DataContext = vm;
            form.ShowDialog();
            if (vm.IsValid)
            {
                var context = new Datas.Contexts.TransaksiPembelianContext();

                var datas = context.GetDataReportPembelian().Where(x =>
                                                                   x.Tanggal.Value.Day >= vm.FromDate.Value.Day &&
                                                                   x.Tanggal.Value.Month >= vm.FromDate.Value.Month &&
                                                                   x.Tanggal.Value.Year >= vm.FromDate.Value.Year &&
                                                                   x.Tanggal.Value.Day <= vm.ToDate.Value.Day &&
                                                                   x.Tanggal.Value.Month <= vm.ToDate.Value.Month &&
                                                                   x.Tanggal.Value.Year <= vm.FromDate.Value.Year);

                HelperPrint.PrintPreviewWithFormAction("Print Preview",
                                                       new ReportDataSource {
                    Name = "DataSet1", Value = datas
                },
                                                       "MainApp.Reports.Layouts.LaporanPembelian.rdlc",
                                                       new ReportParameter[] {
                    new ReportParameter("Dari", vm.FromDate.Value.ToShortDateString()),
                    new ReportParameter("Sampai", vm.ToDate.Value.ToShortDateString())
                });
            }
        }
Ejemplo n.º 2
0
        private void LpUtang_Click(object sender, RoutedEventArgs e)
        {
            var context = new Datas.Contexts.TransaksiPembelianContext();

            var datas = from a in context.Source.Where(x => x.Pembayaran == StatusPembayaran.Kredit && x.Pelunasan == StatusPelunasan.Belum)
                        select new PembelianModel()
            {
                Tanggal     = a.Tanggal,
                Details     = a.Details,
                JatuhTempo  = a.JatuhTempo,
                Supplier    = a.Supplier,
                NomorFaktur = a.NomorFaktur,
                Pelunasan   = a.Pelunasan,
                Pembayaran  = a.Pembayaran,

                Total = a.Total
            };


            HelperPrint.PrintPreviewWithFormAction("Print Preview",
                                                   new ReportDataSource {
                Name = "DataSet1", Value = datas.ToList()
            },
                                                   "MainApp.Reports.Layouts.LaporanUtang.rdlc", null);
        }