Exemplo n.º 1
0
		public int DeleteCascadeVehicleTransport( RecTransport transport, RecTransportVehicleStd veh )
		{
			RecTransportStack rec = new RecTransportStack();
			rec.Factory = transport.Factory;
			rec.Project = transport.Project;
			rec.TransportId = transport.TransportId;
			rec.VehicleId = veh.VehicleId;

			// Delete cascade stacks
			ProjectManager svc = new ProjectManager();
			List<RecTransportStack> stacks = svc.LoadTransportStack( rec );
			foreach( RecTransportStack stack in stacks )
			{
				this.DeleteCascadeStackTransport( transport, veh, stack );
			}

			// Now delete the vehicle
			ProjectManager vehSvc = new ProjectManager();
			List<RecTransportVehicleStd> vehicles = new List<RecTransportVehicleStd>();
			vehicles.Add( veh );
			return vehSvc.RemoveTransportVehicles( transport, vehicles );
		}