Ejemplo n.º 1
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            try
            {
                if (Convert.ToInt32(txtProdQty.Text) > Convert.ToInt32(lblGoodQty.Text))
                {
                    return;
                }

                if (txtProdQty.Text == "" || txtProdQty.Text == "0")
                {
                    return;
                }

                //xtrClaimUNIK rUNIK = new xtrClaimUNIK();
                xtrClaimUNIP rUNIP  = new xtrClaimUNIP();
                xtrClaimUNIT rUNIT  = new xtrClaimUNIT();
                xtrClaimUNIT rUNIT2 = new xtrClaimUNIT();

                //rUNIK.DataSource = _dt;
                rUNIP.DataSource  = _dt;
                rUNIT.DataSource  = _dt;
                rUNIT2.DataSource = _dt;

                ///////////***RUNIK***////////
                //SetText((XRLabel)FindControlUNIK(rUNIK, "lblMcNo"), cmbMC.SelectedText.ToString());
                //SetText((XRLabel)FindControlUNIK(rUNIK, "lblOrder"), txtProdQty.Text.ToString());
                //SetText((XRLabel)FindControlUNIK(rUNIK, "lblProductionOrder"), txtProdQty.Text.ToString());
                //SetText((XRLabel)FindControlUNIK(rUNIK, "lblMatBatchNo"), txtFabric.Text.ToString());
                //SetText((XRLabel)FindControlUNIK(rUNIK, "lblMatSeuren"), txtFabric.Text.ToString());
                //SetText((XRLabel)FindControlUNIK(rUNIK, "TextFab"), txtFabric.Text.ToString());
                ///////////***RUNIK***////////

                /////////***RUNIP***////////
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl01"), cmbMC.Text.ToString());
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl07"), _dt.Rows[0]["SS"].ToString());
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl12"), txtProdQty.Text.ToString());
                SetText((XRLabel)FindControlUNIP(rUNIP, "xrLabel10"), _dt.Rows[0]["LOT_NO"].ToString());
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl17"), txtProdQty.Text.ToString());
                SetText((XRLabel)FindControlUNIP(rUNIP, "lblProductionOrder"), txtProdQty.Text.ToString());
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl21"), txtLotNo.Text.ToString().Trim());
                SetText((XRBarCode)FindControlUNIP(rUNIP, "lbl25"), txtLotNo.Text.ToString().Trim());
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl23"), txtFabric.Text.ToString());
                SetText((XRBarCode)FindControlUNIP(rUNIP, "xrBarCode1"), _dt.Rows[0]["SYSTEMCODE"] + "/" + txtProdQty.Text.ToString());
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl30"), txtProdQty.Text.ToString());
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl31"), txtProdQty.Text.ToString());
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl26"), "0");
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl27"), "0");
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl28"), "0");
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl29"), "0");
                SetText((XRLabel)FindControlUNIP(rUNIP, "lbl32"), _dt.Rows[0]["RESIN_USE"].ToString());
                /////////***RUNIP***////////

                ///////////***RUNIT***////////
                SetText((XRLabel)FindControlUNIT(rUNIT, "lbl01"), cmbMC.Text.ToString());
                SetText((XRLabel)FindControlUNIT(rUNIT, "lbl12"), "1");
                SetText((XRLabel)FindControlUNIT(rUNIT, "lbl17"), "1");
                SetText((XRLabel)FindControlUNIT(rUNIT, "lblProductionOrder"), "1");
                SetText((XRLabel)FindControlUNIT(rUNIT, "lbl09"), String.Format("PRINT TIME: {0:HH:mm:ss}", DateTime.Now));
                SetText((XRLabel)FindControlUNIT(rUNIT, "lblProductionOrder"), "1");
                SetText((XRLabel)FindControlUNIT(rUNIT, "lbl13"), "START");
                SetText((XRBarCode)FindControlUNIT(rUNIT, "xrBarCode1"), _dt.Rows[0]["SYSTEMCODE"] + "/" + "1");
                SetText((XRLabel)FindControlUNIT(rUNIT, "lbl21"), txtLotNo.Text.ToString().Trim());
                SetText((XRLabel)FindControlUNIT(rUNIT, "lbl22"), "A");
                SetText((XRBarCode)FindControlUNIT(rUNIT, "lbl25"), txtLotNo.Text.ToString().Trim() + "A");
                ///////////***RUNIT***////////

                ///////////***RUNIT2***////////
                SetText((XRLabel)FindControlUNIT(rUNIT2, "lbl01"), cmbMC.Text.ToString());
                SetText((XRLabel)FindControlUNIT(rUNIT2, "lbl12"), "1");
                SetText((XRLabel)FindControlUNIT(rUNIT2, "lbl17"), "1");
                SetText((XRLabel)FindControlUNIT(rUNIT2, "lblProductionOrder"), "1");
                SetText((XRLabel)FindControlUNIT(rUNIT2, "lbl09"), String.Format("PRINT TIME: {0:HH:mm:ss}", DateTime.Now));
                SetText((XRLabel)FindControlUNIT(rUNIT2, "lblProductionOrder"), "1");
                SetText((XRLabel)FindControlUNIT(rUNIT2, "lbl13"), "END");
                SetText((XRBarCode)FindControlUNIT(rUNIT2, "xrBarCode1"), _dt.Rows[0]["SYSTEMCODE"] + "/" + "1");
                SetText((XRLabel)FindControlUNIT(rUNIT2, "lbl21"), txtLotNo.Text.ToString().Trim());
                SetText((XRLabel)FindControlUNIT(rUNIT2, "lbl22"), "B");
                SetText((XRBarCode)FindControlUNIT(rUNIT2, "lbl25"), txtLotNo.Text.ToString().Trim() + "B");
                ///////////***RUNIT2***////////


                //rUNIK.CreateDocument();
                rUNIP.CreateDocument();
                rUNIT.CreateDocument();
                rUNIT2.CreateDocument();

                //rUNIK.Pages.AddRange(rUNIP.Pages);
                rUNIP.Pages.AddRange(rUNIT.Pages);
                rUNIP.Pages.AddRange(rUNIT2.Pages);

                documentViewer1.DocumentSource = rUNIP;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
 static XRControl FindControlUNIT(xtrClaimUNIT r, string ControlName)
 {
     return(r.FindControl(ControlName, false));
 }