Example #1
0
 public Boolean CreateUser(ref User user, ref string message)
 {
     message = String.Empty;
     UserBDO userBDO = new UserBDO();
     TranslateUserDTOToUserBDO(user, userBDO);
     return userLogic.CreateUser(ref userBDO, ref message);
 }
Example #2
0
 public User GetUser(string username) {
     UserBDO ubdo = new UserBDO();
     ubdo = userLogic.GetUser(username);
     User u = new User();
     TranslateUserBDOToUserDTO(ubdo, u);
     
     return u;
 }
Example #3
0
 public List<User> GetAllUsers()
 {
     List<UserBDO> userBDOList = userLogic.GetAllUsers();
     List<User> allUsers = new List<User>();
     foreach (UserBDO userBDO in userBDOList) {
         User user = new User();
         TranslateUserBDOToUserDTO(userBDO, user);
         allUsers.Add(user);
     }
     return allUsers;
 }
Example #4
0
 public void TranslateUserBDOToUserDTO(UserBDO userBDO, User user)
 {
     user.UserId = userBDO.UserId;
     user.FirstName = userBDO.FirstName;
     user.LastName = userBDO.LastName;
     user.MiddleName = userBDO.MiddleName;
     user.UserName = userBDO.UserName;
     user.Password = userBDO.Password;
     user.UserTypeCode = userBDO.UserType.UserTypeCode;
 }
Example #5
0
 public void TranslateUserDTOToUserBDO(User user, UserBDO userBDO)
 {
     UserTypeBDO ut = new UserTypeBDO();
     ut.UserTypeCode = user.UserTypeCode;
     userBDO.UserId = user.UserId;
     userBDO.FirstName = user.FirstName;
     userBDO.LastName = user.LastName;
     userBDO.MiddleName = user.MiddleName;
     userBDO.UserName = user.UserName;
     userBDO.Password = user.Password;
     userBDO.UserType = ut;
 }