public Models.CGUser GetUserByUserId(string userId)
 {
     using (UserManagementServiceClient proxy = new UserManagementServiceClient()) {
         UserManagementServiceReference.CGUser serviceUser = proxy.GetUserByUserId(userId);
         Models.CGUser clientUser = UserModelModelConverter.ConvertFromServiceUserToClientUser(serviceUser);
         return(clientUser);
     }
 }
Esempio n. 2
0
 public CGUserModel GetUserByUserName(string userName)
 {
     using (UserManagementServiceClient proxy = new UserManagementServiceClient()) {
         UserManagementServiceReference.CGUser serviceUser = proxy.GetCGUserByUserName(userName);
         Models.CGUserModel clientUser = CGUserModelConverter.ConvertFromServiceUserToClientUser(serviceUser);
         return(clientUser);
     }
 }
Esempio n. 3
0
 internal static UserManagementServiceReference.CGUser[] ConvertFromClientListOfUsersToServiceListOfUsers(List <Models.CGUserModel> clientCGUsers)
 {
     UserManagementServiceReference.CGUser[] serviceCGUsers = new UserManagementServiceReference.CGUser[clientCGUsers.Count];
     for (int i = 0; i < clientCGUsers.Count; i++)
     {
         UserManagementServiceReference.CGUser cgU = ConvertFromClientUserToServiceUser(clientCGUsers[i]);
         serviceCGUsers[i] = cgU;
     }
     return(serviceCGUsers);
 }
Esempio n. 4
0
 internal static Models.CGUserModel ConvertFromServiceUserToClientUser(UserManagementServiceReference.CGUser serviceCGUser)
 {
     Models.CGUserModel clientCGUser = new Models.CGUserModel()
     {
         Id         = serviceCGUser.Id,
         UserName   = serviceCGUser.UserName,
         Email      = serviceCGUser.Email,
         Health     = serviceCGUser.Health,
         userType   = (Models.CGUserModel.UserType)serviceCGUser.userType,
         userStatus = (Models.CGUserModel.UserStatus)serviceCGUser.userStatus,
     };
     return(clientCGUser);
 }
Esempio n. 5
0
 internal static UserManagementServiceReference.CGUser ConvertFromClientUserToServiceUser(Models.CGUserModel clientCGUser)
 {
     UserManagementServiceReference.CGUser serviceUser = new UserManagementServiceReference.CGUser()
     {
         Id         = clientCGUser.Id,
         UserName   = clientCGUser.UserName,
         Email      = clientCGUser.Email,
         Health     = clientCGUser.Health,
         userType   = (UserManagementServiceReference.CGUser.UserType)clientCGUser.userType,
         userStatus = (UserManagementServiceReference.CGUser.UserStatus)clientCGUser.userStatus,
     };
     return(serviceUser);
 }
 private static UserManagementServiceReference.CGUser ConvertFromClientUserToServiceUser(Models.CGUser clientUser)
 {
     UserManagementServiceReference.CGUser serviceUser = new UserManagementServiceReference.CGUser()
     {
         Id         = clientUser.Id,
         UserName   = clientUser.UserName,
         Email      = clientUser.Email,
         userType   = (UserManagementServiceReference.CGUser.UserType)clientUser.userType,
         userStatus = (UserManagementServiceReference.CGUser.UserStatus)clientUser.userStatus,
         Health     = clientUser.Health,
         cards      = ConvertFromListOfClientCardsToListOfServiceCards(clientUser.cards)
     };
     return(serviceUser);
 }
 internal static Models.CGUser ConvertFromServiceUserToClientUser(UserManagementServiceReference.CGUser serviceUser)
 {
     Models.CGUser clientUser = new Models.CGUser()
     {
         Id         = serviceUser.Id,
         UserName   = serviceUser.UserName,
         Email      = serviceUser.Email,
         userType   = (Models.CGUser.UserType)serviceUser.userType,
         userStatus = (Models.CGUser.UserStatus)serviceUser.userStatus,
         Health     = serviceUser.Health,
     };
     if (serviceUser.cards != null)
     {
         clientUser.cards = ConvertFromListOfServiceCardsToListOfClientCards(serviceUser.cards);
     }
     return(clientUser);
 }