示例#1
0
        //private void btnPrintCard_Click(object sender, EventArgs e)
        //{
        //    List<ProductCard> lstPrdCard = null;
        //    try
        //    {
        //        if (this.cardSelect.SelectedCount > 0)
        //        {
        //            lstPrdCard = new List<ProductCard>(this.cardSelect.SelectedCount);
        //            for (int i = 0; i < this.cardSelect.SelectedCount; i++)
        //            {
        //                lstPrdCard.Add((ProductCard)this.cardSelect.GetSelectedRow(i));
        //            }

        //            this.PrintProductCard(this.txtJOB_NO.Text, this.PROD_SEQ_NO, lstPrdCard);

        //        }
        //        else
        //        {
        //            XtraMessageBox.Show(this, "Please Select Product Card to Print", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
        //    }
        //}

        //private void PrintProductCard(string qcReturnNo, string prodSEQNo, List<ProductCard> lstPrdCard)
        //{
        //    int printSeq = 0;
        //    try
        //    {
        //        base.BeginProcessing("Begin Load Report...", "Please Waiting for Loading Report");

        //        DataSet ds;

        //        using (QCReturnBLL qcReturnBll = new QCReturnBLL())
        //        {
        //            ds = qcReturnBll.PrintProductCardReport(qcReturnNo, prodSEQNo, lstPrdCard, this.USER_ID, out printSeq);
        //        }

        //        ReportViewer viewer = new ReportViewer();
        //        viewer.AutoCloseAfterPrint = true;

        //        RPT_PRODUCT_CARD rpt = new RPT_PRODUCT_CARD();

        //        rpt.DataSource = ds;
        //        rpt.Parameters["paramUserPrint"].Value = this.USER_ID;
        //        rpt.Parameters["paramPRODUCTION_TYPE"].Value = this.PRODUCTION_TYPE;
        //        rpt.CreateDocument();

        //        viewer.SetReport(rpt);

        //        viewer.LogPrintTime(printSeq);
        //        base.FinishedProcessing();
        //        viewer.ShowDialog();

        //    }
        //    catch (Exception ex)
        //    {
        //        base.FinishedProcessing();

        //        XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
        //    }
        //    finally
        //    {
        //        base.FinishedProcessing();
        //    }
        //}

        private void PrintProductCard_A4(string qcReturnNo, string prodSEQNo, List <ProductCard> lstPrdCard)
        {
            int printSeq = 0;

            try
            {
                base.BeginProcessing("Begin Load Report...", "Please Waiting for Loading Report");

                DataSet ds;

                using (QCReturnBLL qcReturnBll = new QCReturnBLL())
                {
                    ds = qcReturnBll.PrintProductCardReport(qcReturnNo, prodSEQNo, lstPrdCard, this.USER_ID, out printSeq);
                }

                ReportViewer viewer = new ReportViewer();
                viewer.AutoCloseAfterPrint = true;


                RPT_PRODUCT_CARD rpt = new RPT_PRODUCT_CARD();

                rpt.DataSource = ds;
                rpt.Parameters["paramUserPrint"].Value       = this.USER_ID;
                rpt.Parameters["paramPRODUCTION_TYPE"].Value = this.PRODUCTION_TYPE;
                rpt.CreateDocument();

                viewer.SetReport(rpt);
                viewer.LogPrintTime(printSeq);

                base.FinishedProcessing();

                viewer.ShowDialog();
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();

                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                base.FinishedProcessing();
            }
        }
示例#2
0
        private void PrintProductCard_A4(string jobOrdNo, string prodSEQNo, List <ProductCard> lstPrdCard)
        {
            int printSeq = 0;

            try
            {
                base.BeginProcessing("Begin Load Report...", "Please Waiting for Loading Report");

                DataSet ds;

                using (JobOrderBLL jobOrdBll = new JobOrderBLL())
                {
                    ds = jobOrdBll.PrintProductCardReport(jobOrdNo, prodSEQNo, lstPrdCard, this.USER_ID, out printSeq);
                }

                ReportViewer viewer = new ReportViewer();
                viewer.AutoCloseAfterPrint = true;


                //RPT_PRODUCT_CARD rpt = new RPT_PRODUCT_CARD();
                XtraReport rpt    = null;
                string     fixRpt = HTN.BITS.UIL.PLASESS.Properties.Settings.Default.FixProductCardReport;//UiUtility.FixProductCardReport;
                if (string.IsNullOrEmpty(fixRpt))
                {
                    rpt = new RPT_PRODUCT_CARD();
                }
                else
                {
                    rpt = UiUtility.GetReportByName(fixRpt);
                }

                if (rpt != null)
                {
                    rpt.DataSource = ds;
                    rpt.Parameters["paramUserPrint"].Value       = this.USER_ID;
                    rpt.Parameters["paramPRODUCTION_TYPE"].Value = this.PRODUCTION_TYPE;
                    rpt.CreateDocument();

                    viewer.SetReport(rpt);
                    viewer.LogPrintTime(printSeq);

                    base.FinishedProcessing();

                    viewer.ShowDialog();
                }
                else
                {
                    XtraMessageBox.Show("Report is null");
                }
            }
            catch (Exception ex)
            {
                base.FinishedProcessing();

                XtraMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            finally
            {
                base.FinishedProcessing();
            }
        }