public Disk(SKU sku, DataRow dr) { this.sku = sku; if (!dr.Table.Columns.Contains(this.GetColName4Pro("Id"))) { throw new Exception("料盘号为空,初始化数据失败!"); } Pro2Col.DataRow2Obj(this, dr); }
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)); } }
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)); } } }
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; }
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; }
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)); } }
//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; }
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); }
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")]); } } }
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)); } }
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; }
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; }
private void AddCurrentDisk(SKU s, int PackCount,string loc) { Disk d = CreateDiskFromSKU(s, PackCount, loc); disks.Add(d.Id, d); this.currentDiskId = d.Id; }
private void AddCurrentDisk(SKU s) { Disk d = CreateDiskFromSKU(s); disks.Add(d.Id, d); this.currentDiskId = d.Id; }
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; }
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); }
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); } } }
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; }
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); }
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()); } }
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); } } }