public User(BitmapImage Image, eGender PersonGender, string First, string Last, DateTime DateOfBitrh, eRelationshipStatus RelationshipStatus, string School = null, string University = null) : this(PersonGender, First, Last, DateOfBitrh, RelationshipStatus, School, University) { Activate(); News.UserPosts.Add(new NewsItem(this, Image)); }
public void setEnums() { g = (eGender)System.Enum.Parse(typeof(eGender), gender); r = (eReligion)System.Enum.Parse(typeof(eReligion), religion); p = (ePolitics)System.Enum.Parse(typeof(ePolitics), politics); n = (eNationality)System.Enum.Parse(typeof(eNationality), nationality); }
private bool checkIfMatch(User i_User, eGender i_Gender, int i_MinAge, int i_MaxAge) { bool isMatch = true; if (i_User.Gender != i_Gender) { isMatch = false; } if (isMatch) { DateTime today = DateTime.Today; CultureInfo cultureDateTime = new CultureInfo("en-US"); DateTime birthdayUser = Convert.ToDateTime(i_User.Birthday, cultureDateTime); int age = today.Year - birthdayUser.Year; today.AddYears(-age); if (DateTime.Compare(birthdayUser, today) > 0) { age--; } if (age < i_MinAge || age > i_MaxAge) { isMatch = false; } } return(isMatch); }
public int FindBaseYears(eGender vGender) { if (vGender == eGender.male) { return 85; } else { return 90; } }
public static async Task <Person> MakeNew(eGender PersonGender) { var p = new Person(); p = await p.FillBlanks(PersonGender); return(p); }
public new static async Task <User> MakeNew(eGender PersonGender) { var p = new User(); p = await p.FillBlanks(PersonGender) as User; return(p); }
public Person(eGender PersonGender, string First, string Last, DateTime DateOfBirth, eRelationshipStatus RelationshipStatus, string School = null, string University = null) { this.PersonGender = PersonGender; this.First = First; this.Last = Last; this.DateOfBirth = DateOfBirth; this.RelationshipStatus = RelationshipStatus; this.School = School; this.University = University; }
public int FindBaseYears(eGender vGender) { if (vGender == eGender.male) { return(85); } else { return(90); } }
// Generating the items of event by the given parameters of the users private void generateListOfEventByParameters() { try { FacebookObjectCollection <User> friendsCollections = m_CurrentLoggedInUser.Friends; foreach (User friend in friendsCollections) { FacebookObjectCollection <Event> friendfEvents = friend.Events; int currentFriendAge = calculateAgeByBirth(friend.Birthday); eGender currentFriendSex = eGender.male; // Default if (friend.Gender.HasValue) { currentFriendSex = friend.Gender.Value; testerlabel.Text = currentFriendSex.ToString(); } else { MessageBox.Show( "Please choose a sex preference first", "Sex Preference missing", MessageBoxButtons.OK, MessageBoxIcon.None); } if (isCriterionsMatchingFriend(currentFriendAge, currentFriendSex)) { foreach (Event friendEvent in friendfEvents) { Point duration = getDurationPointToMap(int.Parse(friendEvent.StartTime.Value.ToString("HH")), int.Parse(friendEvent.EndTime.Value.ToString("HH")), friendEvent.StartTime.Value.ToString("tt")); m_DurationToTimeframe.TryGetValue(duration, out eTimeFrame currentEventTimeFrame); string friendAttendence = getFriendAttendence(friend, friendEvent); testerlabel.Text = friendAttendence; if (currentEventTimeFrame.Equals(m_SelectedTimeFrame)) { FlowLayoutPanelCutomedEvents.Controls.Add(createEventCustomedItem(friendEvent, friend, currentEventTimeFrame, friendAttendence)); } } } } } catch (NullReferenceException) { throw new NullReferenceException("Error: retrieving Friends or friend's events null exception"); } catch (Exception) { throw new Exception("Unknown exception"); } }
public eLivingModel GetModel(eGender gender) { if (gender == eGender.Male) { return(MaleModel); } else if (gender == eGender.Female) { return(FemaleModel); } else { return(eLivingModel.None); } }
public List <User> FindMatches(eGender i_Gender, int i_MinAge, int i_MaxAge) { List <User> matches = new List <User>(); foreach (User friend in m_LoggedInUser.Friends) { friend.ReFetch(DynamicWrapper.eLoadOptions.Full); if (checkIfMatch(friend, i_Gender, i_MinAge, i_MaxAge)) { matches.Add(friend); } } return(matches); }
public override void LoadUniqueData(Hashtable record) { completedDungeons.Clear(); Hashtable completedDungeonsObject = EB.Dot.Object("completedDungeons", record, null); if (completedDungeonsObject != null) { foreach (var i in completedDungeonsObject.Keys) { completedDungeons.Add(System.Convert.ToInt32(i)); } } //characterClass = (eClass)EB.Dot.Integer("class", record, (int)eClass.Barbarian); gender = (eGender)EB.Dot.Integer("gender", record, (int)eGender.Male); }
public static string GetGenderString(eGender gender) { string result = ""; switch (gender) { case eGender.Female: result = "Female"; break; case eGender.Male: result = "Male"; break; } return(result); }
public async Task <Person> FillBlanks(eGender PersonGender) { switch (PersonGender) { case eGender.Male: { if (MaleFirstNames.Count == 0) { MaleFirstNames = (await ReadFile(@"=malefirstnames.txt")).ToList(); } if (MaleLastNames.Count == 0) { MaleLastNames = (await ReadFile(@"=malelastnames.txt")).ToList(); } First = MaleFirstNames[Generate.Int(MaleFirstNames.Count)]; Last = MaleLastNames[Generate.Int(MaleLastNames.Count)]; break; } case eGender.Female: { if (FemaleFirstNames.Count == 0) { FemaleFirstNames = (await ReadFile(@"=femalefirstnames.txt")).ToList(); } if (FemaleLastNames.Count == 0) { FemaleLastNames = (await ReadFile(@"=femalelastnames.txt")).ToList(); } First = FemaleFirstNames[Generate.Int(FemaleFirstNames.Count)]; Last = FemaleLastNames[Generate.Int(FemaleLastNames.Count)]; break; } } this.PersonGender = PersonGender; DateOfBirth = Generate.NewDateTime(new DateTime(1970, 1, 1), DateTime.UtcNow); RelationshipStatus = (eRelationshipStatus)Generate.Int(4); return(this); }
public void Search(bool i_EventSearch, bool i_FriendSearch, List <string> i_SearchGroups, int i_StartAge, int i_EndAge, string i_KeyPhrase, eGender i_ChosenGender) { Gender = i_ChosenGender; StartAge = i_StartAge; EndAge = i_EndAge; KeyPhrase = i_KeyPhrase; if (i_SearchGroups != null) { SearchGroups(i_SearchGroups); } if (i_FriendSearch) { SearchFriends(); } if (i_EventSearch) { SearchEvents(); } }
public string PrefabNameFromGender(eGender gender) { string genderIdentifier = gender == eGender.Male ? "M" : "F"; return(ResourcePrefabName.Replace("{Gender}", genderIdentifier)); }
private void PlayStartOrEndAnimationSound(bool isStart) { eGender gender = CharacterManager.Instance.CurrentCharacter.GeneralRecord.gender; //eClass characterClass = CharacterManager.Instance.CurrentCharacter.GeneralRecord.Class; FusionAudio.eEvent evt = FusionAudio.eEvent.None; //switch (characterClass) //{ // case eClass.Barbarian: // if (gender == eGender.Female) // { // if (isStart) // { // evt = FusionAudio.eEvent.SFX_Barbarian_Female_Dungeon_Start; // } // else // { // evt = FusionAudio.eEvent.SFX_Barbarian_Female_Dungeon_End; // } // } // else // { // if (isStart) // { // evt = FusionAudio.eEvent.SFX_Barbarian_Male_Dungeon_Start; // } // else // { // evt = FusionAudio.eEvent.SFX_Barbarian_Male_Dungeon_End; // } // } // break; // case eClass.Sorcerer: // if (gender == eGender.Female) // { // if (isStart) // { // evt = FusionAudio.eEvent.SFX_Sorcerer_Female_Dungeon_Start; // } // else // { // evt = FusionAudio.eEvent.SFX_Sorcerer_Female_Dungeon_End; // } // } // else // { // if (isStart) // { // evt = FusionAudio.eEvent.SFX_Sorcerer_Male_Dungeon_Start; // } // else // { // evt = FusionAudio.eEvent.SFX_Sorcerer_Male_Dungeon_End; // } // } // break; //} FusionAudio.PostEvent(evt, PlayerManager.LocalPlayerGameObject(), true); }
/// <summary> /// Translate Given Race/Gender Combo in Player Language /// </summary> /// <param name="player"></param> /// <param name="race"></param> /// <param name="gender"></param> /// <returns></returns> public static string RaceToTranslatedName(this GamePlayer player, int race, eGender gender) { if (player.Client != null) return player.Client.RaceToTranslatedName(race, (int)gender); return string.Format("!{0} - {1}!", ((eRace)race).ToString("F"), gender.ToString("F")); }
public async Task <Person> FillBlanks(eGender PersonGender) { switch (PersonGender) { case eGender.Male: { if (MaleFirstNames.Count == 0) { MaleFirstNames = (await ReadFile(@"=malefirstnames.txt")).ToList(); } if (MaleLastNames.Count == 0) { MaleLastNames = (await ReadFile(@"=malelastnames.txt")).ToList(); } First = MaleFirstNames[Generate.Int(MaleFirstNames.Count)]; Last = MaleLastNames[Generate.Int(MaleLastNames.Count)]; break; } case eGender.Female: { if (FemaleFirstNames.Count == 0) { FemaleFirstNames = (await ReadFile(@"=femalefirstnames.txt")).ToList(); } if (FemaleLastNames.Count == 0) { FemaleLastNames = (await ReadFile(@"=femalelastnames.txt")).ToList(); } First = FemaleFirstNames[Generate.Int(FemaleFirstNames.Count)]; Last = FemaleLastNames[Generate.Int(FemaleLastNames.Count)]; break; } } this.PersonGender = PersonGender; DateOfBirth = Generate.NewDateTime(new DateTime(1970, 1, 1), new DateTime(DateTime.UtcNow.Subtract(new DateTime(15, 1, 1)).Ticks)); RelationshipStatus = (eRelationshipStatus)Generate.Int(4); switch (Generate.Int(3)) { case 0: School = "Школа"; break; case 1: School = "Лицей"; break; case 2: School = "Гимназия"; break; } School += " №" + Generate.Int(38, 147); switch (Generate.Int(6)) { case 0: University = "НИУ ВШЭ"; break; case 1: University = "СПБГУ"; break; case 2: University = "МГУ"; break; case 3: University = "ИТМО"; break; case 4: University = "МГИМО"; break; case 5: University = "МФТИ"; break; } return(this); }
private static void addOnline(string username, eGender gender, int age) { lock (onlineUsers) { if (!onlineUsers.ContainsKey(username)) onlineUsers.Add(username, new onlineUserData() { Gender = gender, Age = age, DateEntered = DateTime.Now }); } }
public static string GetGenderString(eGender gender) { string result = ""; switch (gender) { case eGender.Female: result = "Female"; break; case eGender.Male: result = "Male"; break; } return result; }
/// <summary> /// Syncrhonises the device with the central server via HTTP /// An internet connection can be obtained from a number of sources including /// WIFI, bluetooth and cellular. /// The connection must use SSL for a secure connection of sensative information could be intercepted /// </summary> public void SynchronizeFromDevice() { // serialise the current settings string p = ""; // The username and password for server authentication. p += this.memberID + ","; p += this.Password + ","; // The options for the device p += this.option1.ToString() + ","; p += this.option2.ToString() + ","; p += this.option3.ToString() + ","; p += this.option4.ToString() + ","; // the age of the Member p += age.ToString() + ","; // gender: store 0 for female and 1 for male if (gender == eGender.Female) { p += 0 + ","; } else { p += 1 + ","; } // the seek age of the Member p += seekAge.ToString() + ","; // seek gender: store 0 for female and 1 for male if (SeekGender == eGender.Female) { p += 0 + ","; } else { p += 1 + ","; } // loop though all the matches for (int i = 0; i < Matches.Count; i++) { // only Matches not confirmed by the central server if (!((Match)Matches[i]).ConfirmedByServer) { // get the MemberID of the Match p += ((Match)Matches[i]).memberID + ","; // get the MAC address of the Match p += ((Match)Matches[i]).MACAddress.ToString(); // if this is the last loop then dont add another comma delimter if (i != (Matches.Count - 1)) { p += ","; } } } WebRequest webRequest = WebRequest.Create(serverAddress); // set the WebRequest HTTP method to POST webRequest.Method = "POST"; //Convert the profile into a byte array byte[] byteArray = Encoding.UTF8.GetBytes(p); // Set http MIME type webRequest.ContentType = "application/x-www-form-urlencoded"; // Set the WebRequest content length to the profile array length webRequest.ContentLength = byteArray.Length; // create the return stream object Stream stream; try { // get the WebRequest stream to send the byte array stream = webRequest.GetRequestStream(); // write the array to the stream stream.Write(byteArray, 0, byteArray.Length); // close the stream stream.Close(); // Create a response object WebResponse s = webRequest.GetResponse(); // return the response into the stream object stream = s.GetResponseStream(); } catch (Exception e) { System.Windows.Forms.MessageBox.Show("Server returned 500"); return; } // create a new stream reader to read the returned stream StreamReader reader = new StreamReader(stream); // read the stream and split it into a string array via the comma delimiter string[] l = reader.ReadToEnd().Split(new char[] { ',' }); // Phone settings this.option1 = Int32.Parse(l[0]); this.option2 = Int32.Parse(l[1]); this.option3 = Int32.Parse(l[2]); this.option4 = Int32.Parse(l[3]); // Filter settings age = Int32.Parse(l[4]); gender = (eGender)Int32.Parse(l[5]); seekAge = Int32.Parse(l[6]); SeekGender = (eGender)Int32.Parse(l[7]); // update all the matches objects to confirmed by server for (int i = 0; i < Matches.Count; i++) { ((Match)Matches[i]).ConfirmedByServer = true; } }
public static string[] getOnline(eGender? gender, int? minAge, int? maxAge) { lock (onlineUsers) { var result = onlineUsers.Where(u => (!gender.HasValue || u.Value.Gender == gender.Value) && (!minAge.HasValue || u.Value.Age >= minAge) && (!maxAge.HasValue || u.Value.Age <= maxAge)) .OrderByDescending(u => u.Value.DateEntered).Select(u => u.Key); return result.ToArray(); } }
private void maleRadioButton_CheckedChanged(object sender, EventArgs e) { m_Gender = eGender.male; }
public User(eGender PersonGender, string First, string Last, DateTime DateOfBitrh, eRelationshipStatus RelationshipStatus, string School = null, string University = null) : base(PersonGender, First, Last, DateOfBitrh, RelationshipStatus, School, University) { Activate(); }
public Receptionist(string first, string last, eGender gender, string password) { }
public List <User> FindMatches(eGender i_Gender, int i_MinAge, int i_MaxAge) { return(m_MatchingFormLogic.FindMatches(i_Gender, i_MinAge, i_MaxAge)); }
/// <summary> /// Syncrhonises the device with the central server via HTTP /// An internet connection can be obtained from a number of sources including /// WIFI, bluetooth and cellular. /// The connection must use SSL for a secure connection of sensative information could be intercepted /// </summary> public void SynchronizeFromDevice() { // serialise the current settings string p= ""; // The username and password for server authentication. p += this.memberID + ","; p += this.Password + ","; // The options for the device p += this.option1.ToString()+","; p += this.option2.ToString()+","; p += this.option3.ToString()+","; p += this.option4.ToString()+","; // the age of the Member p += age.ToString()+","; // gender: store 0 for female and 1 for male if(gender==eGender.Female) p += 0+","; else p += 1+","; // the seek age of the Member p += seekAge.ToString()+","; // seek gender: store 0 for female and 1 for male if(SeekGender==eGender.Female) p += 0+","; else p += 1+","; // loop though all the matches for (int i = 0; i < Matches.Count; i++) { // only Matches not confirmed by the central server if(!((Match)Matches[i]).ConfirmedByServer) { // get the MemberID of the Match p += ((Match)Matches[i]).memberID+","; // get the MAC address of the Match p += ((Match)Matches[i]).MACAddress.ToString(); // if this is the last loop then dont add another comma delimter if (i != (Matches.Count - 1)) p += ","; } } WebRequest webRequest = WebRequest.Create(serverAddress); // set the WebRequest HTTP method to POST webRequest.Method = "POST"; //Convert the profile into a byte array byte[] byteArray = Encoding.UTF8.GetBytes(p); // Set http MIME type webRequest.ContentType = "application/x-www-form-urlencoded"; // Set the WebRequest content length to the profile array length webRequest.ContentLength = byteArray.Length; // create the return stream object Stream stream; try { // get the WebRequest stream to send the byte array stream = webRequest.GetRequestStream(); // write the array to the stream stream.Write(byteArray, 0, byteArray.Length); // close the stream stream.Close(); // Create a response object WebResponse s = webRequest.GetResponse(); // return the response into the stream object stream = s.GetResponseStream(); } catch (Exception e) { System.Windows.Forms.MessageBox.Show("Server returned 500"); return; } // create a new stream reader to read the returned stream StreamReader reader = new StreamReader(stream); // read the stream and split it into a string array via the comma delimiter string[] l = reader.ReadToEnd().Split(new char[]{','}); // Phone settings this.option1 = Int32.Parse(l[0]); this.option2 = Int32.Parse(l[1]); this.option3 = Int32.Parse(l[2]); this.option4 = Int32.Parse(l[3]); // Filter settings age = Int32.Parse(l[4]); gender = (eGender)Int32.Parse(l[5]); seekAge = Int32.Parse(l[6]); SeekGender = (eGender)Int32.Parse(l[7]); // update all the matches objects to confirmed by server for (int i = 0; i < Matches.Count; i++) ((Match)Matches[i]).ConfirmedByServer = true; }
/// <summary> /// Loads user account data from DB. /// Throws NotFoundException. /// </summary> public void Load() { using (SqlConnection conn = Config.DB.Open()) { try { SqlDataReader reader = (SqlDataReader) SqlHelper.GetDB().ExecuteReader( "LoadUser", _username); if (reader.Read()) { _password = (string)reader["Password"]; _email = (string)reader["Email"]; _username = (string)reader["Username"]; _name = (string)reader["Name"]; _gender = (eGender)reader["Gender"]; if (!(reader["InterestedIn"] is Int32) || ((int)reader["InterestedIn"] == 0) ) { switch (_gender) { case eGender.Male: interestedIn = eGender.Female; break; case eGender.Female: interestedIn = eGender.Male; break; case eGender.Couple: interestedIn = eGender.Couple; break; } } else { interestedIn = (eGender)reader["InterestedIn"]; } birthdate = (DateTime)reader["Birthdate"]; if (reader["Birthdate2"] is DateTime) { birthdate2 = (DateTime)reader["Birthdate2"]; } active = (bool)reader["Active"]; userSince = (DateTime)reader["UserSince"]; prevLogin = (DateTime)reader["PrevLogin"]; lastLogin = (DateTime)reader["LastLogin"]; loginCount = (int)reader["LoginCount"]; lastOnline = (DateTime)reader["LastOnline"]; profileViews = (int)reader["ProfileViews"]; receiveEmails = (bool)reader["ReceiveEmails"]; profileVisible = (bool)reader["ProfileVisible"]; country = (string)reader["Country"]; state = (string)reader["State"]; ZipCode = (string)reader["ZipCode"]; city = (string)reader["City"]; deleted = (bool)reader["Deleted"]; paid = (bool)reader["Paid"]; lastSessionID = (string)reader["LastSessionID"]; if (reader["SignupIP"] != DBNull.Value) signupIp = (string)reader["SignupIP"]; smsConfirmed = (bool)reader["SmsConfirmed"]; messageVerificationsLeft = (int)reader["MessageVerificationsLeft"]; languageId = (int)reader["LanguageId"]; if (reader["BillingDetails"] is string) billingDetails = (string)reader["BillingDetails"]; if (reader["InvitedBy"] is string) invitedBy = (string)reader["InvitedBy"]; if (reader["InvitedByCount"] is Int32) invitedByCount = (int)reader["InvitedByCount"]; incomingMessagesRestrictions = reader["IncomingMessagesRestrictions"] as string; if (reader["DeleteReason"] is string) deleteReason = (string)reader["DeleteReason"]; affiliateID = reader["AffiliateID"] != DBNull.Value ? (int?)reader["AffiliateID"] : null; options = Convert.ToUInt64(reader["Options"]); if (reader["Longitude"] is double) longitude = (double)reader["Longitude"]; if (reader["Latitude"] is double) latitude = (double)reader["Latitude"]; score = (int)reader["Score"]; tokenUniqueId = reader["TokenUniqueId"] as string; personalizationInfo = reader["PersonalizationInfo"] as string; credits = (int)reader["Credits"]; moderationScores = (int)reader["ModerationScores"]; SpamSuspected = (bool)reader["SpamSuspected"]; faceControlApproved = (bool)reader["FaceControlApproved"]; ProfileSkin = reader["ProfileSkin"] as string; statusText = reader["StatusText"] != DBNull.Value ? (string)reader["StatusText"] : null; isFeaturedMember = (bool)reader["FeaturedMember"]; mySpaceID = reader["MySpaceID"] as string; facebookID = reader["FacebookID"] as long?; eventsSettings = reader["EventsSettings"] == DBNull.Value ? 2097151 // all events are switched on : (ulong?)Convert.ToInt64(reader["EventsSettings"]); } else { throw new NotFoundException (Lang.Trans("The specified account does not exist!")); } } catch (NotFoundException) { throw new NotFoundException (Lang.Trans("The specified account does not exist!")); } } }
private bool isCriterionsMatchingFriend(int i_CurrentFriendAge, eGender i_CurrentFriendSex) { return(i_CurrentFriendAge >= m_AgeRange.X && i_CurrentFriendAge <= m_AgeRange.Y && i_CurrentFriendSex.Equals(m_SelectedSexPreference)); }
/// <summary> /// Gets the non face control approved user. /// If there is no non face control approved user it returns NULL. /// </summary> /// <param name="approvedBy">The approved by.</param> /// <param name="gender">The gender.</param> /// <param name="minPhotosRequired">The min photos required.</param> /// <returns></returns> public static User GetNonFaceControlApprovedUser(string approvedBy, eGender? gender, int minPhotosRequired) { using (SqlConnection conn = Config.DB.Open()) { SqlDataReader reader = (SqlDataReader) SqlHelper.GetDB().ExecuteReader( "FetchNonFaceControlApprovedUser", approvedBy, gender, minPhotosRequired); User user = new User(); if (reader.Read()) { user._password = (string)reader["Password"]; user._email = (string)reader["Email"]; user._username = (string)reader["Username"]; user._name = (string)reader["Name"]; user._gender = (eGender)reader["Gender"]; if (!(reader["InterestedIn"] is Int32) || ((int)reader["InterestedIn"] == 0) ) { switch (user._gender) { case eGender.Male: user.interestedIn = eGender.Female; break; case eGender.Female: user.interestedIn = eGender.Male; break; case eGender.Couple: user.interestedIn = eGender.Couple; break; } } else { user.interestedIn = (eGender)reader["InterestedIn"]; } user.birthdate = (DateTime)reader["Birthdate"]; if (reader["Birthdate2"] is DateTime) { user.birthdate2 = (DateTime)reader["Birthdate2"]; } user.active = (bool)reader["Active"]; user.userSince = (DateTime)reader["UserSince"]; user.prevLogin = (DateTime)reader["PrevLogin"]; user.lastLogin = (DateTime)reader["LastLogin"]; user.loginCount = (int)reader["LoginCount"]; user.lastOnline = (DateTime)reader["LastOnline"]; user.profileViews = (int)reader["ProfileViews"]; user.receiveEmails = (bool)reader["ReceiveEmails"]; user.profileVisible = (bool)reader["ProfileVisible"]; user.country = (string)reader["Country"]; user.state = (string)reader["State"]; user.ZipCode = (string)reader["ZipCode"]; user.city = (string)reader["City"]; user.deleted = (bool)reader["Deleted"]; user.paid = (bool)reader["Paid"]; user.lastSessionID = (string)reader["LastSessionID"]; if (reader["SignupIP"] != DBNull.Value) user.signupIp = (string)reader["SignupIP"]; user.smsConfirmed = (bool)reader["SmsConfirmed"]; user.messageVerificationsLeft = (int)reader["MessageVerificationsLeft"]; user.languageId = (int)reader["LanguageId"]; if (reader["BillingDetails"] is string) user.billingDetails = (string)reader["BillingDetails"]; if (reader["InvitedBy"] is string) user.invitedBy = (string)reader["InvitedBy"]; user.incomingMessagesRestrictions = reader["IncomingMessagesRestrictions"] as string; if (reader["DeleteReason"] is string) user.deleteReason = (string)reader["DeleteReason"]; user.affiliateID = reader["AffiliateID"] != DBNull.Value ? (int?)reader["AffiliateID"] : null; user.options = Convert.ToUInt64(reader["Options"]); if (reader["Longitude"] is double) user.longitude = (double)reader["Longitude"]; if (reader["Latitude"] is double) user.latitude = (double)reader["Latitude"]; user.score = (int)reader["Score"]; user.tokenUniqueId = reader["TokenUniqueId"] as string; user.personalizationInfo = reader["PersonalizationInfo"] as string; user.credits = (int)reader["Credits"]; user.moderationScores = (int)reader["ModerationScores"]; user.SpamSuspected = (bool)reader["SpamSuspected"]; user.faceControlApproved = (bool)reader["FaceControlApproved"]; user.mySpaceID = reader["MySpaceID"] as string; user.facebookID = reader["FacebookID"] as long?; user.InvitedByCount = (int)reader["InvitedByCount"]; return user; } else { return null; } } }
public PracticeManager(string first, string last, eGender gender, string password) { }
/// <summary> /// Gets the random photo id. /// </summary> /// <param name="username">The username.</param> /// <param name="gender">The gender.</param> /// <param name="minAge">The min age.</param> /// <param name="maxAge">The max age.</param> /// <returns></returns> public static int GetRandomPhotoId(string username, eGender? gender, int? minAge, int? maxAge) { using (SqlConnection conn = Config.DB.Open()) { return Convert.ToInt32(SqlHelper.GetDB().ExecuteScalar( "GetRandomPhotoId", username, gender, maxAge == null ? null : (object)DateTime.Now.Subtract(TimeSpan.FromDays((maxAge.Value + 1) * 365.25)), minAge == null ? null : (object)DateTime.Now.Subtract(TimeSpan.FromDays(minAge.Value * 365.25)), Config.Ratings.RatePhotosForUsersActiveWithinXXDays)); } }
public Doctor(string first, string last, eGender gender, string password) { }
private static void addOnline(string username, eGender gender, int age) { lock (onlineUsers) { if (!onlineUsers.ContainsKey(username)) onlineUsers.Add(username, new onlineUserData() { Gender = gender, Age = age, DateEntered = DateTime.Now }); } if (HttpContext.Current == null) return; Random r = new Random((int)(DateTime.Now.Ticks % int.MaxValue)); lock (HttpContext.Current.Application) { //((IList<int>)HttpContext.Current.Application["UsersOnline"]).Add(r.Next(5, 15)); Global.AppUsersOnline.Add(r.Next(5, 15)); } }
/// <summary> /// Verify whether created character is valid /// </summary> /// <param name="ch">The character to check</param> /// <returns>True if valid</returns> public static bool IsCharacterValid(DOLCharacters ch) { bool valid = true; try { if ((eRealm)ch.Realm < eRealm._FirstPlayerRealm || (eRealm)ch.Realm > eRealm._LastPlayerRealm) { if (log.IsWarnEnabled) { log.WarnFormat("Wrong realm: {0} on character creation from Account: {1}", ch.Realm, ch.AccountName); } valid = false; } if (ch.Level != 1) { if (log.IsWarnEnabled) { log.WarnFormat("Wrong level: {0} on character creation from Account: {1}", ch.Level, ch.AccountName); } valid = false; } if (!GlobalConstants.STARTING_CLASSES_DICT.ContainsKey((eRealm)ch.Realm) || !GlobalConstants.STARTING_CLASSES_DICT[(eRealm)ch.Realm].Contains((eCharacterClass)ch.Class)) { if (log.IsWarnEnabled) { log.WarnFormat("Wrong class: {0}, realm:{1} on character creation from Account: {2}", ch.Class, ch.Realm, ch.AccountName); } valid = false; } if (!GlobalConstants.RACES_CLASSES_DICT.ContainsKey((eRace)ch.Race) || !GlobalConstants.RACES_CLASSES_DICT[(eRace)ch.Race].Contains((eCharacterClass)ch.Class)) { if (log.IsWarnEnabled) { log.WarnFormat("Wrong race: {0}, class:{1} on character creation from Account: {2}", ch.Race, ch.Class, ch.AccountName); } valid = false; } int pointsUsed; var stats = new Dictionary <eStat, int> { { eStat.STR, ch.Strength }, { eStat.CON, ch.Constitution }, { eStat.DEX, ch.Dexterity }, { eStat.QUI, ch.Quickness }, { eStat.INT, ch.Intelligence }, { eStat.PIE, ch.Piety }, { eStat.EMP, ch.Empathy }, { eStat.CHR, ch.Charisma }, }; valid &= IsCustomPointsDistributionValid(ch, stats, out pointsUsed); if (pointsUsed != MAX_STARTING_BONUS_POINTS) { if (log.IsWarnEnabled) { log.WarnFormat("Points used: {0} on character creation from Account: {1}", pointsUsed, ch.AccountName); } valid = false; } eGender gender = ch.Gender == 0 ? eGender.Male : eGender.Female; if (GlobalConstants.RACE_GENDER_CONSTRAINTS_DICT.ContainsKey((eRace)ch.Race) && GlobalConstants.RACE_GENDER_CONSTRAINTS_DICT[(eRace)ch.Race] != gender) { if (log.IsWarnEnabled) { log.WarnFormat("Wrong Race gender: {0}, race: {1} on character creation from Account: {2}", ch.Gender, ch.Race, ch.AccountName); } valid = false; } if (GlobalConstants.CLASS_GENDER_CONSTRAINTS_DICT.ContainsKey((eCharacterClass)ch.Class) && GlobalConstants.CLASS_GENDER_CONSTRAINTS_DICT[(eCharacterClass)ch.Class] != gender) { if (log.IsWarnEnabled) { log.WarnFormat("Wrong class gender: {0}, class:{1} on character creation from Account: {2}", ch.Gender, ch.Class, ch.AccountName); } valid = false; } } catch (Exception e) { if (log.IsErrorEnabled) { log.ErrorFormat("CharacterCreation error on account {0}, slot {1}. Exception:{2}", ch.AccountName, ch.AccountSlot, e); } valid = false; } return(valid); }
private void femaleChecked(object sender, EventArgs e) { m_Gender = eGender.female; }