public static TPlist Check(Unit trolley, Hook src, Hook dst) { TPlist result = null; try { TransportOrder to = new TransportOrder() { TransportSource = TransportOrder.Destinations.Storage, TransportTarget = TransportOrder.Destinations.Storage, State = TransportOrder.OrderStates.PreparedForTrolley }; to.SourceHook = src.ToString(); to.TargetHook = dst.ToString(); result = MovementSequencer.SplitTransportOrder(to, trolley); Console.WriteLine(result.ToString()); } catch { } return(result); }
public static void SaveMovements(TPlist list, int unit_id, string info = "check") { foreach (var item in list) { try { int id = MoveOrderEntry.GetNextId() + 100; while (BauerSql.Main.Database.ExecuteScalar <int>("SELECT COUNT(*) FROM UnitMoves WHERE ID=@0", id) > 0) { id = id + 100; } MoveOrderEntry move = new MoveOrderEntry() { ID = id, Source = "", TargetHook = item.target, Unit_ID = unit_id, WaitMove_ID = 0, Status = info, Trolley = 0, Carrier = 0 }; if (item.info == "GET") { move.Target = ""; move.SourceHook = item.target; } if (item.info == "PUT") { // Haken nicht leeren } move.Info = item.info; move.Insert(); } catch { } } }