public void CreateTransportOrder(int type, int ctrH, int ctrD, LoadCarrier lc, int IocpId, int weight, StorageLocation sourceLocation, StorageLocation targetLocation) { //Csinálunk egy sessiont Session workSession = new Session(); //Megkeressük az erőforrásokat CommonTrHeader ctrHeader = workSession.FindObject <CommonTrHeader>(new BinaryOperator("Oid", ctrH)); CommonTrDetail cdetail = workSession.FindObject <CommonTrDetail>(new BinaryOperator("Oid", ctrD)); Iocp iocp = workSession.FindObject <Iocp>(new BinaryOperator("Oid", IocpId)); //Osztumk egy új sorszámot ushort UjTransportID = GetNewSorszam("TPO"); //Létrehozzuk az új transzportot az adatbázisban TransportOrder transportOrder = new TransportOrder(workSession); transportOrder.Iocp = iocp; transportOrder.TpId = UjTransportID; transportOrder.LC = lc; transportOrder.CommonTrHeader = ctrHeader; transportOrder.CommonDetail = cdetail; transportOrder.Type = type; transportOrder.TargetTag = iocp.TargetTag; transportOrder.SourceLocation = sourceLocation; transportOrder.TargetLocation = targetLocation; transportOrder.Weight = weight; transportOrder.Save(); // Hozzáadjuk a megfelelő iocp zsák queue-hoz this.opcClient.addJob(transportOrder); }