Exemplo n.º 1
0
 public Disk(SKU sku, DataRow dr)
 {
     this.sku = sku;
     if (!dr.Table.Columns.Contains(this.GetColName4Pro("Id")))
     {
         throw new Exception("料盘号为空,初始化数据失败!");
     }
     Pro2Col.DataRow2Obj(this, dr);
 }
Exemplo n.º 2
0
        private void CreateDiskAndSKUObject()
        {
            SKU  s = new SKU();
            Disk d = new Disk();

            foreach (DataRow dr in diskDataSource.Rows)
            {
                if (disks.ContainsKey(dr[d.GetColName4Pro("Id")].ToString()))
                {
                    throw new Exception("创建料盘列表出错,存在重复的料盘记录!");
                }
                string key = dr[d.GetColName4Pro("SkuId")].ToString();
                if (skus.ContainsKey(key))
                {
                    s = skus[key];
                }
                else
                {
                    s = new SKU(dr);
                    skus.Add(key, s);
                }
                disks.Add(dr[d.GetColName4Pro("Id")].ToString(), new Disk(s, dr));
            }
        }
Exemplo n.º 3
0
        private void CreateDiskObjects()
        {
            if (this.diskDataSource.Rows.Count == 0)
            {
                return;
            }
            SKU s = new SKU();
            Disk d = new Disk();
            foreach (DataRow dr in this.diskDataSource.Rows)
            {
                if (disks.ContainsKey(dr[d.GetColName4Pro("Id")].ToString()))
                {
                    throw new Exception("创建料盘列表出错,存在重复的料盘记录!");
                }

                string key = SKU.GetKey(dr[d.GetColName4Pro("BillRowNo")].ToString(), dr[d.GetColName4Pro("BillNo")].ToString());

                //如果料盘对应的物料不在ASN中,则不添加该料盘。
                if (skus.ContainsKey(key))
                {
                    s = skus[key];
                    disks.Add(dr[d.GetColName4Pro("Id")].ToString(), new Disk(s, dr));
                }
            }
        }
Exemplo n.º 4
0
 public Types.ScanInfo UnAsn()
 {
     Types.ScanInfo si;
     si = Scan(true, false);
     if (si != Types.ScanInfo.Successful) { return si; }
     this.sku = null;
     this.billNo = string.Empty;
     this.skuId = string.Empty;
     return Types.ScanInfo.Successful;
 }
Exemplo n.º 5
0
 public Types.ScanInfo UnPutAway()
 {
     Types.ScanInfo si;
     si = this.sku.Scan(-this.count, this.loc);
     if (si != Types.ScanInfo.Successful) { return si; }
     this.isScaned = false;
     this.loc = string.Empty;
     this.lot = string.Empty;
     this.sku = null;
     return Types.ScanInfo.Successful;
 }
Exemplo n.º 6
0
 private void CreateSKUObjects()
 {
     if (this.skuDataSource.Rows.Count == 0)
     {
         throw new Exception("移储数据出错,数据为空!");
     }
     SKU s = new SKU();
     foreach (DataRow dr in this.skuDataSource.Rows)
     {
         string key = s.GetKey(dr);
         if (skus.ContainsKey(key))
         {
             throw new Exception("创建物料列表出错,存在重复的物料记录!");
         }
         skus.Add(key, new SKU(dr));
     }
 }
Exemplo n.º 7
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;
        }
Exemplo n.º 8
0
 private void CreateLokDataTable()
 {
     lokDataSource = new DataTable();
     SKU s = new SKU();
     LOC l = new LOC();
     Pro2Col.AddColumns4Obj(s, lokDataSource, Types.ActionType.Loc);
     Pro2Col.AddColumns4Obj(l, lokDataSource, Types.ActionType.Loc);
 }
Exemplo n.º 9
0
 private void AddFinishBillToList()
 {
     if (this.skuDataSource.Rows.Count == 0)
     {
         throw new Exception("移储数据出错,物料数据为空!");
     }
     SKU s = new SKU();
     DataRow[] drs = this.skuDataSource.Select(s.GetColName4Pro("ScanFinish") + "=1");
     if (drs.Length == 0) { return; }
     foreach (DataRow dr in drs)
     {
         if (!this.FinishBillsId.Contains(dr[s.GetColName4Pro("BillNo")]))
         {
             this.FinishBillsId.Add(dr[s.GetColName4Pro("BillNo")]);
         }
     }
     drs = this.skuDataSource.Select(s.GetColName4Pro("ScanFinish") + "=0");
     if (drs.Length == 0) { return; }
     foreach (DataRow dr in drs)
     {
         if (this.FinishBillsId.Contains(dr[s.GetColName4Pro("BillNo")]))
         {
             this.FinishBillsId.Remove(dr[s.GetColName4Pro("BillNo")]);
         }
     }
 }
Exemplo n.º 10
0
 private void CreateDiskAndSKUObject()
 {
     SKU s = new SKU();
     Disk d = new Disk();
     foreach (DataRow dr in diskDataSource.Rows)
     {
         if (disks.ContainsKey(dr[d.GetColName4Pro("Id")].ToString()))
         {
             throw new Exception("创建料盘列表出错,存在重复的料盘记录!");
         }
         string key = dr[d.GetColName4Pro("SkuId")].ToString();
         if (skus.ContainsKey(key)) { s = skus[key]; }
         else
         {
             s = new SKU(dr);
             skus.Add(key, s);
         }
         disks.Add(dr[d.GetColName4Pro("Id")].ToString(), new Disk(s, dr));
     }
 }
Exemplo n.º 11
0
        private void CreateDiskObjects()
        {
            if (this.diskDataSource.Rows.Count == 0)
            {
                throw new Exception("拣货数据出错,料盘数据为空!");
            }
            SKU s = new SKU();
            Disk d = new Disk();
            foreach (DataRow dr in this.diskDataSource.Rows)
            {
                if (disks.ContainsKey(dr[d.GetColName4Pro("Id")].ToString()))
                {
                    throw new Exception("创建料盘列表出错,存在重复的料盘记录!");
                }

                string key = SKU.GetKey(dr[d.GetColName4Pro("BillRowNo")].ToString(), dr[d.GetColName4Pro("BillNo")].ToString());

                //如果料盘对应的物料不在ASN中,则不添加该料盘。
                //恢复保存时,物料和料盘已存在对应关系
                if (skus.ContainsKey(key)) { s = skus[key]; }
                else
                {
                    //没有则不关联
                    s = null;
                }
                disks.Add(dr[d.GetColName4Pro("Id")].ToString(), new Disk(s, dr));

            }
        }
Exemplo n.º 12
0
 private Disk CreateDiskFromSKU(SKU s)
 {
     Disk d = new Disk();
     d.Sku = s;
     d.Id = currentDiskId;
     d.Count = s.PackCount;
     d.TotalCount = s.PackCount;
     d.BillNo = s.BillNo;
     d.Storer = s.CompanyId;
     return d;
 }
Exemplo n.º 13
0
 private Disk CreateDiskFromSKU(SKU s, int PackCount,string loc)
 {
     Disk d = new Disk();
     d.Sku = s;
     d.Id = currentDiskId;
     d.Count = PackCount;
     d.TotalCount = s.PackCount;
     d.BillNo = s.BillNo;
     d.Storer = s.CompanyId;
     d.Loc = loc;
     return d;
 }
Exemplo n.º 14
0
 private void AddCurrentDisk(SKU s, int PackCount,string loc)
 {
     Disk d = CreateDiskFromSKU(s, PackCount, loc);
     disks.Add(d.Id, d);
     this.currentDiskId = d.Id;
 }
Exemplo n.º 15
0
 private void AddCurrentDisk(SKU s)
 {
     Disk d = CreateDiskFromSKU(s);
     disks.Add(d.Id, d);
     this.currentDiskId = d.Id;
 }
Exemplo n.º 16
0
 public Types.ScanInfo SKUScan(string skuID, DateTime createDatetime)
 {
     if (string.IsNullOrEmpty(skuID)) { return Types.ScanInfo.ScanError; }
     SKU s = GetCurrentSKU(skuID);
     if (s == null) { return Types.ScanInfo.NotInBill; }
     this.currentSKU = s;
     return Types.ScanInfo.Successful;
     //AddCurrentDisk(s);
     //Types.ScanInfo sInfo = CurrentDisk.Asn(createDatetime);
     //if (sInfo == Types.ScanInfo.Successful) { CheckIsFinish(); }
     //else { this.CurrentDisk.Sku = null; }
     //return sInfo;
 }
Exemplo n.º 17
0
 private void CreateDiskDataTable()
 {
     diskDataSource = new DataTable();
     SKU s = new SKU();
     LOC l = new LOC();
     Pro2Col.AddColumns4Obj(s, diskDataSource, Types.ActionType.Part);
     Pro2Col.AddColumns4Obj(l, diskDataSource, Types.ActionType.Part);
 }
Exemplo n.º 18
0
 private void CreateDiskAndSKUObject(DataTable dt)
 {
     SKU s = new SKU();
     Disk d = new Disk();
     foreach (DataRow dr in dt.Rows)
     {
         if (disks.ContainsKey(dr[d.GetColName4Pro("Id")].ToString()))
         {
             throw new Exception("创建料盘列表出错,存在重复的料盘记录!");
         }
         string key = dr[d.GetColName4Pro("SkuId")].ToString();
         if (skus.ContainsKey(key)) { s = skus[key]; }
         else
         {
             s = new SKU(dr);
             skus.Add(key, s);
         }
         d = new Disk(s, dr);
         disks.Add(dr[d.GetColName4Pro("Id")].ToString(), d);
         if (!string.IsNullOrEmpty(d.SubDiskId)) { subDiskIds.Add(d.SubDiskId); }
     }
 }
Exemplo n.º 19
0
 public DataTable UpdateSKUDataTable()
 {
     SKU s = new SKU();
     foreach (DataRow dr in skuDataSource.Rows)
     {
         s = skus[s.GetKey(dr)];
         Pro2Col.Obj2DataRow(s, dr, Types.ActionType.Pick);
     }
     return skuDataSource;
 }
Exemplo n.º 20
0
 private void CreateDiskDataTable()
 {
     SKU s = new SKU();
     Disk d = new Disk();
     this.diskDataSource = new DataTable();
     Pro2Col.AddColumns4Obj(d, diskDataSource, Types.ActionType.Common);
     Pro2Col.AddColumns4Obj(d, diskDataSource, Types.ActionType.Common);
     Common.DataSource.Tables.Add(this.diskDataSource);
 }
Exemplo n.º 21
0
 private void CreateSKUObjects()
 {
     if (this.skuDataSource.Rows.Count == 0)
     {
         throw new Exception("拣货数据出错,物料数据为空!");
     }
     SKU s = new SKU();
     foreach (DataRow dr in this.skuDataSource.Rows)
     {
         string key = s.GetKey(dr);
         if (skus.ContainsKey(key))
         {
             throw new Exception("创建物料列表出错,存在重复的物料记录!");
         }
         skus.Add(key, new SKU(dr));
         AddBillId(dr[s.GetColName4Pro("BillNo")].ToString());
     }
 }
Exemplo n.º 22
0
        private void CreateLocsObjects()
        {
            if (this.lokDataSource.Rows.Count == 0)
            {
                return;
            }
            SKU s = new SKU();
            foreach (DataRow dr in this.lokDataSource.Rows)
            {
                string key = s.GetKey(dr);

                //如果料盘对应的物料不在ASN中,则不添加该库位。
                if (skus.ContainsKey(key))
                {
                    s = skus[key];
                    s.AddLoc(dr);
                }
            }
        }