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); }
public User GetUser(string username) { UserBDO ubdo = new UserBDO(); ubdo = userLogic.GetUser(username); User u = new User(); TranslateUserBDOToUserDTO(ubdo, u); return u; }
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; }
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; }
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; }