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 static void Return(int returnID, int packOrderID, string note) { RedBloodDataContext db = new RedBloodDataContext(); PackOrder po = Get4Return(db, packOrderID); po.ReturnID = returnID; db.SubmitChanges(); PackBLL.ChangeStatus(po.Pack.ID, Pack.StatusX.Product, PackTransaction.TypeX.In_Return, note); }
public static void Delete(int deleteID, Guid packID, string note) { RedBloodDataContext db = new RedBloodDataContext(); Pack p = Get4Delete(db, packID); p.DeleteID = deleteID; db.SubmitChanges(); PackBLL.ChangeStatus(p.ID, Pack.StatusX.Delete, PackTransaction.TypeX.Out_Delete, note); }
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 static void Add(int orderID, string DIN, string productCode) { RedBloodDataContext db = new RedBloodDataContext(); Order r = OrderBLL.Get4Add(orderID); Pack p = PackBLL.Get4Order(DIN, productCode); PackOrder po = new PackOrder(); po.OrderID = r.ID; po.PackID = p.ID; db.PackOrders.InsertOnSubmit(po); db.SubmitChanges(); PackTransaction.TypeX transType = r.Type == Order.TypeX.ForCR ? PackTransaction.TypeX.Out_Order4CR : r.Type == Order.TypeX.ForOrg ? PackTransaction.TypeX.Out_Order4Org : PackTransaction.TypeX.Out_OrderGen; PackBLL.ChangeStatus(p.ID, Pack.StatusX.Delivered, transType, "PackOrderID = " + po.ID.ToString()); }