Exemplo n.º 1
0
        protected override void PerformPrint()
        {
            var dlg = new FrmRevenueNormal();
            var res = dlg.ShowDialog();

            decimal sum = 0;
            var fr = dteFrom.DateTime;
            var to = dteTo.DateTime;
            var frm = new FrmPrint();

            switch (res)
            {
                case DialogResult.OK: // bảng kê xe tải lưu đậu
                    var tb = _bll.Tra_Detail.GetRevenueNormal(out sum, fr, to, DAL.Tra_DetailDAL.Group.A);

                    var rpt1 = new Report.Rpt_RevenueNormal1
                    {
                        Name = String.Format("{0}{1:_dd.MM.yyyy_HH.mm.ss}_n1",
                        Global.Session.User.Acc, Global.Session.Current),
                        DataSource = tb
                    };

                    rpt1.parTitle1.Value = Global.Title1;
                    rpt1.parTitle2.Value = Global.Title2;
                    rpt1.parUserOut.Value = Global.Session.User.Name;
                    rpt1.parDate.Value = to;
                    rpt1.xrcWatch.Text = String.Format("{0:HH:mm} - {1:HH:mm}", fr, to);
                    rpt1.xrcMoney.Text = sum.ToVietnamese("đồng");

                    frm.Text = String.Format("In: {0} - Số tiền: {1:#,0}", Text, sum);
                    frm.SetReport(rpt1);
                    break;

                case DialogResult.Yes: // bảng kê xe sang hàng
                    tb = _bll.Tra_Detail.GetRevenueNormal(out sum, fr, to, DAL.Tra_DetailDAL.Group.B);

                    var rpt2 = new Report.Rpt_RevenueNormal2
                    {
                        Name = String.Format("{0}{1:_dd.MM.yyyy_HH.mm.ss}_n2",
                        Global.Session.User.Acc, Global.Session.Current),
                        DataSource = tb
                    };

                    rpt2.parTitle1.Value = Global.Title1;
                    rpt2.parTitle2.Value = Global.Title2;
                    rpt2.parUserOut.Value = Global.Session.User.Name;
                    rpt2.parDate.Value = to;
                    rpt2.xrcWatch.Text = String.Format("{0:HH:mm} - {1:HH:mm}", fr, to);
                    rpt2.xrcMoney.Text = sum.ToVietnamese("đồng");

                    frm.Text = String.Format("In: {0} - Số tiền: {1:#,0}", Text, sum);
                    frm.SetReport(rpt2);
                    break;

                case DialogResult.No: // bảng kê xe khách vãng lai
                    tb = _bll.Tra_Detail.GetRevenueNormal(out sum, fr, to, DAL.Tra_DetailDAL.Group.C);

                    var rpt3 = new Report.Rpt_RevenueNormal3
                    {
                        Name = String.Format("{0}{1:_dd.MM.yyyy_HH.mm.ss}_n2",
                        Global.Session.User.Acc, Global.Session.Current),
                        DataSource = tb
                    };

                    rpt3.parTitle1.Value = Global.Title1;
                    rpt3.parTitle2.Value = Global.Title2;
                    rpt3.parUserOut.Value = Global.Session.User.Name;
                    rpt3.parDate.Value = to;
                    rpt3.xrcWatch.Text = String.Format("{0:HH:mm} - {1:HH:mm}", fr, to);
                    rpt3.xrcMoney.Text = sum.ToVietnamese("đồng");

                    frm.Text = String.Format("In: {0} - Số tiền: {1:#,0}", Text, sum);
                    frm.SetReport(rpt3);
                    break;

                case DialogResult.Cancel: // báo cáo
                    tb = _bll.Tra_Detail.SumaryReportNormal(out sum, fr, to);

                    var rpt4 = new Report.Rpt_ReportNormal
                    {
                        Name = String.Format(Level1.STR_DT,
                        Global.Session.User.Acc, Global.Session.Current),
                        DataSource = tb
                    };

                    var sub1 = new Report.Rpt_ReportNormal1() { DataSource = tb };
                    rpt4.xrSubreport1.ReportSource = sub1;

                    var sub2 = new Report.Rpt_ReportNormal2() { DataSource = tb };
                    rpt4.xrSubreport2.ReportSource = sub2;

                    rpt4.parTitle1.Value = Global.Title1;
                    rpt4.parTitle2.Value = Global.Title2;
                    rpt4.parNum.Value = Global.AuditNumber;
                    rpt4.parDate.Value = to;
                    rpt4.parTotal.Value = sum;
                    rpt4.parUserOut.Value = Global.Session.User.Name;

                    var count = tb.Compute("Sum(CountFullDay)", "").ToInt32()
                        + tb.Compute("Sum(CountHalfDay)", "").ToInt32();

                    var vote = tb.Compute("Sum(FullDay)", "").ToInt32()
                        + tb.Compute("Sum(HalfDay)", "").ToInt32();

                    rpt4.parCount.Value = tb == null ? 0 : count;
                    rpt4.parFullDay.Value = tb == null ? 0 : vote;

                    var duration = "(Từ {0} ngày {1} đến {2} ngày {3})";
                    duration = String.Format(duration,
                      fr.ToStringTimeVN(), fr.ToStringDateVN(),
                      to.ToStringTimeVN(), to.ToStringDateVN());
                    rpt4.xrlFromTo.Text = duration;

                    frm.Text = String.Format("In: {0} - Số tiền: {1:#,0}", Text, sum);
                    frm.SetReport(rpt4);
                    break;
            }

            frm.WindowState = FormWindowState.Maximized;
            frm.ShowDialog();

            base.PerformPrint();
        }
Exemplo n.º 2
0
        protected override void PerformPrint()
        {
            var rpt = new Report.Rpt_TariffFixed
            {
                DataSource = _dtb,
                Name = String.Format("{0}{1:_dd.MM.yyyy_HH.mm.ss}_bg",
                Global.Session.User.Acc, Global.Session.Current)
            };

            rpt.parTitle1.Value = Global.Title1;
            rpt.parTitle2.Value = Global.Title2;
            rpt.parDate.Value = Global.Session.Current;
            rpt.parDate.Value = Global.Session.Current;
            rpt.parUserOut.Value = Global.Session.User.Name;

            var frm = new FrmPrint();
            frm.SetReport(rpt);
            frm.WindowState = FormWindowState.Maximized;
            frm.ShowDialog();

            base.PerformPrint();
        }
Exemplo n.º 3
0
        protected override void PerformPrint()
        {
            var oki = XtraMessageBox.Show(STR_CFM,
                Level1.STR_PRINT, MessageBoxButtons.YesNo);

            var receipt = "";
            var frm = new FrmPrint();
            decimal sum = 0;

            DateTime fr, to;
            Session.CutShiftMonth(dteMonth.DateTime, out fr, out to);

            if (oki == DialogResult.Yes)
            {
                var rpt = new Report.Rpt_ReportFixed
                {
                    Name = String.Format(Level1.STR_DT,
                    Global.Session.User.Acc, Global.Session.Current),
                    DataSource = _bll.Tra_Detail.GetRevenueFixed(out sum, out receipt, fr, to)
                };

                rpt.parTitle1.Value = Global.Title1;
                rpt.parTitle2.Value = Global.Title2;
                rpt.parAddress.Value = Global.Address;
                rpt.parTaxcode.Value = Global.Taxcode;
                rpt.xrlTitle.Text = String.Format(rpt.xrlTitle.Text,
                    fr.ToStringDateVN(), to.ToStringDateVN());

                var duration = "(Từ {0} ngày {1} đến {2} ngày {3})";
                duration = String.Format(duration,
                  fr.ToStringTimeVN(), fr.ToStringDateVN(),
                  to.ToStringTimeVN(), to.ToStringDateVN());

                rpt.xrlFromTo.Text = duration;
                frm.SetReport(rpt);
            }
            else
            {
                var rpt4 = new Report.Rpt_AuditMonthSgtvt
                {
                    Name = String.Format("{0}{1:_dd.MM.yyyy_HH.mm.ss}_tdt",
                    Global.Session.User.Acc, Global.Session.Current)
                };

                rpt4.DataSource = _bll.Tra_Detail.AuditMonthFixedSgtvt(fr, to);
                rpt4.xrlTitle.Text += dteMonth.DateTime.ToString(" MM/yyyy");

                rpt4.parTitle1.Value = Global.Title1;
                rpt4.parTitle2.Value = Global.Title2;
                rpt4.parNum.Value = Global.AuditNumber;
                rpt4.parDate.Value = Global.Session.Current;
                frm.SetReport(rpt4);
            }

            frm.WindowState = FormWindowState.Maximized;
            frm.ShowDialog();

            base.PerformPrint();
        }
Exemplo n.º 4
0
        protected override void PerformPrint()
        {
            var oki = XtraMessageBox.Show(Level1.STR_CFM,
                Level1.STR_PRINT, MessageBoxButtons.YesNo);

            var receipt = "";
            var to = dteTo.DateTime.Date.AddTicks(Global.CutsFr.Ticks);
            var fr = dteFrom.DateTime.Date.AddTicks(Global.CutsFr.Ticks).AddSeconds(1);

            var tb = _bll.Tra_Detail.GetRevenueFixed(out _sum, out receipt, fr, to);
            var frm = new FrmPrint() { Text = String.Format("In: {0} - Số tiền: {1:#,#}", Text, _sum) };

            if (oki == DialogResult.Yes)
            {
                var rpt = new Report.Rpt_ReportFixed
                {
                    Name = String.Format(Level1.STR_DT,
                    Global.Session.User.Acc, Global.Session.Current),
                    DataSource = tb
                };

                rpt.parTitle1.Value = Global.Title1;
                rpt.parTitle2.Value = Global.Title2;
                rpt.parAddress.Value = Global.Address;
                rpt.parTaxcode.Value = Global.Taxcode;
                rpt.xrlTitle.Text = String.Format(rpt.xrlTitle.Text,
                    fr.ToStringDateVN(), to.ToStringDateVN());

                var duration = "(Từ {0} ngày {1} đến {2} ngày {3})";
                duration = String.Format(duration,
                  fr.ToStringTimeVN(), fr.ToStringDateVN(),
                  to.ToStringTimeVN(), to.ToStringDateVN());

                rpt.xrlFromTo.Text = duration;
                frm.SetReport(rpt);
            }
            else
            {
                var rpt = new Report.Rpt_RevenueFixed
                {
                    Name = String.Format(Level1.STR_DT,
                    Global.Session.User.Acc, Global.Session.Current),
                    DataSource = tb
                };

                rpt.parTitle1.Value = Global.Title1;
                rpt.parTitle2.Value = Global.Title2;
                rpt.parAddress.Value = Global.Address;
                rpt.parTaxcode.Value = Global.Taxcode;
                rpt.parDate.Value = to;

                //rpt.xrlCashier.Text = Global.Session.User.Name;
                //rpt.xrcMoney.Text = _sum.ToVietnamese("đồng");
                //rpt.xrlSophieu.Text = "Số phiếu: " + receipt;

                var duration = "(Từ {0} ngày {1} đến {2} ngày {3})";
                duration = String.Format(duration,
                  fr.ToStringTimeVN(), fr.ToStringDateVN(),
                  to.ToStringTimeVN(), to.ToStringDateVN());

                rpt.xrlFromTo.Text = duration;
                frm.SetReport(rpt);
            }

            frm.WindowState = FormWindowState.Maximized;
            frm.ShowDialog();

            base.PerformPrint();
        }
Exemplo n.º 5
0
        /// <summary>
        /// In bảng kê và báo cáo xe cố định từ 13:00 hôm trước đến 13:00 hôm nay
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdSumaryFixed_Click(object sender, EventArgs e)
        {
            var oki = XtraMessageBox.Show(Level1.STR_CFM,
                Level1.STR_PRINT, MessageBoxButtons.YesNo);

            var receipt = "";
            DateTime fr, to;
            Session.CutShiftDay(Global.Session.Current, out fr, out to);

            decimal _sum = 0;
            var tb = _bll.Tra_Detail.GetRevenueFixed(out _sum, out receipt, fr, to);
            var frm = new FrmPrint() { Text = String.Format("In: {0} - Số tiền: {1:#,#}", Text, _sum) };

            if (oki == DialogResult.Yes)
            {
                var rpt = new Report.Rpt_ReportFixed
                {
                    Name = String.Format(Level1.STR_DT,
                    Global.Session.User.Acc, Global.Session.Current),
                    DataSource = tb
                };

                rpt.parTitle1.Value = Global.Title1;
                rpt.parTitle2.Value = Global.Title2;
                rpt.parAddress.Value = Global.Address;
                rpt.parTaxcode.Value = Global.Taxcode;
                rpt.xrlTitle.Text = String.Format(rpt.xrlTitle.Text,
                    fr.ToStringDateVN(), to.ToStringDateVN());

                var duration = "(Từ {0} ngày {1} đến {2} ngày {3})";
                duration = String.Format(duration,
                  fr.ToStringTimeVN(), fr.ToStringDateVN(),
                  to.ToStringTimeVN(), to.ToStringDateVN());

                rpt.xrlFromTo.Text = duration;
                frm.SetReport(rpt);
            }
            else
            {
                var rpt = new Report.Rpt_RevenueFixed
                {
                    Name = String.Format(Level1.STR_DT,
                    Global.Session.User.Acc, Global.Session.Current),
                    DataSource = tb
                };

                rpt.parTitle1.Value = Global.Title1;
                rpt.parTitle2.Value = Global.Title2;
                rpt.parAddress.Value = Global.Address;
                rpt.parTaxcode.Value = Global.Taxcode;
                rpt.parDate.Value = to;

                //rpt.xrlCashier.Text = Global.Session.User.Name;
                //rpt.xrcMoney.Text = _sum.ToVietnamese("đồng");
                //rpt.xrlSophieu.Text = "Số phiếu: " + receipt;

                var duration = "(Từ {0} ngày {1} đến {2} ngày {3})";
                duration = String.Format(duration,
                  fr.ToStringTimeVN(), fr.ToStringDateVN(),
                  to.ToStringTimeVN(), to.ToStringDateVN());

                rpt.xrlFromTo.Text = duration;
                frm.SetReport(rpt);
            }

            frm.WindowState = FormWindowState.Maximized;
            frm.ShowDialog();
        }
Exemplo n.º 6
0
        /// <summary>
        /// In bảng kê nhóm 1 - xe tải lưu đậu nhóm xe vãng lai
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdPrintIngate_Click(object sender, EventArgs e)
        {
            var rpt = new Report.Rpt_IngateMaster
            {
                Name = String.Format("{0}{1:_dd.MM.yyyy_HH.mm.ss}_tb",
                Global.Session.User.Acc, Global.Session.Current)
            };

            rpt.parTitle1.Value = Global.Title1;
            rpt.parTitle2.Value = Global.Title2;
            rpt.parDate.Value = Global.Session.Current;

            var tb = _bll.Tra_Detail.GetInDepotFixed();
            tb.Numbered();
            var sub = new Report.Rpt_Ingate() { DataSource = tb };
            rpt.xrSubreport1.ReportSource = sub;

            tb = _bll.Tra_Detail.GetInDepotNormal();
            tb.Numbered();
            sub = new Report.Rpt_Ingate() { DataSource = tb };
            rpt.xrSubreport2.ReportSource = sub;

            rpt.parDate.Value = Global.Session.Current;
            rpt.parUserOut.Value = Global.Session.User.Name;

            var frm = new FrmPrint();
            frm.SetReport(rpt);

            frm.WindowState = FormWindowState.Maximized;
            frm.ShowDialog();
        }
Exemplo n.º 7
0
        protected override void PerformPrint()
        {
            var rpt = new Report.Rpt_DebtMonth
            {
                Name = String.Format("{0}{1:_dd.MM.yyyy_HH.mm.ss}_cnt",
                Global.Session.User.Acc, Global.Session.Current)
            };

            DateTime fr, to;
            Session.CutShiftMonth(dteMonth.DateTime, out fr, out to);

            rpt.DataSource = _bll.Tra_Detail.DebtMonthFixed(fr, to,
                chkHideActive.Checked);
            rpt.xrlCashier.Text = Global.Session.User.Name;
            rpt.xrlTitle.Text += dteMonth.DateTime.ToString(" MM/yyyy");
            rpt.xrlThuchien.Text += dteMonth.DateTime.ToString(" MM/yyyy");

            rpt.parTitle1.Value = Global.Title2;
            rpt.parTitle2.Value = Global.Title3;
            rpt.parDate.Value = Global.Session.Current;

            var frm = new FrmPrint();
            frm.SetReport(rpt);
            frm.WindowState = FormWindowState.Maximized;
            frm.ShowDialog();

            base.PerformPrint();
        }