/// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="paramBillPaperSize"></param>
        private void LoadTransferBill(BillPaperSize paramBillPaperSize)
        {
            reportViewer1.Reset();
            string rdlcFileName = string.Empty;

            switch (paramBillPaperSize)
            {
            case BillPaperSize.CustomerSize:
                rdlcFileName = "PIS_ViewAndPrintTransferBill2228_" + @".rdlc";
                break;

            case BillPaperSize.A4Size:
                rdlcFileName = "PIS_ViewAndPrintTransferBill_" + @".rdlc";
                break;

            case BillPaperSize.A5Size:
                rdlcFileName = "PIS_ViewAndPrintTransferBillA5_" + @".rdlc";
                break;

            case BillPaperSize.A4SizeFull:
                rdlcFileName = "PIS_ViewAndPrintTransferBillA4Full_" + @".rdlc";
                break;
            }
            string reportFilePath = Application.StartupPath + @"\RdlcFiles\" + rdlcFileName;

            if (!File.Exists(reportFilePath))
            {
                switch (paramBillPaperSize)
                {
                case BillPaperSize.CustomerSize:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintTransferBill2228.rdlc";
                    break;

                case BillPaperSize.A4Size:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintTransferBill.rdlc";
                    break;

                case BillPaperSize.A5Size:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintTransferBillA5.rdlc";
                    break;

                case BillPaperSize.A4SizeFull:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintTransferBillA4Full.rdlc";
                    break;
                }
            }
            if (File.Exists(reportFilePath))
            {
                reportViewer1.LocalReport.ReportPath = reportFilePath;
                reportViewer1.LocalReport.DataSources.Clear();
                List <TransferBillUIModelToPrint> billList = new List <TransferBillUIModelToPrint> {
                    _transferBill
                };
                ReportDataSource rpd1 = new ReportDataSource(PISViewParamKey.TransferBill.ToString(), billList as object);
                reportViewer1.LocalReport.DataSources.Add(rpd1);
                ReportDataSource rpd2 = new ReportDataSource(PISViewParamKey.TransferBillDetail.ToString(), _transferBillDetailList as object);
                reportViewer1.LocalReport.DataSources.Add(rpd2);

                //查询调入组织信息
                MDLSM_Organization transferInOrganization = new MDLSM_Organization();
                _bll.QueryForObject <MDLSM_Organization, MDLSM_Organization>(new MDLSM_Organization
                {
                    WHERE_Org_ID = _transferBill.TB_TransferInOrgId,
                }, transferInOrganization);

                //调入方信息
                ReportParameter rp1 = new ReportParameter("TransferInOrgName", string.IsNullOrEmpty(_transferBill.TB_TransferInOrgName) ? SysConst.SPACE : _transferBill.TB_TransferInOrgName);
                ReportParameter rp2 = new ReportParameter("TransferInOrgPhone", string.IsNullOrEmpty(transferInOrganization.Org_TEL) ? SysConst.SPACE : transferInOrganization.Org_TEL);
                ReportParameter rp3 = new ReportParameter("TransferBillNo", _transferBill.TB_No);

                //调出方信息
                //查询调出组织信息
                MDLSM_Organization transferOutOrganization = new MDLSM_Organization();
                if (_transferBill.TB_TransferInOrgId == _transferBill.TB_TransferOutOrgId)
                {
                    transferOutOrganization = transferInOrganization;
                }
                else
                {
                    _bll.QueryForObject <MDLSM_Organization, MDLSM_Organization>(new MDLSM_Organization
                    {
                        WHERE_Org_ID = _transferBill.TB_TransferOutOrgId,
                    }, transferOutOrganization);
                }
                ReportParameter rp4  = new ReportParameter("TransferOutOrgName", string.IsNullOrEmpty(_transferBill.TB_TransferOutOrgName) ? SysConst.SPACE : _transferBill.TB_TransferOutOrgName);
                ReportParameter rp5  = new ReportParameter("TransferOutOrgAddress", string.IsNullOrEmpty(transferOutOrganization.Org_Addr) ? SysConst.SPACE : transferOutOrganization.Org_Addr);
                ReportParameter rp6  = new ReportParameter("TransferOutOrgTel", string.IsNullOrEmpty(transferOutOrganization.Org_TEL) ? SysConst.SPACE : transferOutOrganization.Org_TEL);
                ReportParameter rp7  = new ReportParameter("TransferOutOrgMainProducts", string.IsNullOrEmpty(transferOutOrganization.Org_MainProducts) ? SysConst.SPACE : transferOutOrganization.Org_MainProducts);
                ReportParameter rp8  = new ReportParameter("CreatedBy", string.IsNullOrEmpty(_transferBill.TB_CreatedBy) ? SysConst.SPACE : _transferBill.TB_CreatedBy);
                ReportParameter rp9  = new ReportParameter("TotalAmount", _transferBill.TotalAmount.ToString());
                ReportParameter rp10 = new ReportParameter("TotalAmountString", ConvertMoneyNum(_transferBill.TotalAmount));
                ReportParameter rp11 = new ReportParameter("TotalQty", _transferBill.TotalQty.ToString());

                this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1, rp2, rp3, rp4, rp5, rp6, rp7, rp8, rp9, rp10, rp11 });

                //设置打印布局模式,显示物理页面大小
                reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                //缩放模式为百分比,以100%方式显示
                reportViewer1.ZoomMode    = ZoomMode.Percent;
                reportViewer1.ZoomPercent = 100;
                reportViewer1.RefreshReport();
                reportViewer1.Refresh();
            }
            else
            {
                MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[]
                                                                            { SystemActionEnum.Name.PRINT }), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
 /// <summary>
 /// A5尺寸
 /// </summary>
 private void ExecutePrintA5Size()
 {
     _paperSize = BillPaperSize.A5Size;
     LoadTransferBill(_paperSize);
 }
 /// <summary>
 /// A4尺寸充满
 /// </summary>
 private void ExecutePrintA4SizeFull()
 {
     _paperSize = BillPaperSize.A4SizeFull;
     LoadTransferBill(_paperSize);
 }
Esempio n. 4
0
 /// <summary>
 /// A4尺寸充满
 /// </summary>
 private void ExecutePrintA4SizeFull()
 {
     _paperSize = BillPaperSize.A4SizeFull;
     LoadSalesOrder(_paperSize);
 }
Esempio n. 5
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="paramBillPaperSize"></param>
        private void LoadSalesOrder(BillPaperSize paramBillPaperSize)
        {
            reportViewer1.Reset();
            string rdlcFileName = string.Empty;

            switch (paramBillPaperSize)
            {
            case BillPaperSize.CustomerSize:
                rdlcFileName = "SD_ViewAndPrintSalesOrder2228_" + @".rdlc";
                break;

            case BillPaperSize.A4Size:
                rdlcFileName = "SD_ViewAndPrintSalesOrder_" + @".rdlc";
                break;

            case BillPaperSize.A5Size:
                rdlcFileName = "SD_ViewAndPrintSalesOrderA5_" + @".rdlc";
                break;

            case BillPaperSize.A4SizeFull:
                rdlcFileName = "SD_ViewAndPrintSalesOrderA4Full_" + @".rdlc";
                break;
            }
            string reportFilePath = Application.StartupPath + @"\RdlcFiles\" + rdlcFileName;

            if (!File.Exists(reportFilePath))
            {
                switch (paramBillPaperSize)
                {
                case BillPaperSize.CustomerSize:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\SD_ViewAndPrintSalesOrder2228.rdlc";
                    break;

                case BillPaperSize.A4Size:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\SD_ViewAndPrintSalesOrder.rdlc";
                    break;

                case BillPaperSize.A5Size:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\SD_ViewAndPrintSalesOrderA5.rdlc";
                    break;

                case BillPaperSize.A4SizeFull:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\SD_ViewAndPrintSalesOrderA4Full.rdlc";
                    break;
                }
            }
            if (File.Exists(reportFilePath))
            {
                reportViewer1.LocalReport.ReportPath = reportFilePath;
                reportViewer1.LocalReport.DataSources.Clear();

                ReportDataSource rpd2 = new ReportDataSource(SDViewParamKey.SalesOrderDetail.ToString(), _salesOrderDetailList as object);
                reportViewer1.LocalReport.DataSources.Add(rpd2);

                //购买方信息
                ReportParameter rp1 = new ReportParameter("CustomerName", _salesOrder.SO_CustomerTypeName == CustomerTypeEnum.Name.PTNQXSH ? _salesOrder.AROrgName : _salesOrder.SO_CustomerName);
                ReportParameter rp2 = new ReportParameter("CustomerPhone", _salesOrder.SO_CustomerTypeName == CustomerTypeEnum.Name.PTNQXSH ? _salesOrder.AROrgPhone : _salesOrder.CustomerPhoneNo);
                ReportParameter rp3 = new ReportParameter("SalesOrderNo", _salesOrder.SO_No);

                //销售方信息
                ReportParameter rp4 = new ReportParameter("OrgName", string.IsNullOrEmpty(LoginInfoDAX.OrgShortName) ? SysConst.SPACE : LoginInfoDAX.OrgShortName);
                //查询当前组织信息
                MDLSM_Organization resultOrganization = new MDLSM_Organization();
                _bll.QueryForObject <MDLSM_Organization, MDLSM_Organization>(new MDLSM_Organization
                {
                    WHERE_Org_ID = LoginInfoDAX.OrgID,
                }, resultOrganization);
                ReportParameter rp5 = new ReportParameter("OrgAddress", string.IsNullOrEmpty(resultOrganization.Org_Addr) ? SysConst.SPACE : resultOrganization.Org_Addr);
                ReportParameter rp6 = new ReportParameter("OrgTEL", string.IsNullOrEmpty(LoginInfoDAX.OrgTEL) ? SysConst.SPACE : LoginInfoDAX.OrgTEL);
                ReportParameter rp7 = new ReportParameter("OrgMainProducts", string.IsNullOrEmpty(resultOrganization.Org_MainProducts) ? SysConst.SPACE : resultOrganization.Org_MainProducts);
                ReportParameter rp8 = new ReportParameter("CreatedBy", string.IsNullOrEmpty(_salesOrder.SO_CreatedBy) ? SysConst.SPACE : _salesOrder.SO_CreatedBy);
                _salesOrder.SO_TotalAmount = Math.Round(_salesOrder.SO_TotalAmount ?? 0, 2);
                ReportParameter rp9  = new ReportParameter("TotalAmount", _salesOrder.SO_TotalAmount.ToString());
                ReportParameter rp10 = new ReportParameter("TotalAmountString", ConvertMoneyNum((decimal)(_salesOrder.SO_TotalAmount ?? 0)));
                ReportParameter rp11 = new ReportParameter("TotalQty", _salesOrder.TotalSalesQty.ToString());
                ReportParameter rp12 = new ReportParameter("CreatedTime", _salesOrder.SO_CreatedTime == null ? SysConst.SPACE : _salesOrder.SO_CreatedTime.ToString("yyyy-MM-dd"));

                this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1, rp2, rp3, rp4, rp5, rp6, rp7, rp8, rp9, rp10, rp11, rp12 });

                //设置打印布局模式,显示物理页面大小
                reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                //缩放模式为百分比,以100%方式显示
                reportViewer1.ZoomMode    = ZoomMode.Percent;
                reportViewer1.ZoomPercent = 100;
                reportViewer1.RefreshReport();
                reportViewer1.Refresh();
            }
            else
            {
                MessageBoxs.Show(Trans.SD, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[]
                                                                           { SystemActionEnum.Name.PRINT }), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="paramBillPaperSize"></param>
        private void LoadLogisticsBill(BillPaperSize paramBillPaperSize)
        {
            reportViewer1.Reset();
            string rdlcFileName = string.Empty;

            switch (paramBillPaperSize)
            {
            case BillPaperSize.CustomerSize:
                rdlcFileName = "SD_ViewAndPrintLogisticsBill2228_" + @".rdlc";
                break;

            case BillPaperSize.A4Size:
                rdlcFileName = "SD_ViewAndPrintLogisticsBill_" + @".rdlc";
                break;

            case BillPaperSize.A5Size:
                rdlcFileName = "SD_ViewAndPrintLogisticsBillA5_" + @".rdlc";
                break;

            case BillPaperSize.A4SizeFull:
                rdlcFileName = "SD_ViewAndPrintLogisticsBillA4Full_" + @".rdlc";
                break;
            }
            string reportFilePath = Application.StartupPath + @"\RdlcFiles\" + rdlcFileName;

            if (!File.Exists(reportFilePath))
            {
                switch (paramBillPaperSize)
                {
                case BillPaperSize.CustomerSize:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\SD_ViewAndPrintLogisticsBill2228.rdlc";
                    break;

                case BillPaperSize.A4Size:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\SD_ViewAndPrintLogisticsBill.rdlc";
                    break;

                case BillPaperSize.A5Size:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\SD_ViewAndPrintLogisticsBillA5.rdlc";
                    break;

                case BillPaperSize.A4SizeFull:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\SD_ViewAndPrintLogisticsBillA4Full.rdlc";
                    break;
                }
            }
            if (File.Exists(reportFilePath))
            {
                reportViewer1.LocalReport.ReportPath = reportFilePath;
                reportViewer1.LocalReport.DataSources.Clear();
                List <LogisticsBillUIModelToPrint> billList = new List <LogisticsBillUIModelToPrint> {
                    _logisticsBill
                };
                ReportDataSource rpd1 = new ReportDataSource(SDViewParamKey.LogisticsBill.ToString(), billList as object);
                reportViewer1.LocalReport.DataSources.Add(rpd1);

                ReportDataSource rpd2 = new ReportDataSource(SDViewParamKey.LogisticsBillDetail.ToString(), _logisticsBillDetailList as object);
                reportViewer1.LocalReport.DataSources.Add(rpd2);
                ReportParameter rp1 = new ReportParameter("Org_Name", LoginInfoDAX.User_PrintTitlePrefix);

                this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1 });

                //设置打印布局模式,显示物理页面大小

                reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                //缩放模式为百分比,以100%方式显示
                reportViewer1.ZoomMode    = ZoomMode.Percent;
                reportViewer1.ZoomPercent = 100;
                reportViewer1.RefreshReport();
                reportViewer1.Refresh();
            }
            else
            {
                MessageBoxs.Show(Trans.FM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[]
                                                                           { SystemActionEnum.Name.PRINT }), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
Esempio n. 7
0
 /// <summary>
 /// A5尺寸
 /// </summary>
 private void ExecutePrintA5Size()
 {
     _paperSize = BillPaperSize.A5Size;
     LoadSalesOrder(_paperSize);
 }
 /// <summary>
 /// A5尺寸
 /// </summary>
 private void ExecutePrintA5Size()
 {
     _paperSize = BillPaperSize.A5Size;
     LoadLogisticsBill(_paperSize);
 }
 /// <summary>
 /// A4尺寸充满
 /// </summary>
 private void ExecutePrintA4SizeFull()
 {
     _paperSize = BillPaperSize.A4SizeFull;
     LoadLogisticsBill(_paperSize);
 }
 /// <summary>
 /// A4尺寸充满
 /// </summary>
 private void ExecutePrintA4SizeFull()
 {
     _paperSize = BillPaperSize.A4SizeFull;
     LoadStockInBill(_paperSize);
 }
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="paramBillPaperSize"></param>
        private void LoadStockInBill(BillPaperSize paramBillPaperSize)
        {
            reportViewer1.Reset();
            string rdlcFileName = string.Empty;

            switch (paramBillPaperSize)
            {
            case BillPaperSize.CustomerSize:
                rdlcFileName = "PIS_ViewAndPrintStockInBill2228_" + @".rdlc";
                break;

            case BillPaperSize.A4Size:
                rdlcFileName = "PIS_ViewAndPrintStockInBill_" + @".rdlc";
                break;

            case BillPaperSize.A5Size:
                rdlcFileName = "PIS_ViewAndPrintStockInBillA5_" + @".rdlc";
                break;

            case BillPaperSize.A4SizeFull:
                rdlcFileName = "PIS_ViewAndPrintStockInBillA4Full_" + @".rdlc";
                break;
            }
            string reportFilePath = Application.StartupPath + @"\RdlcFiles\" + rdlcFileName;

            if (!File.Exists(reportFilePath))
            {
                switch (paramBillPaperSize)
                {
                case BillPaperSize.CustomerSize:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintStockInBill2228.rdlc";
                    break;

                case BillPaperSize.A4Size:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintStockInBill.rdlc";
                    break;

                case BillPaperSize.A5Size:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintStockInBillA5.rdlc";
                    break;

                case BillPaperSize.A4SizeFull:
                    reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintStockInBillA4Full.rdlc";
                    break;
                }
            }
            if (File.Exists(reportFilePath))
            {
                reportViewer1.LocalReport.ReportPath = reportFilePath;
                reportViewer1.LocalReport.DataSources.Clear();

                ReportDataSource rpd1 = new ReportDataSource(PISViewParamKey.StockInBillDetail.ToString(), _stockInBillDetailList as object);
                reportViewer1.LocalReport.DataSources.Add(rpd1);

                //组织
                ReportParameter rp1 = new ReportParameter("OrgName", LoginInfoDAX.OrgShortName);
                //单号
                ReportParameter rp2 = new ReportParameter("BillNo", _stockInBill.SIB_No);
                //供应商
                ReportParameter rp3 = new ReportParameter("SupplierName", string.IsNullOrEmpty(_stockInBill.SUPP_Name) ? SysConst.SPACE : _stockInBill.SUPP_Name);
                //入库日期
                ReportParameter rp4 = new ReportParameter("CreatedTime", _stockInBill.SIB_CreatedTime == null ? SysConst.SPACE : _stockInBill.SIB_CreatedTime.ToString("yyyy-MM-dd"));
                //创建人
                ReportParameter rp5 = new ReportParameter("CreatedBy", string.IsNullOrEmpty(_stockInBill.SIB_CreatedBy) ? SysConst.SPACE : _stockInBill.SIB_CreatedBy);
                //合计数量
                ReportParameter rp6 = new ReportParameter("TotalQty", _stockInBill.TotalStockInQty.ToString());
                //合计金额
                ReportParameter rp7 = new ReportParameter("TotalAmount", _stockInBill.TotalAmount.ToString());
                //ReportParameter rp8 = new ReportParameter("TotalAmountString", ConvertMoneyNum((decimal)(_stockInBill.TotalAmount ?? 0)));

                this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1, rp2, rp3, rp4, rp5, rp6, rp7 });

                //设置打印布局模式,显示物理页面大小
                reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                //缩放模式为百分比,以100%方式显示
                reportViewer1.ZoomMode    = ZoomMode.Percent;
                reportViewer1.ZoomPercent = 100;
                reportViewer1.RefreshReport();
                reportViewer1.Refresh();
            }
            else
            {
                MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[]
                                                                            { SystemActionEnum.Name.PRINT }), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
 /// <summary>
 /// A5尺寸
 /// </summary>
 private void ExecutePrintA5Size()
 {
     _paperSize = BillPaperSize.A5Size;
     LoadStockInBill(_paperSize);
 }
 /// <summary>
 /// 客户尺寸
 /// </summary>
 private void ExecutePrintCustomerSize()
 {
     _paperSize = BillPaperSize.CustomerSize;
     LoadStockInBill(_paperSize);
 }
Esempio n. 14
0
 /// <summary>
 /// A4尺寸充满
 /// </summary>
 private void ExecutePrintA4SizeFull()
 {
     _paperSize = BillPaperSize.A4SizeFull;
     LoadReturnStockOutBill(_paperSize);
 }
Esempio n. 15
0
 /// <summary>
 /// A5尺寸
 /// </summary>
 private void ExecutePrintA5Size()
 {
     _paperSize = BillPaperSize.A5Size;
     LoadReturnStockOutBill(_paperSize);
 }
Esempio n. 16
0
 /// <summary>
 /// A4尺寸
 /// </summary>
 private void ExecutePrintA4Size()
 {
     _paperSize = BillPaperSize.A4Size;
     LoadStockOutBill(_paperSize);
 }