Beispiel #1
0
        //public Types.ScanInfo DiskScan(string diskId, bool isUndo)
        //{
        //    if (string.IsNullOrEmpty(diskId)) { return Types.ScanInfo.ScanError; }
        //    if (!this.disks.ContainsKey(diskId)) { return Types.ScanInfo.NotInBill; }
        //    this.currentDisk = this.disks[diskId];
        //    if (isUndo) { return UnDoScan(); }
        //    if (CurrentDisk.IsScaned) { return Types.ScanInfo.RepeatScan; }
        //    SKU s = GetCurrentSKU(this.currentDisk);
        //    if (s == null) { return Types.ScanInfo.NotInBill; }
        //    else { this.currentDisk.Sku = s; }
        //    return Types.ScanInfo.Successful;
        //}
        //public Types.ScanInfo LocScan(string locNo)
        //{
        //    if (string.IsNullOrEmpty(locNo)) { return Types.ScanInfo.ScanError; }
        //    if (locNo != currentDisk.Loc) { return Types.ScanInfo.NotInLoc; }
        //    Types.ScanInfo sInfo = currentDisk.Pick();
        //    if (sInfo == Types.ScanInfo.Successful)
        //    {
        //        CheckIsPick();
        //        CheckIsFinish();
        //    }
        //    else { this.currentDisk.Sku = null; }
        //    return sInfo;
        //}
        public Types.ScanInfo DiskScan(string diskId, string locNo, bool isUndo)
        {
            if (string.IsNullOrEmpty(diskId) || string.IsNullOrEmpty(locNo)) { return Types.ScanInfo.ScanError; }
            if (!this.disks.ContainsKey(diskId)) { return Types.ScanInfo.NotInBill; }
            this.currentDisk = this.disks[diskId];
            if (isUndo) { return UnDoScan(); }

            if (CurrentDisk.IsScaned) { return Types.ScanInfo.RepeatScan; }
            if (locNo != currentDisk.Loc) { return Types.ScanInfo.NotInLoc; }

            SKU s = GetCurrentSKU(this.currentDisk);
            if (s == null) { return Types.ScanInfo.NotInBill; }
            else { this.currentDisk.Sku = s; }

            Types.ScanInfo sInfo = currentDisk.Pick();
            if (sInfo == Types.ScanInfo.Successful)
            {
                scanedDiskCount++;
                CheckIsPick();
                CheckIsFinish();
            }
            else { this.currentDisk.Sku = null; }
            return sInfo;

            //if (string.IsNullOrEmpty(diskId) || string.IsNullOrEmpty(locNo)) { return Types.ScanInfo.ScanError; }
            //if (!this.disks.ContainsKey(diskId)) { return Types.ScanInfo.NotInBill; }
            //this.currentDisk = this.disks[diskId];
            //if (isUndo) { return UnDoScan(); }

            //if (CurrentDisk.IsScaned) { return Types.ScanInfo.RepeatScan; }
            //if (locNo != currentDisk.Loc) { return Types.ScanInfo.NotInLoc; }

            //SKU s = GetCurrentSKU(this.currentDisk);
            //if (s == null) { return Types.ScanInfo.NotInBill; }
            //else { this.currentDisk.Sku = s; }

            //Types.ScanInfo sInfo = currentDisk.Pick();
            //if (sInfo == Types.ScanInfo.Successful)
            //{
            //    CheckIsPick();
            //    CheckIsFinish();
            //}
            //else { this.currentDisk.Sku = null; }
            //return sInfo;
        }
Beispiel #2
0
        //public Types.ScanInfo DiskScan(string diskId, bool isUndo)
        //{
        //    if (string.IsNullOrEmpty(diskId)) { return Types.ScanInfo.ScanError; }
        //    if (!this.disks.ContainsKey(diskId)) { return Types.ScanInfo.NotInBill; }
        //    this.currentDisk = this.disks[diskId];
        //    if (isUndo) { return UnDoScan(); }
        //    if (CurrentDisk.IsScaned) { return Types.ScanInfo.RepeatScan; }

        //    SKU s = GetCurrentSKU(this.currentDisk);
        //    if (s == null) { return Types.ScanInfo.NotInBill; }
        //    else { this.currentDisk.Sku = s; }
        //    return Types.ScanInfo.Successful;
        //}
        //public Types.ScanInfo LocScan(string locNo)
        //{
        //    if (string.IsNullOrEmpty(locNo)) { return Types.ScanInfo.ScanError; }
        //    if (locNo != currentDisk.Loc) { return Types.ScanInfo.NotInLoc; }
        //    Types.ScanInfo sInfo = currentDisk.Pick();
        //    if (sInfo == Types.ScanInfo.Successful)
        //    {
        //        CheckIsPick();
        //        CheckIsFinish();
        //    }
        //    else { this.currentDisk.Sku = null; }
        //    return sInfo;
        //}

        public Types.ScanInfo DiskScan(string diskId, string locNo, bool isUndo)
        {
            if (string.IsNullOrEmpty(diskId) || string.IsNullOrEmpty(locNo))
            {
                return(Types.ScanInfo.ScanError);
            }
            if (!this.disks.ContainsKey(diskId))
            {
                return(Types.ScanInfo.NotInBill);
            }
            this.currentDisk = this.disks[diskId];
            if (isUndo)
            {
                return(UnDoScan());
            }

            if (CurrentDisk.IsScaned)
            {
                return(Types.ScanInfo.RepeatScan);
            }
            if (locNo != currentDisk.Loc)
            {
                return(Types.ScanInfo.NotInLoc);
            }

            SKU s = GetCurrentSKU(this.currentDisk);

            if (s == null)
            {
                return(Types.ScanInfo.NotInBill);
            }
            else
            {
                this.currentDisk.Sku = s;
            }

            Types.ScanInfo sInfo = currentDisk.Pick();
            if (sInfo == Types.ScanInfo.Successful)
            {
                scanedDiskCount++;
                CheckIsPick();
                CheckIsFinish();
            }
            else
            {
                this.currentDisk.Sku = null;
            }
            return(sInfo);

            //if (string.IsNullOrEmpty(diskId) || string.IsNullOrEmpty(locNo)) { return Types.ScanInfo.ScanError; }
            //if (!this.disks.ContainsKey(diskId)) { return Types.ScanInfo.NotInBill; }
            //this.currentDisk = this.disks[diskId];
            //if (isUndo) { return UnDoScan(); }

            //if (CurrentDisk.IsScaned) { return Types.ScanInfo.RepeatScan; }
            //if (locNo != currentDisk.Loc) { return Types.ScanInfo.NotInLoc; }

            //SKU s = GetCurrentSKU(this.currentDisk);
            //if (s == null) { return Types.ScanInfo.NotInBill; }
            //else { this.currentDisk.Sku = s; }

            //Types.ScanInfo sInfo = currentDisk.Pick();
            //if (sInfo == Types.ScanInfo.Successful)
            //{
            //    CheckIsPick();
            //    CheckIsFinish();
            //}
            //else { this.currentDisk.Sku = null; }
            //return sInfo;
        }