public UserInfo UserLoginInfoCreate(string externalid, string source, string gender, string preference, string age, string onlinestatus) { try { UserLogin userLogin = new UserLogin() { ExternalID = externalid, UserSourceType = (SourceType)Enum.Parse(typeof(SourceType), source) }; UserService userService = new UserService(); userLogin = userService.LoginCreate(userLogin); UserInfo userInfo = new UserInfo() { UserID = userLogin.UserID, Age = short.Parse(age), Preference = (PreferenceType)Enum.Parse(typeof(PreferenceType), preference), Gender = (GenderType)Enum.Parse(typeof(GenderType), gender), OnlineStatusID = short.Parse("0" + onlinestatus) }; return userService.UserInfoCreate(userInfo); } catch (Exception e) { Logging.WriteToEventLog("USER UserLoginInfoCreate " + e.Message); return null; } }
public UserInfo UserInfoUpdate(string userid, string gender, string preference, string age, string email, string handle) { try { UserService userService = new UserService(); UserInfo userInfo = new UserInfo() { UserID = int.Parse(userid), Age = short.Parse(age), Preference = (PreferenceType)Enum.Parse(typeof(PreferenceType), preference), Gender = (GenderType)Enum.Parse(typeof(GenderType), gender), OnlineStatusID = 1, Handle = handle, EmailAddress = email }; Logging.WriteToFileLog(string.Format("userid : {0}, gender : {1}, preference : {2}, age : {3}, email: {4}, handle: {5}", userid, gender, preference, age, email, handle)); return userService.UserInfoCreate(userInfo); } catch (Exception e) { Logging.WriteToEventLog("USER UserInfoUpdate " + e.Message); return null; } }
public UserInfo UserInfoCreate(string userid, string gender, string preference, string age, string onlinestatus, string handle) { try { UserService userService = new UserService(); UserInfo userInfo = new UserInfo() { UserID = int.Parse("0" + userid), Age = short.Parse(age), Preference = (PreferenceType)Enum.Parse(typeof(PreferenceType), preference), Gender = (GenderType)Enum.Parse(typeof(GenderType), gender), OnlineStatusID = short.Parse("0" + onlinestatus), Handle = handle }; return userService.UserInfoCreate(userInfo); } catch (Exception e) { Logging.WriteToEventLog("USER UserInfoCreate " + e.Message); return null; } }
private object UserInfoConverter(IDataReader dr, object dataObject) { List<Entities.UserInfo> users = dataObject as List<Entities.UserInfo>; UserInfo user = new UserInfo(); users.Add(user); user.UserID = int.Parse(dr["UserID"].ToString()); user.PictureLocation = dr["PictureLocation"].ToString(); user.OnlineStatusID = short.Parse(dr["OnlineStatusID"].ToString()); user.InstantTitle = dr["InstantTitle"].ToString(); user.Gender = (GenderType) Enum.Parse(typeof(GenderType), dr["Gender"].ToString()); user.Preference = (PreferenceType) Enum.Parse(typeof(PreferenceType), dr["Preference"].ToString()); user.Age = short.Parse(dr["Age"].ToString()); user.InterestType = UIScanType.BROWSE; user.Handle = dr["Handle"].ToString(); user.EmailAddress = dr["Email"].ToString(); return dataObject; }
public UserInfo UserInfoGet(int userID) { UserInfo userInfo = new UserInfo(); List<UserInfo> userInfos = new List<UserInfo>(); userInfo.UserID = userID; this.userResource.UserInfoGet(userInfo.UserID, this.UserInfoConverter, userInfos); return userInfos[0]; }
public UserInfo UserInfoCreate(UserInfo userInfo) { this.userResource.UserInfoCreate(userInfo.UserID, userInfo.Gender, userInfo.Preference, userInfo.Age, userInfo.PictureLocation, userInfo.OnlineStatusID.ToString(), userInfo.EmailAddress, userInfo.Handle, this.UserLoginConverter, userInfo); return userInfo; }