public IHttpActionResult PutGENDER(int id, GENDER gENDER) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != gENDER.GENDER_ID) { return(BadRequest()); } db.Entry(gENDER).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!GENDERExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public Rabbit(EYES eyes, FUR fur, GENDER gender, DateTime birthDate) { this.Eyes = eyes; this.Fur = fur; this.Gender = gender; this.BirthDate = birthDate; }
Employee(string name, int age, GENDER gender) { this.name = name; this.age = age; this.gender = gender; this.id = idCounter++; }
public Human(GENDER gender = GENDER.MALE, AGE age = AGE.BABY, GIRTH girth = GIRTH.SKINNY, CRIME crime = CRIME.NONE) { this.gender = gender; this.age = age; this.girth = girth; this.crime = crime; }
public void HaveBaby() { int chance = Random.Range(1, 100); if (Partner.Alive && (Age >= AgeOfConsent) && (Partner.Age >= AgeOfConsent) && (Fertility >= chance) && (Birthrate >= chance) && (Age <= 45) && (Partner.Age <= 55)) { GENDER gender = (GENDER)Random.Range(0, 1); Human baby = new Human(GetName(gender), gender, 1, 1, this, Partner) { Charisma = (byte)Random.Range(Charisma, Partner.Charisma), Fertility = (byte)Random.Range(Fertility, Partner.Fertility), Mother = this, Father = Partner }; baby.home = home; home.addHuman(baby); Manager.human_mng.addPeople.Add(baby); // TODO: Notify CommonFunctions.DisplayMessage(baby.Name + " was just born!\n" + Name + " and " + Partner.Name + " are their parents.", 2); Happiness = 100; Partner.Happiness = 100; } }
public StudentCreateDTO(string firstName, string lastName, string username, string password, string repeatedPassword, DateTime dateOfBirth, int yearOfEnrollement, GENDER gender) : base(firstName, lastName, username, password, repeatedPassword) { DateOfBirth = dateOfBirth; YearOfEnrollement = yearOfEnrollement; Gender = gender; }
public IHttpActionResult PostGENDER(GENDER gENDER) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.GENDERs.Add(gENDER); try { db.SaveChanges(); } catch (DbUpdateException) { if (GENDERExists(gENDER.GENDER_ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = gENDER.GENDER_ID }, gENDER)); }
public Official(string name, int yearOfBirth, GENDER gender, string address) { this.name = name; YearOfBirth = yearOfBirth; this.gender = gender; this.address = address; }
public Student(int id, string firstName, string lastName, string username, string password, DateTime dateOfBirth, int yearOfEnrollement, GENDER gender) : base(id, firstName, lastName, username, password) { DateOfBirth = dateOfBirth; YearOfEnrollement = yearOfEnrollement; Gender = gender; }
public ActionResult DeleteConfirmed(int id) { GENDER gENDER = db.GENDERs.Find(id); db.GENDERs.Remove(gENDER); db.SaveChanges(); return(RedirectToAction("Index")); }
// 2) Parametrized constructor public Employee(string name, int age, GENDER gender) { this.name = name; this.age = age; this.gender = gender; }
public Contact(string first, string last, string email, string number, GENDER gender) { Name = first; Surname = last; Email = email; Phone = number; Gender = gender; }
public void setArch(GENDER sex, AGECATEGORY age) { this.age = age; this.lookingforSex = sex; id = -1; username = ""; client = null; }
/// <summary> /// for archtype uses ONLY! /// </summary> /// <param name="archuser"></param> public MatchUser(MatchUser archuser) { this.age = archuser.age; this.lookingforSex = archuser.lookingforSex; id = -1; username = ""; client = null; }
public void TrimFields() { ID = ID.Trim(); NAME = NAME.Trim(); CELLPHONENUMBER = CELLPHONENUMBER.Trim(); GENDER = GENDER.Trim(); PASSWORD = PASSWORD.Trim(); DORMITORYBUILDINGS = DORMITORYBUILDINGS.Trim(); }
public CharacterData(string name = "", GENDER gender = GENDER.FEMALE) { this.username = name; this.gender = gender; attributes = new Attributes(); stats = new Stats(); equipment = new Equipment(); inventory = new Inventory(); id = 0; }
public ActionResult Edit([Bind(Include = "ID,GENDER1")] GENDER gENDER) { if (ModelState.IsValid) { db.Entry(gENDER).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gENDER)); }
public Patient(string Name, string doc, DateTime BirthDate, GENDER Gender, EDU_LEVEL EduLevel) { name = Name; doctor = doc; birthDate = BirthDate; gender = Gender; eduLevel = EduLevel; notes = new List<PatientNote>(); testFilenames = new List<string>(); }
public static string Gender(GENDER gender) { if (gender == GENDER.MALE) { return("MALE"); } else { return("FEMALE"); } }
public ActionResult Create([Bind(Include = "ID,GENDER1")] GENDER gENDER) { if (ModelState.IsValid) { db.GENDERs.Add(gENDER); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gENDER)); }
public IHttpActionResult GetGENDER(int id) { GENDER gENDER = db.GENDERs.Find(id); if (gENDER == null) { return(NotFound()); } return(Ok(gENDER)); }
public Human CreateHuman(GENDER gender = GENDER.MALE, AGE age = AGE.BABY, GIRTH girth = GIRTH.SKINNY, CRIME crime = CRIME.NONE) { if (recycledHumans.Count == 0) { return(new Human(gender, age, girth, crime)); } else { return(recycledHumans.Pop()); } }
public void TrimFields() { ID = ID.Trim(); NAME = NAME.Trim(); CELLPHONENUMBER = CELLPHONENUMBER.Trim(); GENDER = GENDER.Trim(); PASSWORD = PASSWORD.Trim(); CLASSNUMBER = CLASSNUMBER.Trim(); DORMITORYADDRESS = DORMITORYADDRESS.Trim(); DIRECTORNAME = DIRECTORNAME.Trim(); DIRECTORCELLPHONENUMBER = DIRECTORCELLPHONENUMBER.Trim(); }
internal Royalty CreateSpouse(Royalty otherSpouse) { GENDER gender = GENDER.FEMALE; if (otherSpouse.gender == GENDER.FEMALE) { gender = GENDER.MALE; } Royalty spouse = new Royalty(otherSpouse.kingdom, UnityEngine.Random.Range(16, (otherSpouse.age + 1)), gender, otherSpouse.generation); Marry(otherSpouse, spouse); return(spouse); }
public static void AddSVCNTTDB(string hoten, DateTime ngaysinh, GENDER gioitinh) { var db = new QLSVContext(); var cre = db.SinhVienS.Create(); cre.ID = Guid.NewGuid().ToString(); cre.FullName = hoten; cre.DateOfBirth = ngaysinh; cre.Gender = gioitinh; cre.IDKHOA = "C"; db.SinhVienS.Add(cre); db.SaveChanges(); }
public IHttpActionResult DeleteGENDER(int id) { GENDER gENDER = db.GENDERs.Find(id); if (gENDER == null) { return(NotFound()); } db.GENDERs.Remove(gENDER); db.SaveChanges(); return(Ok(gENDER)); }
// GET: Gender/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GENDER gENDER = db.GENDERs.Find(id); if (gENDER == null) { return(HttpNotFound()); } return(View(gENDER)); }
public ActionResult AddOrEdit(GENDER gen) { if (gen.GENDER_ID == 0) { HttpResponseMessage response = GlobalVariables.WebApiClient.PostAsJsonAsync("GENDERs", gen).Result; TempData["SuccessMessage"] = "Saved Successfully"; } else { HttpResponseMessage response = GlobalVariables.WebApiClient.PutAsJsonAsync("GENDERs/" + gen.GENDER_ID, gen).Result; TempData["SuccessMessage"] = "Updated Successfully"; } return(RedirectToAction("Index")); }
private bool connectToPrivateChatQueue(GENDER LookingForSex) { bool success = false; try { NetworkStream stream = client.GetStream(); string msg = curUser.Username + "|" + (int)curUser.AgeCategory + "|" + (int)curUser.Gender + "|" + (int)LookingForSex; Trace.WriteLine(msg); if (!curUser.HasOngoingChatSearch) { client.GetStream().Close(); client.Close(); return(false); } byte[] data = Encoding.Unicode.GetBytes("KNOCKNOCK|" + msg); stream.Write(data, 0, data.Length); Thread.Sleep(10); string responseData = Utility.ReadFromNetworkStream(stream); Trace.WriteLine("\n" + responseData + "\nReceived from matchserver: " + responseData + "\n"); success = (responseData == "OK"); if (responseData.Substring(0, 2) == "ER") { string[] errargs = responseData.Split("|"); if (errargs[1] == "INQUEUE") { Trace.WriteLine("Already in queue!"); EventArgs er = new EventArgs(); OnInQueue(er); } } } catch (Exception e) { Trace.WriteLine("Error during privatechat connection: " + e.Message); } return(success); }
public void addUser()//user registers { try { GENDER userGender = Female;// if the user is female then Female property =MALE ,and Male property= MALE, else: Female property =FEMALE ,and Male property= FEMALE registerModel.addUser(EmailAddress, MyPasswordProperty, userGender, BirthDate, (FAMILYSTATUS)Enum.Parse(typeof(FAMILYSTATUS), FamilyStatusString), int.Parse(HeightString), float.Parse(CurrentWeightString), DateTime.Now, float.Parse(GoalWeightString)); ToolTipTextProperty = "You have successfully registered"; ToolTipIsOpenRegisterProperty = true; startTimerPopUpToolTip(2.2, true); } catch (Exception e) { ToolTipTextProperty = e.Message; ToolTipIsOpenRegisterProperty = true; startTimerPopUpToolTip(2.2, false); } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (!(value is GENDER)) { return(null); } GENDER gender = (GENDER)value; switch (gender) { case GENDER.Male: return("/Resources/man.png"); case GENDER.Female: return("/Resources/woman.jpg"); } return(null); }
public void LoadAvatar() { if (!PlayerPrefs.HasKey("currentRole")) return; int roleInt = PlayerPrefs.GetInt("currentRole"); currentRole = (ROLE)roleInt; int genderInt = PlayerPrefs.GetInt("currentGender"); currentGender = (GENDER)genderInt; UpdateRaceList(); raceIndex = PlayerPrefs.GetInt("raceIndex"); currentRace = currentRaceList[raceIndex]; avatarindex = PlayerPrefs.GetInt("avatarindex"); UpdateModel(); }
public void ToggleGender() { if (currentGender == GENDER.Male) currentGender = GENDER.Female; else currentGender = GENDER.Male; UpdateRaceList(); }
public void AddStudent(int id, string name, GENDER gender) { try { var query = from Student student in Students where student.ID == id select student; //Decided to use LINQ for searching the array list if (query.Count() > 0) { throw new StudentIDExistsException(); } else { Students.Add(new Student(id, name, gender)); } } catch (StudentIDExistsException e) { Console.WriteLine(e.Message); } }
public override void OnInspectorGUI() { #region Show Identity showIdentity = EditorGUILayout.Foldout (showIdentity, "Identity"); if (showIdentity) { EditorGUILayout.PropertyField (characterName); EditorGUILayout.PropertyField (characterAge); gender = (GENDER)EditorGUILayout.EnumPopup ("Gender", gender); } #endregion #region Show Needs showNeeds = EditorGUILayout.Foldout (showNeeds, "Needs"); if (showNeeds) { EditorGUILayout.PropertyField (friendship); EditorGUILayout.PropertyField (enmity); EditorGUILayout.PropertyField (competition); EditorGUILayout.PropertyField (lust); EditorGUILayout.PropertyField (greed); EditorGUILayout.PropertyField (mentorship); } #endregion #region Show Affect showAffect = EditorGUILayout.Foldout (showAffect, "Affects"); if (showAffect) { EditorGUILayout.PropertyField (boredomToInterest); EditorGUILayout.PropertyField (sadToJoy); EditorGUILayout.PropertyField (supriseToCalm); EditorGUILayout.PropertyField (distressToAmused); EditorGUILayout.PropertyField (shameToPride); EditorGUILayout.PropertyField (fearToHope); } #endregion #region Show Affect Multiplier showMultiplier = EditorGUILayout.Foldout (showMultiplier, "Affect Multipliers"); if (showMultiplier) { EditorGUILayout.PropertyField (boredom); EditorGUILayout.PropertyField (interest); EditorGUILayout.PropertyField (sadness); EditorGUILayout.PropertyField (enjoyment); EditorGUILayout.PropertyField (surprise); EditorGUILayout.PropertyField (calm); EditorGUILayout.PropertyField (distress); EditorGUILayout.PropertyField (amusement); EditorGUILayout.PropertyField (anger); EditorGUILayout.PropertyField (cheer); EditorGUILayout.PropertyField (disgust); EditorGUILayout.PropertyField (love); EditorGUILayout.PropertyField (shame); EditorGUILayout.PropertyField (pride); EditorGUILayout.PropertyField (fear); EditorGUILayout.PropertyField (hope); } #endregion #region Character Traits showTraits = EditorGUILayout.Foldout (showTraits, "Character Traits"); if (showTraits) { } #endregion }
public Student(int id, string name, GENDER gender) { this.ID = id; this.Name = name; this.Gender = gender; }