Exemple #1
0
 /// <summary>
 /// Retrieve user's info from GOMS
 /// </summary>
 /// <param name="user">User to get info from GOMS</param>
 /// <returns></returns>
 public RespGetSubscriberInfo GetUser(User user)
 {
     RespGetSubscriberInfo result = null;
     try
     {
         if (user != null)
         {
             if (user.IsGomsRegistered)
             {
                 result = GetUser((int)user.GomsCustomerId, user.EMail);
             }
             else
             {
                 throw new GomsUserNotRegisteredException();
             }
         }
         else
         {
             throw new GomsInvalidUserException();
         }
     }
     catch (GomsException e)
     {
         result = new RespGetSubscriberInfo { IsSuccess = false, StatusCode = e.StatusCode, StatusMessage = e.StatusMessage };
     }
     return (result);
 }
Exemple #2
0
 /// <summary>
 /// Retrieve User's info from GOMS
 /// </summary>
 /// <param name="gomsCustomerId">User's GOMS customer ID</param>
 /// <param name="email">User's e-mail address</param>
 /// <returns></returns>
 public RespGetSubscriberInfo GetUser(int gomsCustomerId, string email)
 {
     InitializeServiceClient();
     RespGetSubscriberInfo result = null;
     try
     {
         try
         {
             result = _serviceClient.GetSubscriberInfo(new ReqGetSubscriberInfo
              {
                  UID = ServiceUserId,
                  PWD = ServicePassword,
                  CustomerId = gomsCustomerId,
                  Email = email
              });
         }
         catch (Exception e)
         {
             throw new GomsServiceCallException(e.Message);
         }
     }
     catch (GomsException e)
     {
         result = new RespGetSubscriberInfo { IsSuccess = false, StatusCode = e.StatusCode, StatusMessage = e.StatusMessage };
     }
     return (result);
 }