예제 #1
0
        public Types.ScanInfo DiskScan(string diskId, bool isUndo, int PackCount, string skuID, DateTime createDatetime, string loc)
        {
            if (string.IsNullOrEmpty(diskId))
            {
                return(Types.ScanInfo.ScanError);
            }
            this.currentDiskId = diskId;

            if (isUndo)
            {
                return(UnDoScan());
            }
            //return CheckDiskIsScaned();
            Types.ScanInfo info = CheckDiskIsScaned();
            if (info == Types.ScanInfo.Successful)
            {
                SKU s = GetCurrentSKU(skuID);
                AddCurrentDisk(s, PackCount, loc);
                Types.ScanInfo sInfo = CurrentDisk.Asn(createDatetime);
                if (sInfo == Types.ScanInfo.Successful)
                {
                    CheckIsFinish();
                }
                else
                {
                    this.CurrentDisk.Sku = null;
                }
                return(sInfo);
            }
            else
            {
                return(info);
            }
        }
예제 #2
0
 public Types.ScanInfo Scan(int count)
 {
     Types.ScanInfo si = CheckScan(count);
     if (si != Types.ScanInfo.Successful)
     {
         return(si);
     }
     this.scanCount += count;
     this.scanFinish = this.scanCount == this.count ? true : false;
     return(Types.ScanInfo.Successful);
 }
예제 #3
0
 private Types.ScanInfo UnDoScan(string diskId)
 {
     if (!disks.ContainsKey(diskId))
     {
         return(Types.ScanInfo.NotScan);
     }
     Types.ScanInfo si = disks[diskId].UnPart();
     if (si != Types.ScanInfo.Successful)
     {
         return(si);
     }
     subDiskIds.Remove(diskId);
     return(Types.ScanInfo.Successful);
 }
예제 #4
0
 private Types.ScanInfo UnDoScan()
 {
     if (CurrentDisk == null || !CurrentDisk.IsScaned)
     {
         return(Types.ScanInfo.NotScan);
     }
     Types.ScanInfo si = CurrentDisk.UnAsn();
     if (si != Types.ScanInfo.Successful)
     {
         return(si);
     }
     this.disks.Remove(currentDiskId);
     this.currentDisk = null;
     return(Types.ScanInfo.Successful);
 }
예제 #5
0
        private Types.ScanInfo UnDoScan()
        {
            if (CurrentDisk == null || !CurrentDisk.IsScaned)
            {
                return(Types.ScanInfo.NotScan);
            }
            Types.ScanInfo si = CurrentDisk.UnPutAway();

            if (si != Types.ScanInfo.Successful)
            {
                return(si);
            }
            this.FinishBillsId.Remove(currentDisk.Sku.BillNo);
            scanedDiskCount--;
            return(Types.ScanInfo.Successful);
        }
예제 #6
0
 private Types.ScanInfo UnDoScan()
 {
     //if (CurrentDisk == null || !CurrentDisk.IsScaned) { return Types.ScanInfo.NotScan; }
     //return CurrentDisk.unPick();
     if (CurrentDisk == null || !CurrentDisk.IsScaned)
     {
         return(Types.ScanInfo.NotScan);
     }
     Types.ScanInfo si = CurrentDisk.unPick();
     if (si != Types.ScanInfo.Successful)
     {
         return(si);
     }
     scanedDiskCount--;
     return(Types.ScanInfo.Successful);
 }
예제 #7
0
 public Types.ScanInfo LocScan(string locNo)
 {
     if (string.IsNullOrEmpty(locNo))
     {
         return(Types.ScanInfo.ScanError);
     }
     Types.ScanInfo sInfo = CurrentDisk.PutAway(locNo);
     if (sInfo == Types.ScanInfo.Successful)
     {
         scanedDiskCount++;
         CheckIsFinish();
     }
     else
     {
         this.currentDisk.Sku = null;
     }
     return(sInfo);
 }
예제 #8
0
 public Types.ScanInfo SubDiskScan(string subDiskId, int partCount)
 {
     if (string.IsNullOrEmpty(subDiskId) || partCount == 0)
     {
         return(Types.ScanInfo.ScanError);
     }
     if (subDiskIds.Contains(subDiskId))
     {
         return(Types.ScanInfo.PartSubReScan);
     }
     Types.ScanInfo si = currentDisk.Part(subDiskId, partCount);
     if (si != Types.ScanInfo.Successful)
     {
         return(si);
     }
     subDiskIds.Add(subDiskId);
     return(Types.ScanInfo.Successful);
 }
예제 #9
0
 private void txt_Disk_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (ml.ScanedDiskCount >= 100)
         {
             MessageBox.Show("已扫料盘数达到100个,请及时保存数据!");
             return;
         }
         this.txt_Detail.Text      = string.Empty;
         this.txt_Detail.ForeColor = Color.Black;
         Types.ScanInfo i   = ml.DiskScan(this.txt_Disk.Text.ToUpper().Trim(), this.cb_RollBack.Checked);
         string         msg = Types.ScanInfoMessage(i, cb_RollBack.Checked);
         if (msg != string.Empty)
         {
             this.txt_Detail.Text      = msg;
             this.txt_Detail.ForeColor = Color.Red;
             this.txt_Disk.Text        = string.Empty;
         }
         else
         {
             Types.ScanInfo i_lot   = ml.LotScan(this.txt_NewLot.Text.ToUpper().Trim());
             string         msg_lot = Types.ScanInfoMessage(i_lot);
             if (msg_lot != string.Empty)
             {
                 this.txt_Detail.Text      = msg_lot;
                 this.txt_Detail.ForeColor = Color.Red;
             }
             else
             {
                 this.txt_Detail.Text  = "移储单:" + ml.CurrentDisk.BillNo + "\r\n";
                 this.txt_Detail.Text += "物料:" + ml.CurrentDisk.Sku.Id + "\r\n";
                 this.txt_Detail.Text += "供应商:" + ml.CurrentDisk.Sku.Company + "\r\n";
                 this.txt_Detail.Text += "新批次号:" + ml.CurrentDisk.Sku.NewLot + "\r\n";
                 txt_Detail.Text      += "实际扫描批次号:" + this.txt_NewLot.Text.ToUpper() + "\r\n";
                 txt_Detail.Text      += "此物料需扫描数量:" + ml.CurrentDisk.Sku.Count.ToString() + "\r\n";
                 txt_Detail.Text      += "此物料已扫描数量:" + ml.CurrentDisk.Sku.ScanCount.ToString() + "\r\n";
             }
             this.txt_Disk.Text = string.Empty;
             this.txt_Disk.Focus();
         }
     }
 }
예제 #10
0
 public Types.ScanInfo LotScan(string lotNo)
 {
     if (string.IsNullOrEmpty(lotNo))
     {
         return(Types.ScanInfo.ScanError);
     }
     if (this.currentDisk.Sku.NewLot.Trim().ToUpper() != lotNo.Trim().ToUpper())
     {
         return(Types.ScanInfo.NotExpectedLot);
     }
     Types.ScanInfo sInfo = CurrentDisk.MoveLot(lotNo);
     if (sInfo == Types.ScanInfo.Successful)
     {
         scanedDiskCount++;
         CheckIsFinish();
     }
     else
     {
         this.currentDisk.Sku = null;
     }
     return(sInfo);
 }
예제 #11
0
 public Types.ScanInfo Scan(int count, string locNo)
 {
     Types.ScanInfo si = CheckScan(count);
     if (si != Types.ScanInfo.Successful)
     {
         return(si);
     }
     if (this.expectedLoc.Trim().ToUpper() != locNo.Trim().ToUpper())
     {
         return(Types.ScanInfo.NotExpectedLoc);
     }
     if (count < 0 && (!this.Locs.ContainsKey(locNo) || this.Locs[locNo].Count + count < 0))
     {
         return(Types.ScanInfo.NotInLoc);
     }
     if (!this.Locs.ContainsKey(locNo))
     {
         this.Locs.Add(locNo, new LOC(locNo, 0));
     }
     this.scanCount         += count;
     this.Locs[locNo].Count += count;
     this.scanFinish         = this.scanCount == this.count ? true : false;
     return(Types.ScanInfo.Successful);
 }
예제 #12
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;
        }