コード例 #1
0
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPrint_Click(object sender, EventArgs e)
        {
            List <string>   childAssembly = new List <string>();
            int             printCount    = (int)(numCount.Value);
            BatchBarcodeInf batchInfo     = null;
            string          error;

            int beginSerialNumber = 0;

            try
            {
                beginSerialNumber = Convert.ToInt32(txtSerialNo.Text);
            }
            catch (Exception)
            {
                MessageDialog.ShowErrorMessage("不正确的流水号!");
                return;
            }

            if (!m_barCode.BatchGenerateBarcode(m_productTypeCode, m_assemblyType, printCount, beginSerialNumber,
                                                dateTimePicker1.Value, out batchInfo, out error))
            {
                MessageDialog.ShowPromptMessage(error);
                return;
            }

            if (!m_barCode.PrintBarcodes(batchInfo, out error))
            {
                MessageDialog.ShowErrorMessage(error);
            }

            InitSerialNo();
        }
コード例 #2
0
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPrint_Click(object sender, EventArgs e)
        {
            int             printCount = (int)(numCount.Value);
            BatchBarcodeInf batchInfo  = null;
            string          error;
            List <string>   childAssembly = new List <string>();

            if (!m_barCode.BatchGenerateBarcode(m_productTypeCode, null, printCount, out batchInfo, out error))
            {
                string msg = "服务器准备工作失败" + error + "!";
                MessageDialog.ShowPromptMessage(msg);
                return;
            }

            if (!m_barCode.PrintBarcodes(batchInfo, out error))
            {
                MessageDialog.ShowErrorMessage(error);
                return;
            }

            MessageDialog.ShowPromptMessage("服务器准备工作完成!");

            InitSerialNo();

            m_commResponseServer.StartServer();
        }