コード例 #1
0
ファイル: FrmTra_SalesFixed.cs プロジェクト: enrio/skg-pro
        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();
        }
コード例 #2
0
ファイル: FrmTra_AuditMonth.cs プロジェクト: enrio/skg-pro
        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();
        }
コード例 #3
0
ファイル: FrmTra_GateOut.cs プロジェクト: enrio/skg-pro
        /// <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();
        }