public static MobileMessage createSuccessReturn() { MobileMessage br = new MobileMessage { error = (int)Error.NONE }; return(br); }
public static MobileMessage createErrorReturn(string sErrorMessage, int errorCode = -1) { MobileMessage br = new MobileMessage { data = sErrorMessage, error = errorCode }; return(br); }
public static MobileMessage createLoginErrorReturn(MobileAuthentication authentication) { MobileMessage br = new MobileMessage { error = authentication.getError(), data = authentication.getErrorMessage() }; return(br); }
public MobileMessage getMobileResponse(bool useMobileMesages) { MobileMessage response = new MobileMessage(); switch (results) { case Results.CommonEmailSent: { response.argBool = true; response.setNoError(); break; } case Results.CommonCodeCreationFailed: { response.setError((int)MobileMessage.Error.CREATE_CODE_FAILED); break; } case Results.CommonInvalidDeepLink: { response.setError((int)MobileMessage.Error.INVALID_DEEP_LINK); break; } case Results.CommonInvalidEmail: { response.setError((int)MobileMessage.Error.INVALID_EMAIL); break; } case Results.CreateMultipleMatches: { if (useMobileMesages) { sendDeepLink(); if (results == Results.CommonEmailSent) { response.setNoError(); response.argBool = true; } else { response.setError((int)MobileMessage.Error.EMAIL_NOT_SENT); } } else { response.setError((int)MobileMessage.Error.CREATE_FAILED); } break; } case Results.CreateFoundSimiliar: { if (useMobileMesages) { notifyAboutDuplicate(); notifyNewUserWithDeepLink(device, instance, key); if (results == Results.CommonEmailSent) { response.setNoError(); response.argBool = true; } else { response.setError((int)MobileMessage.Error.EMAIL_NOT_SENT); } } else { notifyAboutDuplicate(); notifyNewUser(); response.setNoError(); response.data = user.Username; } break; } case Results.CreateFoundPersonExistingUser: { if (useMobileMesages) { notifyNewUserWithDeepLink(device, instance, key); if (results == Results.CommonEmailSent) { response.setNoError(); response.argBool = true; } else { response.setError((int)MobileMessage.Error.EMAIL_NOT_SENT); } } else { notifyAboutExisting(); response.setNoError(); response.data = user.Username; } break; } case Results.CreateNewPersonAndUser: case Results.CreateFoundPersonNewUser: { if (useMobileMesages) { notifyNewUserWithDeepLink(device, instance, key); if (results == Results.CommonEmailSent) { response.setNoError(); response.argBool = true; } else { response.setError((int)MobileMessage.Error.EMAIL_NOT_SENT); } } else { notifyNewUser(); response.setNoError(); response.data = user.Username; } break; } case Results.DeepLinkNoPeopleFound: { response.argBool = false; response.setNoError(); break; } default: { response.setError((int)MobileMessage.Error.UNKNOWN); break; } } return(response); }