public static UserProxy GetUserProxy(User user) { if (user == null) { return null; } UserProxy userproxy = new UserProxy(); ConvertUserProxy(userproxy, user); return userproxy; }
private static void ConvertUserProxy( UserProxy userproxy,User user) { userproxy.UserID = user.UserID; userproxy.Username = user.Username; userproxy.Email = user.Email; userproxy.AvatarSrc = user.AvatarSrc; userproxy.AvatarUrl_120px = user.BigAvatarPath; userproxy.AvatarUrl_48px = user.AvatarPath; userproxy.AvatarUrl_24px = user.SmallAvatarPath; userproxy.Realname = user.Realname; userproxy.MobilePhone = user.MobilePhone; userproxy.Gender = (byte)user.Gender; userproxy.Birthdat = user.Birthday; }
private static void ConvertUserProxy(UserProxy userproxy, User user) { userproxy.UserID = user.UserID; userproxy.Username = user.Username; userproxy.Email = user.Email; userproxy.AvatarSrc = user.AvatarSrc; userproxy.AvatarUrl_120px = user.BigAvatarPath; userproxy.AvatarUrl_48px = user.AvatarPath; userproxy.AvatarUrl_24px = user.SmallAvatarPath; userproxy.Realname = user.Realname; userproxy.MobilePhone = user.MobilePhone; userproxy.Gender = (byte)user.Gender; userproxy.Birthdat = user.Birthday; userproxy.Points = new int[user.ExtendedPoints.Length]; for (int i = 0; i < user.ExtendedPoints.Length; i++) { userproxy.Points[i] = user.ExtendedPoints[i]; } }