public void Extract(Guid srcPackID, string productCode) { Pack pack = PackBLL.Get4Extract(srcPackID); PackBLL.Add(pack.DIN, productCode, pack); if (pack.Status != Pack.StatusX.Produced) { PackBLL.ChangeStatus(pack.ID, Pack.StatusX.Produced, PackTransaction.TypeX.Out_Product); } }
public void Divide(Guid srcPackID, string division, int volume) { Pack pack = PackBLL.Get4Extract(srcPackID); string newProductCode = pack.ProductCode.Substring(0, pack.ProductCode.Length - 2) + division; PackBLL.Add(pack.DIN, newProductCode, volume, orgPack: pack); if (pack.Status != Pack.StatusX.Produced) { PackBLL.ChangeStatus(pack.ID, Pack.StatusX.Produced, PackTransaction.TypeX.Out_Product); } }
public void Divide() { string err = ValidateAllList4Divide(); if (!string.IsNullOrEmpty(err)) { throw new Exception(err); } List <Pack> packList = DINInList.Select(r => PackBLL.Get4Extract(r, ProductCodeInList.FirstOrDefault())).ToList(); foreach (Pack item in packList) { foreach (var item1 in DivisionList) { Divide(item.ID, item1.Ext, item1.Volume); } } }
public void Extract() { string err = ValidateAllList(); if (!string.IsNullOrEmpty(err)) { throw new Exception(err); } List <Pack> packList = DINInList.Select(r => PackBLL.Get4Extract(r, ProductCodeInList.FirstOrDefault())).ToList(); foreach (Pack item in packList) { foreach (string code in ProductCodeOutList) { //TODO: display all err pack. Extract(item.ID, code); } } }
private void Extract(Guid srcPackID, string productCode, int productionID, bool isAllowPos) { if (productionID <= 0) throw new Exception("Production null"); PackBLL bll = new PackBLL(); Pack pack = bll.Get4Extract(srcPackID, isAllowPos); var newP = PackBLL.Add(pack.DIN, productCode, pack); if (pack.Status != Pack.StatusX.Produced) PackBLL.ChangeStatus(pack.ID, Pack.StatusX.Produced, PackTransaction.TypeX.Out_Product); var pDetail = new ProductionDetail() { ProductionID = productionID, FromPackID = pack.ID, ToPackID = newP.ID, }; Add(pDetail); }
private void Divide(Guid srcPackID, string division, int volume, int productionID) { PackBLL bll = new PackBLL(); Pack pack = bll.Get4Extract(srcPackID); string newProductCode = pack.ProductCode.Substring(0, pack.ProductCode.Length - 2) + division; var newP = PackBLL.Add(pack.DIN, newProductCode, volume, orgPack: pack); if (pack.Status != Pack.StatusX.Produced) PackBLL.ChangeStatus(pack.ID, Pack.StatusX.Produced, PackTransaction.TypeX.Out_Product); var pDetail = new ProductionDetail() { ProductionID = productionID, FromPackID = pack.ID, ToPackID = newP.ID, }; Add(pDetail); }
public int Extract(string note, bool isAllowPos = false) { var p = new Production() { Actor = RedBloodSystem.CurrentActor, Note = note, FromProductCode1 = ProductCodeInList.ElementAtOrDefault(0), FromProductCode2 = ProductCodeInList.ElementAtOrDefault(1), FromProductCode3 = ProductCodeInList.ElementAtOrDefault(2), ToProductCode1 = ProductCodeOutList.ElementAtOrDefault(0), ToProductCode2 = ProductCodeOutList.ElementAtOrDefault(1), ToProductCode3 = ProductCodeOutList.ElementAtOrDefault(2), Type = Production.TypeX.Extract, }; p = Create(p); PackBLL bll = new PackBLL(); string err = ValidateAllList(); if (!string.IsNullOrEmpty(err)) throw new Exception(err); List<Pack> packList = DINInList.Select(r => bll.Get4Extract(r, ProductCodeInList.FirstOrDefault(), isAllowPos)).ToList(); foreach (Pack item in packList) { foreach (string code in ProductCodeOutList) { //TODO: display all err pack. Extract(item.ID, code, p.ID, isAllowPos); } } return p.ID; }
public void Divide(string note) { var p = new Production() { Actor = RedBloodSystem.CurrentActor, Note = note, FromProductCode1 = ProductCodeInList.ElementAtOrDefault(0), FromProductCode2 = ProductCodeInList.ElementAtOrDefault(1), FromProductCode3 = ProductCodeInList.ElementAtOrDefault(2), //TODO: Ser value for ProductCodeOutList //ToProductCode1 = ProductCodeOutList.ElementAtOrDefault(0), //ToProductCode2 = ProductCodeOutList.ElementAtOrDefault(1), //ToProductCode3 = ProductCodeOutList.ElementAtOrDefault(2), Type = Production.TypeX.Divide, }; p = Create(p); PackBLL bll = new PackBLL(); string err = ValidateAllList4Divide(); if (!string.IsNullOrEmpty(err)) throw new Exception(err); List<Pack> packList = DINInList.Select(r => bll.Get4Extract(r, ProductCodeInList.FirstOrDefault())).ToList(); foreach (Pack item in packList) { foreach (var item1 in DivisionList) { Divide(item.ID, item1.Ext, item1.Volume, p.ID); } } }