示例#1
0
 public void Setup()
 {
     var printer = new CorePrinter();
         for (int i = 0; i <= 99; i++)
         {
             _returnValues[i] = printer.Print(valueFromCorePrinter);
         }
 }
示例#2
0
        public void Setup()
        {
            var printer = new CorePrinter();

            for (int i = 0; i <= 99; i++)
            {
                _returnValues[i] = printer.Print(valueFromCorePrinter);
            }
        }
示例#3
0
        private void SetPrintData(UltraGridRow ActiveRow, int iCopies)
        {
            if (ActiveRow == null)
            {
                return;
            }

            if (iCopies <= 0)
            {
                iCopies = 2;
            }

            string strBatchNo    = Convert.ToString(ActiveRow.Cells["FS_BATCHNO"].Value).Trim();
            string strBandNo     = Convert.ToString(ActiveRow.Cells["FN_BANDNO"].Value).Trim();
            string strStandardNo = Convert.ToString(ActiveRow.Cells["FS_STANDNO"].Value).Trim();
            string strSteelType  = Convert.ToString(ActiveRow.ParentRow.Cells["FS_STEELTYPE"].Value);
            string strSpec       = Convert.ToString(ActiveRow.ParentRow.Cells["FS_SPEC"].Value);
            string strType       = Convert.ToString(ActiveRow.Cells["FS_TYPE"].Value).Trim();
            string strLength     = Convert.ToString(ActiveRow.Cells["FN_LENGTH"].Value).Trim();
            string strActual     = Convert.ToString(ActiveRow.Cells["FN_WEIGHT"].Value).Trim();
            string strTheory     = Convert.ToString(ActiveRow.Cells["FN_THEORYWEIGHT"].Value).Trim();
            string strCount      = Convert.ToString(ActiveRow.Cells["FN_BANDBILLETCOUNT"].Value).Trim();
            string strTerm       = Convert.ToString(ActiveRow.Cells["FS_TERM"].Value).Trim();

            if (_PointID.Equals("K33") || _PointID.Equals("K36"))
            {
                strTerm = strTerm.Equals("1") ? "甲" : strTerm.Equals("2") ? "乙" : strTerm.Equals("3") ? "丙" :strTerm.Equals("4") ? "丁" : "常白";
            }
            string strWeighTime = Convert.ToString(ActiveRow.Cells["FD_DATETIME"].Value).Trim();
            string materialName = Convert.ToString(ActiveRow.Cells["FS_MATERIALNAME"].Value).Trim();

            //switch (UserInfo.GetUserGroup())
            //{
            //    case "1": strTerm = "A"; break;
            //    case "2": strTerm = "B"; break;
            //    case "3": strTerm = "C"; break;
            //    case "4": strTerm = "D"; break;
            //    default: strTerm = "A"; break;
            //}
            _printer.PrinterName = cbPrint.Text;
            _printer.Data.PM     = materialName;
            switch (_PointID)
            {
            case "K26":
            case "K27":
            case "K34":
            case "K32":
            case "K37":
                _printer.Data.Type = LableType.PIPE;
                break;

            case "K33":
            case "K36":
                _printer.Data.Type = LableType.PIPE2;
                break;
            }
            _printer.Data.BatchNo      = strBatchNo;
            _printer.Data.BandNo       = strBandNo;
            _printer.Data.Standard     = strStandardNo;
            _printer.Data.SteelType    = strSteelType;
            _printer.Data.Spec         = strSpec;
            _printer.Data.Length       = strLength;
            _printer.Data.Term         = strTerm;
            _printer.Data.PrintAddress = cbx_Addr.Checked;

            try
            {
                _printer.Data.BarCode = GetBarCode(strBatchNo, strBandNo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("条码生成失败!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                _printer.Data.Date = Convert.ToDateTime(strWeighTime);
            }
            catch
            {
                _printer.Data.Date = DateTime.Now;
            }

            try
            {
                _printer.Data.Count = strCount;
            }
            catch { }

            try
            {
                strActual = Convert.ToDecimal(strActual).ToString();
            }
            catch { }

            try
            {
                strTheory = Convert.ToDecimal(strTheory).ToString();
            }
            catch { }

            if (strType != "定尺")
            {
                _printer.Data.Count  = "非";
                _printer.Data.Weight = strActual;

                for (int i = 0; i < iCopies; i++)
                {
                    _printer.Print();
                }

                return;
            }

            if (cbx_Actual.Checked)
            {
                _printer.Data.Weight = strActual;

                for (int i = 0; i < iCopies; i++)
                {
                    _printer.Print();
                }
            }

            if (cbx_Theory.Checked)
            {
                _printer.Data.Weight = strTheory;

                for (int i = 0; i < iCopies; i++)
                {
                    _printer.Print();
                }
            }
        }
示例#4
0
 public virtual string Print()
 {
     return(_corePrinter.Print("pex"));
 }
示例#5
0
        private void SetPrintData(UltraGridRow ActiveRow, int iCopies)
        {
            if (ActiveRow == null)
            {
                return;
            }

            if (iCopies <= 0)
            {
                iCopies = 2;
            }

            string strBatchNo    = Convert.ToString(ActiveRow.Cells["FS_BATCHNO"].Value).Trim();
            string strBandNo     = Convert.ToString(ActiveRow.Cells["FN_BANDNO"].Value).Trim();
            string strStandardNo = Convert.ToString(ActiveRow.Cells["FS_STANDNO"].Value).Trim();
            string strSteelType  = Convert.ToString(ActiveRow.ParentRow.Cells["FS_STEELTYPE"].Value);
            string strSpec       = Convert.ToString(ActiveRow.ParentRow.Cells["FS_SPEC"].Value);
            string strType       = Convert.ToString(ActiveRow.Cells["FS_TYPE"].Value).Trim();
            string strLength     = Convert.ToString(ActiveRow.Cells["FN_LENGTH"].Value).Trim();
            string strActual     = Convert.ToString(ActiveRow.Cells["FN_WEIGHT"].Value).Trim();
            string strTheory     = Convert.ToString(ActiveRow.Cells["FN_THEORYWEIGHT"].Value).Trim();
            string strCount      = Convert.ToString(ActiveRow.Cells["FN_BANDBILLETCOUNT"].Value).Trim();
            string strTerm       = Convert.ToString(ActiveRow.Cells["FS_TERM"].Value).Trim();
            string strWeighTime  = Convert.ToString(ActiveRow.Cells["FD_DATETIME"].Value).Trim();

            string sql = "select fs_Standard from BT_PRINTCARDSTANDARD t where t.fs_steeltype='" + strSteelType.ToUpper() + "'";

            CoreClientParam ccp9 = new CoreClientParam();

            ccp9.ServerName   = "ygjzjl.basedatamanage.OtherBaseInfo";
            ccp9.MethodName   = "ExcuteQuery";
            ccp9.ServerParams = new object[] { sql };
            DataTable db = new DataTable();

            ccp9.SourceDataTable = db;
            this.ExecuteQueryToDataTable(ccp9, CoreInvokeType.Internal);

            if (db.Rows.Count > 0 && cbx_Standard.Checked)
            {
                strStandardNo = db.Rows[0][0].ToString();
            }

            else
            {
                strStandardNo = "";
            }

            //if (strSteelType.ToUpper() == "22MNB")
            //{
            //    strStandardNo = "KGB.4 3001";
            //}
            //else if (strSteelType.ToUpper() == "18B")
            //{
            //    strStandardNo = "KGB.3 3001";
            //}
            //else
            //{
            //    strStandardNo = ""; //标准
            //}

            switch (UserInfo.GetUserGroup())
            {
            case "1": strTerm = "A"; break;

            case "2": strTerm = "B"; break;

            case "3": strTerm = "C"; break;

            case "4": strTerm = "D"; break;

            default: strTerm = "A"; break;
            }
            _printer.Data.Type         = LableType.BIG;
            _printer.Data.BatchNo      = strBatchNo;
            _printer.Data.BandNo       = strBandNo;
            _printer.Data.Standard     = strStandardNo;
            _printer.Data.SteelType    = strSteelType;
            _printer.Data.Spec         = strSpec;
            _printer.Data.Length       = strLength;
            _printer.Data.Term         = strTerm;
            _printer.Data.PrintAddress = cbx_Addr.Checked;

            try
            {
                _printer.Data.BarCode = GetBarCode(strBatchNo, strBandNo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("条码生成失败!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                _printer.Data.Date = Convert.ToDateTime(strWeighTime);
            }
            catch
            {
                _printer.Data.Date = DateTime.Now;
            }

            try
            {
                _printer.Data.Count = strCount;
            }
            catch { }

            try
            {
                strActual = Math.Round(Convert.ToDecimal(strActual) * 1000).ToString();
            }
            catch { }

            try
            {
                strTheory = Math.Round(Convert.ToDecimal(strTheory) * 1000).ToString();
            }
            catch { }

            if (strType != "定尺")
            {
                _printer.Data.Count  = "非";
                _printer.Data.Weight = strActual;

                for (int i = 0; i < iCopies; i++)
                {
                    _printer.Print();
                }

                return;
            }

            if (cbx_Actual.Checked)
            {
                _printer.Data.Weight = strActual;

                for (int i = 0; i < iCopies; i++)
                {
                    _printer.Print();
                }
            }

            if (cbx_Theory.Checked)
            {
                _printer.Data.Weight = strTheory;

                for (int i = 0; i < iCopies; i++)
                {
                    _printer.Print();
                }
            }
        }
示例#6
0
        private void SetPrintData(UltraGridRow ActiveRow, int iCopies)
        {
            if (ActiveRow == null)
            {
                return;
            }

            if (iCopies <= 0)
            {
                iCopies = 2;
            }

            string strBatchNo    = Convert.ToString(ActiveRow.Cells["FS_BATCHNO"].Value).Trim();
            string strBandNo     = Convert.ToString(ActiveRow.Cells["FN_BANDNO"].Value).Trim();
            string strStandardNo = Convert.ToString(ActiveRow.Cells["FS_STANDNO"].Value).Trim();
            string strSteelType  = Convert.ToString(ActiveRow.ParentRow.Cells["FS_STEELTYPE"].Value);
            string strSpec       = Convert.ToString(ActiveRow.ParentRow.Cells["FS_SPEC"].Value);
            string strType       = Convert.ToString(ActiveRow.Cells["FS_TYPE"].Value).Trim();
            string strLength     = Convert.ToString(ActiveRow.Cells["FN_LENGTH"].Value).Trim();
            string strActual     = Convert.ToString(ActiveRow.Cells["FN_WEIGHT"].Value).Trim();
            string strTheory     = Convert.ToString(ActiveRow.Cells["FN_THEORYWEIGHT"].Value).Trim();
            string strCount      = Convert.ToString(ActiveRow.Cells["FN_BANDBILLETCOUNT"].Value).Trim();
            string strTerm       = Convert.ToString(ActiveRow.Cells["FS_TERM"].Value).Trim();
            string strWeighTime  = Convert.ToString(ActiveRow.Cells["FD_DATETIME"].Value).Trim();

            switch (UserInfo.GetUserGroup())
            {
            case "1": strTerm = "A"; break;

            case "2": strTerm = "B"; break;

            case "3": strTerm = "C"; break;

            case "4": strTerm = "D"; break;

            default: strTerm = "A"; break;
            }
            _printer.Data.Type         = LableType.BIG;
            _printer.Data.BatchNo      = strBatchNo;
            _printer.Data.BandNo       = strBandNo;
            _printer.Data.Standard     = strStandardNo;
            _printer.Data.SteelType    = strSteelType;
            _printer.Data.Spec         = strSpec;
            _printer.Data.Length       = strLength;
            _printer.Data.Term         = strTerm;
            _printer.Data.PrintAddress = cbx_Addr.Checked;

            try
            {
                _printer.Data.BarCode = GetBarCode(strBatchNo, strBandNo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("条码生成失败!\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                _printer.Data.Date = Convert.ToDateTime(strWeighTime);
            }
            catch
            {
                _printer.Data.Date = DateTime.Now;
            }

            try
            {
                _printer.Data.Count = strCount;
            }
            catch { }

            try
            {
                strActual = Math.Round(Convert.ToDecimal(strActual) * 1000).ToString();
            }
            catch { }

            try
            {
                strTheory = Math.Round(Convert.ToDecimal(strTheory) * 1000).ToString();
            }
            catch { }

            if (strType != "定尺")
            {
                _printer.Data.Count  = "非";
                _printer.Data.Weight = strActual;

                for (int i = 0; i < iCopies; i++)
                {
                    _printer.Print();
                }

                return;
            }

            if (cbx_Actual.Checked)
            {
                _printer.Data.Weight = strActual;

                for (int i = 0; i < iCopies; i++)
                {
                    _printer.Print();
                }
            }

            if (cbx_Theory.Checked)
            {
                _printer.Data.Weight = strTheory;

                for (int i = 0; i < iCopies; i++)
                {
                    _printer.Print();
                }
            }
        }
示例#7
0
 private void btPrint_Click(object sender, EventArgs e)
 {
     //_cab.Printer.PrintData();
     //_cab.Printer.TestPrintChinese();
     _printer.Print();
 }