Beispiel #1
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        private void ClearData()
        {
            txtDocNo.Text   = "";
            txtBarCode.Text = "";
            txtInfo.Text    = "";

            dataSet.CompleteApplyBarCode.Clear();
            docInfoArray = null;
            mainRow      = null;
        }
Beispiel #2
0
        /// <summary>
        /// 扫描条码
        /// </summary>
        private void ScanBarCode()
        {
            try
            {
                string barcode = txtBarCode.Text.Trim();
                if (string.IsNullOrEmpty(barcode))
                {
                    return;
                }

                if (docInfoArray == null || docInfoArray.Length == 0)
                {
                    BuildTabOrder(true);
                    throw new PDAException(txtDocNo, "请先录入申报单号或者扫描申报单条码");
                }

                BuildTabOrder(false);
                tabOrderManager.Reset();
                BarCodeInfoDTO dto = ServiceAgent.Agent.QueryBarCodeInfo(PDAContext.LoginOrgID, barcode);
                if (dto == null)
                {
                    throw new PDAException(txtBarCode, "没有找到该条形码的料品信息!");
                }

                CompleteApplyDocDTO docDTO = MatchCompleteApplyDocDTO(dto);
                if (docDTO == null)
                {
                    throw new PDAException(txtBarCode, "该条码没有匹配到申报单信息或者录入的条码超过该申报单!");
                }
                mainRow = dataSet.CompleteApplyBarCode.AddNewRow(dto, docDTO.MoDocNo, docDTO.CompleteApplyDocID, docDTO.CompleteApplyLineID);

                ShowInfo();
                // 显示行数
                ShowRowCount();
                // 焦点定位到最后一行
                this.dataGrid1.Focus();
                this.dataGrid1.CurrentRowIndex = this.dataSet.CompleteApplyBarCode.Count - 1;
                // 跳转到下一个控件
                tabOrderManager.Next();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ExceptionParser.ParseError(ex));
                tabOrderManager.DealException(ex);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 扫描单号
        /// </summary>
        private void ScanDocNo()
        {
            try
            {
                string barcode = txtDocNo.Text.Trim();
                if (string.IsNullOrEmpty(barcode))
                {
                    return;
                }

                BuildTabOrder(true);
                tabOrderManager.Reset();
                if (dataSet.CompleteApplyBarCode.Rows.Count > 0 && MessageBox.Show("存在未提交的条形码,是否确定重新录入申报单?", "确定重新扫单", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.OK)
                {
                    tabOrderManager.Next();
                    return;
                }

                txtBarCode.Text = "";
                txtInfo.Text    = "";
                dataSet.CompleteApplyBarCode.Clear();
                mainRow = null;

                docInfoArray = ServiceAgent.Agent.QueryCompleteApplyDocInfo(PDAContext.LoginOrgID, barcode);
                if (docInfoArray == null || docInfoArray.Length == 0)
                {
                    throw new PDAException(txtDocNo, "没有找到该条码对应申报单信息或者该申报单已经完全入库!");
                }
                ShowInfo();
                tabOrderManager.Next();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ExceptionParser.ParseError(ex));
                tabOrderManager.DealException(ex);
            }
        }