//# __________ PROTOCOL :: PRIVATE (SCHEDULED UPLOADS) __________ #// public JwList<VmScheduledUpload> DetermineUploads() { JwList<VmScheduledUpload> v = new JwList<VmScheduledUpload>(); JwList<String> airports = VmAccountData.Default.GetDeviceAirports(); foreach( String airportCode in airports) { VmAirportData ad = new VmAirportData( VmAccountData.Default.AccountInputData, airportCode); String path = JwUtility.JoinPath(VmAccountData.Default.GetOutputAirportPath(), airportCode); DirectoryInfo di = new DirectoryInfo(path); if( ! di.Exists ) continue; AddUploadIfNonEmpty(v, VmAirportOutputData.FLIGHT_FILE_NAME, ad.AirportOutputData.GetFlightFileName(), FILE_TYPE_FLIGHT, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.ARRIVING_FLIGHT_FILE_NAME, ad.AirportOutputData.GetArrivingFlightFileName(), FILE_TYPE_ARRIVING_FLIGHT, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.TRUCK_FILE_NAME, ad.AirportOutputData.GetTruckFileName(), FILE_TYPE_TRUCK, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.CONTAINER_NEST_FILE_NAME, ad.AirportOutputData.GetContainerFileName(), FILE_TYPE_CONTAINER, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.ULD_NEST_FILE_NAME, ad.AirportOutputData.GetUldFileName(), FILE_TYPE_ULD_NEST, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.VIRTUAL_NEST_FILE_NAME, ad.AirportOutputData.GetVirtualNestFileName(), FILE_TYPE_VIRTUAL_NEST, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.CART_NEST_FILE_NAME, ad.AirportOutputData.GetCartNestFileName(), FILE_TYPE_CART_NEST, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.FLIGHT_NEST_FILE_NAME, ad.AirportOutputData.GetFlightNestFileName(), FILE_TYPE_FLIGHT_NEST, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.FLIGHT_DESTINATION_NEST_FILE_NAME, ad.AirportOutputData.GetFlightDestinationNestFileName(), FILE_TYPE_FLIGHT_DESTINATION_NEST, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.ITEM_NEST_FILE_NAME, ad.AirportOutputData.GetItemNestFileName(), FILE_TYPE_ITEM_NEST, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.ITEM_FILE_NAME, ad.AirportOutputData.GetItemManifestFileName(), FILE_TYPE_ITEM, airportCode); AddUploadIfNonEmpty(v, VmAirportOutputData.ALIAS_FILE_NAME, ad.AirportOutputData.GetAliasManifestFileName(), FILE_TYPE_ALIAS, airportCode); // RECEIVE - RETURN AddUpload(v, airportCode, ad.AirportOutputData.GetEventReceivingPath(), FILE_TYPE_RECEIVE_ITEM); AddUpload(v, airportCode, ad.AirportOutputData.GetEventReceivingAliasPath(), FILE_TYPE_RECEIVE_ALIAS); AddUpload(v, airportCode, ad.AirportOutputData.GetEventReturnItemPath(), FILE_TYPE_RETURN_ITEM); // TRUCK AddUpload(v, airportCode, ad.AirportOutputData.GetEventFromTruckPath(), FILE_TYPE_FROM_TRUCK_ITEM); // LOAD AddUpload(v, airportCode, ad.AirportOutputData.GetEventLoadItemPath(), FILE_TYPE_LOAD_ITEM); AddUpload(v, airportCode, ad.AirportOutputData.GetEventLoadAliasPath(), FILE_TYPE_LOAD_ALIAS); AddUpload(v, airportCode, ad.AirportOutputData.GetEventLoadItemAsNestPath(), FILE_TYPE_LOAD_DELEGATE); AddUpload(v, airportCode, ad.AirportOutputData.GetEventLoadNestPath(), FILE_TYPE_LOAD_NEST); AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventLoadMixedItemPath(), FILE_TYPE_LOAD_MIXED_ITEM); // kludge (err) - faking mixed alias AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventLoadMixedAliasPath(), FILE_TYPE_LOAD_ALIAS); AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventLoadMixedNestPath(), FILE_TYPE_LOAD_MIXED_NEST); // UNLOAD AddUpload(v, airportCode, ad.AirportOutputData.GetEventUnloadItemPath(), FILE_TYPE_UNLOAD_ITEM); AddUpload(v, airportCode, ad.AirportOutputData.GetEventUnloadAliasPath(), FILE_TYPE_UNLOAD_ALIAS); AddUpload(v, airportCode, ad.AirportOutputData.GetEventUnloadDelegatePath(), FILE_TYPE_UNLOAD_DELEGATE); AddUpload(v, airportCode, ad.AirportOutputData.GetEventUnloadNestPath(), FILE_TYPE_UNLOAD_NEST); // DELIVER AddUpload(v, airportCode, ad.AirportOutputData.GetEventDeliverItemPath(), FILE_TYPE_DELIVER_ITEM); AddUpload(v, airportCode, ad.AirportOutputData.GetEventDeliverAliasPath(), FILE_TYPE_DELIVER_ALIAS); AddUpload(v, airportCode, ad.AirportOutputData.GetEventDeliverItemAsNestPath(), FILE_TYPE_DELIVER_DELEGATE); AddUpload(v, airportCode, ad.AirportOutputData.GetEventDeliverNestPath(), FILE_TYPE_DELIVER_NEST); AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventDeliverMixedItemPath(), FILE_TYPE_DELIVER_MIXED_ITEM); // kludge (err) - faking mixed alias AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventDeliverMixedAliasPath(), FILE_TYPE_DELIVER_ALIAS); AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventDeliverMixedNestPath(), FILE_TYPE_DELIVER_MIXED_NEST); AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventDeliverFlightPath(), FILE_TYPE_DELIVER_FLIGHT); // ADD TO NEST AddUpload(v, airportCode, ad.AirportOutputData.GetEventAddItemToNestPath(), FILE_TYPE_ADD_ITEM_TO_NEST); AddUpload(v, airportCode, ad.AirportOutputData.GetEventAddAliasToNestPath(), FILE_TYPE_ADD_ALIAS_TO_NEST); // kludge (err) - place holder for add item to delegate AddUpload(v, airportCode, ad.AirportOutputData.GetEventAddNestToNestPath(), FILE_TYPE_ADD_NEST_TO_NEST); AddUpload(v, airportCode, ad.AirportOutputData.GetEventAddDelegateToNestPath(), FILE_TYPE_ADD_DELEGATE_TO_NEST); // kludge (err) - place holder for add nest to delegate // kludge (err) - place holder for add delegate to delegate // REMOVE FROM NEST AddUpload(v, airportCode, ad.AirportOutputData.GetEventRemoveItemFromNestPath(), FILE_TYPE_REMOVE_ITEM_FROM_NEST); AddUpload(v, airportCode, ad.AirportOutputData.GetEventRemoveAliasFromNestPath(), FILE_TYPE_REMOVE_ALIAS_FROM_NEST); // kludge (err) - place holder for remove item from delegate AddUpload(v, airportCode, ad.AirportOutputData.GetEventRemoveNestFromNestPath(), FILE_TYPE_REMOVE_NEST_FROM_NEST); AddUpload(v, airportCode, ad.AirportOutputData.GetEventRemoveDelegateFromNestPath(), FILE_TYPE_REMOVE_DELEGATE_FROM_NEST); // kludge (err) - place holder for remove nest from delegate // kludge (err) - place holder for remove delegate from delegate // BREAK NEST AddUpload(v, airportCode, ad.AirportOutputData.GetEventEmptyNestPath(), FILE_TYPE_CLEAR_NEST); AddUpload(v, airportCode, ad.AirportOutputData.GetEventEmptyDelegatePath(), FILE_TYPE_CLEAR_DELEGATE); // TAKE AddUpload(v, airportCode, ad.AirportOutputData.GetEventTakeItemPath(), FILE_TYPE_TAKE_ITEM); AddUpload(v, airportCode, ad.AirportOutputData.GetEventTakeAliasPath(), FILE_TYPE_TAKE_ALIAS); // GIVE AddUpload(v, airportCode, ad.AirportOutputData.GetEventGiveItemPath(), FILE_TYPE_GIVE_ITEM); AddUpload(v, airportCode, ad.AirportOutputData.GetEventGiveAliasPath(), FILE_TYPE_GIVE_ALIAS); AddUpload(v, airportCode, ad.AirportOutputData.GetEventGiveDelegatePath(), FILE_TYPE_GIVE_DELEGATE); AddUpload(v, airportCode, ad.AirportOutputData.GetEventGiveNestPath(), FILE_TYPE_GIVE_NEST); AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventGiveMixedItemPath(), FILE_TYPE_GIVE_MIXED_ITEM); // kludge (err) - faking mixed alias AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventGiveMixedAliasPath(), FILE_TYPE_GIVE_ALIAS); AddUploadIfNonEmpty(v, airportCode, ad.AirportOutputData.GetEventGiveMixedNestPath(), FILE_TYPE_GIVE_MIXED_NEST); // MOVE ITEMS AddUpload(v, airportCode, ad.AirportOutputData.GetEventMoveItemsPath(), FILE_TYPE_MOVE_ITEMS); AddUpload(v, airportCode, ad.AirportOutputData.GetEventTopOffNestPath(), FILE_TYPE_TOP_OFF_NEST); // ASSIGN ALIAS TO NEST AddUpload(v, airportCode, ad.AirportOutputData.GetEventAssignAliasToNestPath(), FILE_TYPE_ASSIGN_ALIAS_TO_NEST); } AddAccountUpload(v, VmAccountData.Default.AccountOutputData.GetNotePath(), FILE_TYPE_NOTE); return v; }
//# __________ PROTOCOL :: CONSTRUCTORS __________ #// public VmAirportOutputData(VmAirportData airportData) { AirportData = airportData; }
//# __________ PROTOCOL :: PUBLIC (LOGIN) __________ #// public VmUser ValidateLogin(String userName, String password) { userName = userName.ToLower(); VmUser user = null; JwList<String> airports = VmAccountData.Default.GetDeviceAirports(); foreach( String airportCode in airports ) { VmAirportData ad = new VmAirportData(VmAccountData.Default.AccountInputData,airportCode); user = ad.GetUser(userName); if( user != null ) break; } if( user == null ) return null; String sha1Hash = JwUtility.ToSha1Hash( userName, password); return ( JwUtility.IsEqual(sha1Hash, user.PasswordHash ) ) ? user : (VmUser)null; }
//# __________ PROTOCOL :: CONSTANTS __________ #// //# __________ PROTOCOL :: CONSTRUCTORS __________ #// public VmPlannedRouteData(VmAirportData airportData) { _airportData = airportData; }
public JwList<String> GetAirportCodesForUser(String userName) { userName = userName.ToLower(); JwList<String> userAirportCodes = new JwList<String>(); JwList<String> airports = VmAccountData.Default.GetDeviceAirports(); foreach( String airportCode in airports ) { VmAirportData ad = new VmAirportData(VmAccountData.Default.AccountInputData,airportCode); VmUser user = ad.GetUser(userName); if( user != null ) userAirportCodes.Add(airportCode); } return userAirportCodes; }