Пример #1
0
 public Types.ScanInfo OldDiskScan(string diskId,bool isUnDo)
 {
     if (string.IsNullOrEmpty(diskId)) { return Types.ScanInfo.ScanError; }
     if (!this.disks.ContainsKey(diskId)) { return Types.ScanInfo.NotInBill; }
     currentDisk = disks[diskId];
     if (isUnDo) { return currentDisk.UnMoveBegion(); }
     return currentDisk.MoveBegin();
 }
Пример #2
0
 public Types.ScanInfo DiskScan(string diskId, bool isUndo)
 {
     if (string.IsNullOrEmpty(diskId)) { return Types.ScanInfo.ScanError; }
     if (!disks.ContainsKey(diskId)) { return Types.ScanInfo.NotInBill; }
     this.currentDisk = disks[diskId];
     if (isUndo) { return this.currentDisk.UnReturn(); }
     return currentDisk.Return();
 }
Пример #3
0
 public bool AddDisk(DataSet ds)
 {
     if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
     {
         throw new Exception("数据库中无此料盘数据!");
     }
     Disk d = new Disk();
     this.CreateDiskAndSKUObject(ds.Tables[0]);
     return true;
 }
Пример #4
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.SkuId);
            if (s == null) { return Types.ScanInfo.NotInBill; }
            else
            {
                this.currentDisk.Sku = s;
                //this.currentDisk.Lot = s.Lot;
            }
            return Types.ScanInfo.Successful;
        }
Пример #5
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); }
     }
 }
Пример #6
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;
 }
Пример #7
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);
 }
Пример #8
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;
 }
Пример #9
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));
                }
            }
        }
Пример #10
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;
 }
Пример #11
0
 private void CreateDiskDataTable()
 {
     diskDataSource = new DataTable();
     Disk d = new Disk();
     Pro2Col.AddColumns4Obj(d, diskDataSource, Types.ActionType.ASN);
 }
Пример #12
0
 public Types.ScanInfo ParentDiskScan(string parentDiskId, bool isUndo)
 {
     if (string.IsNullOrEmpty(parentDiskId)) { return Types.ScanInfo.ScanError; }
     if (isUndo) { return UnDoScan(parentDiskId); }
     if (!disks.ContainsKey(parentDiskId)) { this.disks.Add(parentDiskId, new Disk(parentDiskId)); }
     this.currentDisk = disks[parentDiskId];
     if (currentDisk.IsScaned) { return Types.ScanInfo.RepeatScan; }
     return Types.ScanInfo.Successful;
 }
Пример #13
0
 private void CreateDiskObjects()
 {
     if (this.diskDataSource.Rows.Count == 0)
     {
         throw new Exception("移库数据出错,料盘数据为空!");
     }
     Disk d = new Disk();
     foreach (DataRow dr in this.diskDataSource.Rows)
     {
         if (disks.ContainsKey(dr[d.GetColName4Pro("Id")].ToString()))
         {
             throw new Exception("创建料盘列表出错,存在重复的料盘记录!");
         }
         d = new Disk(null, dr);
         d.SkuId = dr[d.GetColName4Pro("SkuId")].ToString();
         disks.Add(dr[d.GetColName4Pro("Id")].ToString(), d);
     }
 }
Пример #14
0
 public Types.ScanInfo DiskScan(string diskId, bool isUndo)
 {
     if (string.IsNullOrEmpty(diskId)) { return Types.ScanInfo.ScanError; }
     if (isUndo) { return UnDoScan(diskId); }
     if (!disks.ContainsKey(diskId)) { this.disks.Add(diskId, new Disk(diskId)); }
     this.currentDisk = disks[diskId];
     return this.currentDisk.CommanScan();
 }
Пример #15
0
 private SKU GetCurrentSKU(Disk d)
 {
     SKU last = null;
     foreach (SKU s in skus.Values)
     {
         //if (s.Id == d.SkuId && s.PickLoc == d.Loc&& s.CompanyId == d.Storer && s.BillNo == d.BillNo)// && s.Lot == d.Lot
         if (s.Id == d.SkuId && s.PickLoc == d.Loc &&  s.BillNo == d.BillNo)
         {
             if (!s.ScanFinish) return s;
             last = s;
         }
     }
     return last;
 }
Пример #16
0
 private static void AddTempData()
 {
     try
     {
         DataSet ds = PartDisk.DataSource;
         Disk d = new Disk();
         DataSet dsOld = MySerialization.DeSerialize(PartDisk.TempFileUrl);
         if (dsOld == null || dsOld.Tables.Count == 0 || dsOld.Tables[0].Rows.Count == 0)
         {
             return;
         }
         for (int i = 0; i < dsOld.Tables.Count; i++)
         {
             if (ds.Tables.Count > i)
             {
                 foreach (DataRow dr in ds.Tables[i].Rows)
                 {
                     if (dsOld.Tables[i].Select(d.GetColName4Pro("Id") + "="
                         + string.Format("'{0}'", dr[d.GetColName4Pro("Id")])).Length != 0) { continue; }
                     DataRow drOld = dsOld.Tables[i].NewRow();
                     dr.ItemArray.CopyTo(drOld.ItemArray, 0);
                     dsOld.Tables[i].Rows.Add(dr);
                 }
             }
         }
         PartDisk.DataSource = dsOld;
     }
     catch
     {
     }
 }
Пример #17
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));

            }
        }
Пример #18
0
 public DataTable UpdateDiskDataTable()
 {
     Disk d = new Disk();
     foreach (DataRow dr in diskDataSource.Rows)
     {
         d = disks[dr[d.GetColName4Pro("Id")].ToString()];
         Pro2Col.Obj2DataRow(d, dr, Types.ActionType.Pick);
     }
     return diskDataSource;
 }
Пример #19
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;
        }
Пример #20
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));
     }
 }
Пример #21
-1
 public Types.ScanInfo NewDiskScan(string diskId, string loc,bool isUnDo)
 {
     if (string.IsNullOrEmpty(diskId) || string.IsNullOrEmpty(loc)) { return Types.ScanInfo.ScanError; }
     if (!this.disks.ContainsKey(diskId)) { return Types.ScanInfo.NotInBill; }
     currentDisk = disks[diskId];
     if (isUnDo) { return currentDisk.UnMove(); }
     return currentDisk.Move(loc);
 }