コード例 #1
0
ファイル: InventoryForm.cs プロジェクト: windygu/HaiLan
        public override void StopInventory()
        {
            if (isInventory)
            {
                Invoke(new Action(() =>
                {
                    lblWorkStatus.Text = "停止扫描";
                }));
                isInventory = false;

                reader.StopInventory();

                CheckResult cre = CheckData();
                Invoke(new Action(() =>
                {
                    label_inre.Text = cre.Message;
                }));
            }
        }
コード例 #2
0
        public override void StopInventory()
        {
            if (!boxCheckCheckBox.Checked)
            {
                return;
            }

            if (isInventory)
            {
                Invoke(new Action(() =>
                {
                    lblWorkStatus.Text = "停止扫描";
                }));
                isInventory = false;
                reader.StopInventory();
                CheckResult cre = CheckData();

                playSound(cre.InventoryResult);

                List <CTagDetail> tags = getTags();

                //print
                bool shouldPrint = false;
                Invoke(new Action(() =>
                {
                    shouldPrint = printCheckBox.Checked;
                }));
                if (shouldPrint)
                {
                    HLABoxCheckChannelMachine.Utils.PrintHelper.PrintRightTag(tags, mCurBoxNo);
                }

                //show in grid
                if (tags != null && tags.Count > 0)
                {
                    foreach (var v in tags)
                    {
                        grid.Rows.Insert(0, mCurBoxNo, v.zsatnr, v.zcolsn, v.zsiztx, v.quan, cre.Message);
                        if (!cre.InventoryResult)
                        {
                            grid.Rows[0].DefaultCellStyle.BackColor = Color.OrangeRed;
                        }
                    }
                }
                else
                {
                    grid.Rows.Insert(0, mCurBoxNo, "", "", "", "", cre.Message);
                    if (!cre.InventoryResult)
                    {
                        grid.Rows[0].DefaultCellStyle.BackColor = Color.OrangeRed;
                    }
                }

                if (cre.InventoryResult)
                {
                    SetInventoryResult(1);
                }
                else
                {
                    SetInventoryResult(1);
                }
            }
        }
コード例 #3
0
        public override CheckResult CheckData()
        {
            CheckResult result = base.CheckData();

            if (string.IsNullOrEmpty(mCurBoxNo))
            {
                result.UpdateMessage(@"未扫描到箱号");
                result.InventoryResult = false;
            }

            bool pinseCheckBool = false;
            bool allCheckBool   = false;

            pinseCheckBool = pinseCheck.Checked;
            allCheckBool   = allCheck.Checked;

            if (allCheckBool)
            {
                if (tagDetailList != null && tagDetailList.Count > 0)
                {
                    TagDetailInfo t = tagDetailList[0];
                    foreach (var v in tagDetailList)
                    {
                        if (v.ZSATNR == t.ZSATNR && v.ZCOLSN == t.ZCOLSN && v.ZSIZTX == t.ZSIZTX)
                        {
                        }
                        else
                        {
                            result.UpdateMessage(@"品色规不唯一");
                            result.InventoryResult = false;

                            break;
                        }
                    }
                }
            }
            if (pinseCheckBool)
            {
                if (tagDetailList != null && tagDetailList.Count > 0)
                {
                    TagDetailInfo t = tagDetailList[0];
                    foreach (var v in tagDetailList)
                    {
                        if (v.ZSATNR == t.ZSATNR && v.ZCOLSN == t.ZCOLSN)
                        {
                        }
                        else
                        {
                            result.UpdateMessage(@"品色不唯一");
                            result.InventoryResult = false;

                            break;
                        }
                    }
                }
            }

            if (result.InventoryResult)
            {
                result.UpdateMessage(Consts.Default.RIGHT);
            }

            return(result);
        }