public static UserModel ToUserModelR(Enter.Common.DTO.UserDTO user) { UserModel UserModel = new UserModel(); UserModel.Email = user.EmailAddress; UserModel.FirstName = user.FirstName; UserModel.LastName = user.LastName; UserModel.Role = user.Role.ToString(); UserModel.IsActive = user.IsActive; UserModel.UserId = user.UserId; return(UserModel); }
internal static Enter.Common.DTO.UserDTO ToUserDTO(UserModel UserModel) { Enter.Common.DTO.UserDTO UserDTO = new Enter.Common.DTO.UserDTO(); UserDTO.EmailAddress = UserModel.Email; UserDTO.UserId = UserModel.UserId; UserDTO.FirstName = UserModel.FirstName; UserDTO.LastName = UserModel.LastName; UserDTO.Role = int.Parse(UserModel.Role); UserDTO.IsActive = UserModel.IsActive; if (!string.IsNullOrEmpty(UserModel.PhoneNumber)) { UserDTO.PhoneNumber = UserModel.PhoneNumber; } else { UserDTO.PhoneNumber = "123456789"; } return(UserDTO); }