public Referee(string firstName, string middleName, string lastName, string dateOfBirth, sex gender, string nationality, string licenseAquired, string licenseRenewed) : base(firstName, middleName, lastName, dateOfBirth, nationality, gender) { LicenseAquired = DateTime.ParseExact(licenseAquired, "yyyy-MM-dd", null); LicenseRenewed = DateTime.ParseExact(licenseRenewed, "yyyy-MM-dd", null); }
public Animal(string name, int age, sex gendre) : this() { this.name = name; this.age = age; this.gendre = gendre; }
public person(string name, int id, int age, sex gender) { this.name = name; this.age = age; this.id = id; this.gender = gender; }
internal static string role(sex sex) { string role = ""; switch (sex) { //case classes.role.CHIL: // role = "CHIL"; // break; case classes.sex.MALE: role = "HUSB"; break; case sex.FEMALE: role = "WIFE"; break; default: // should NOT arrive here role = "UNKN"; break; } return(role); }
public Tomcat(string name, int age, sex gendre) : base(name, age, gendre) { if (gendre == sex.female) { throw new InvalidOperationException("Tomcats are only males"); } }
public ActionResult DeleteConfirmed(int id) { sex sex = db.sexs.Find(id); db.sexs.Remove(sex); db.SaveChanges(); return(RedirectToAction("Index")); }
public Character(Vector2 position) : base(position, 64, 64) { apperanceKeys = new String[Enum.GetValues(typeof(slot)).Length]; appearanceSprites = new Sprite[apperanceKeys.Length]; ChangeState(state.stop, direction.down); characterSex = sex.male; }
public Kitten(string name, int age, sex gendre) : base(name, age, gendre) { if (gendre == sex.male) { throw new InvalidOperationException("Kittens are only females"); } }
public Passenger(string firstName, string lastName, string nationality, string passport, DateTime birthday, sex sex, double price, Ticket.TicketClass ticketClass) { FirstName = firstName; LastName = lastName; Nationality = nationality; Passport = passport; Birthday = birthday; Sex = sex; Ticket = new Ticket(price, ticketClass); }
public ActionResult Edit([Bind(Include = "id_sex,name")] sex sex) { if (ModelState.IsValid) { db.Entry(sex).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sex)); }
public ActionResult Create([Bind(Include = "id_sex,name")] sex sex) { if (ModelState.IsValid) { db.sexs.Add(sex); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sex)); }
public Person(string firstName, string middleName, string lastName, string birthDate, string nationality, sex gender) { FirstName = firstName; MiddleName = middleName; LastName = lastName; DateOfBirth = DateTime.ParseExact(birthDate, "yyyy-MM-dd", null); Age = calcAge(); Nationality = nationality; Gender = gender; }
// GET: sexes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } sex sex = db.sexs.Find(id); if (sex == null) { return(HttpNotFound()); } return(View(sex)); }
private static string getSex(sex value) { if (value == sex.male) { return("1"); } else if (value == sex.female) { return("2"); } else { throw new ServiceException("unknown sex value"); } }
public static string getFirstname(sex sex) { string firstname; switch (sex) { case sex.male: firstname = getMasculineName(); break; case sex.female: firstname = getFemineName(); break; default: firstname = getMasculineName(); break; } return(firstname); }
private Gamemaster SetGamemaster() { // pick a random referee and set to game master Referee referee = RefereesInTournament[rnd.Next(1, RefereesInTournament.Count)]; // Map the properties string firstName = referee.FirstName; string middleName = referee.MiddleName; string lastName = referee.LastName; string dateOfBirth = referee.DateOfBirth.ToString("yyyy-MM-dd"); sex gender = referee.Gender; string nationality = referee.Nationality; string licenseAquired = referee.LicenseAquired.ToString("yyyy-MM-dd"); string licenseRenewed = referee.LicenseRenewed.ToString("yyyy-MM-dd"); // return game master Gamemaster gamemaster = new Gamemaster(firstName, middleName, lastName, dateOfBirth, gender, nationality, licenseAquired, licenseRenewed); return(gamemaster); }
public static string sex(sex sex) { string gedcom = ""; switch (sex) { case sex.FEMALE: gedcom = "F"; break; case sex.MALE: gedcom = "M"; break; default: gedcom = "O"; break; } return(gedcom); }
public void LoadPlayers(sex gender, int playerCount) { int playersAdded = 0; TextFieldParser par = new TextFieldParser(FilePath); par.TextFieldType = FieldType.Delimited; par.SetDelimiters(Delimiter); while (!par.EndOfData && playersAdded < playerCount) { string[] fields = par.ReadFields(); string firstName = fields[1]; string middleName = fields[2]; string lastName = fields[3]; string birthdate = fields[4]; string nationality = fields[5]; // create player object var player = new TennisPlayer(firstName, middleName, lastName, birthdate, nationality, gender); Players.Add(player); playersAdded++; } par.Close(); }
//private role role; public individual(string name = "") { // look up based on id this.id = string.Format("I{0}", universe.id()); this.name = name; this.name2 = ""; // alias this.sex = sex.UNKNOWN; this.BIRTH = new date(datetype.DEAT, "", ""); this.DEATH = new date(datetype.BIRT, "", ""); this.events = new List <@event>(); this.notes = new List <note>(); this.photos = new List <photo>(); // relatives this.father = null; this.mother = null; this.spouses = new List <individual>(); this.children = new List <individual>(); }
public void LoadReferees(sex gender) { TextFieldParser par = new TextFieldParser(FilePath); par.TextFieldType = FieldType.Delimited; par.SetDelimiters(Delimiter); while (!par.EndOfData) { string[] fields = par.ReadFields(); string firstName = fields[1]; string middleName = fields[2]; string lastName = fields[3]; string birthdate = fields[4]; string nationality = fields[5]; string licenseAquired = fields[7]; string licenseRenewed = fields[8]; var referee = new Referee(firstName, middleName, lastName, birthdate, gender, nationality, licenseAquired, licenseRenewed); Referees.Add(referee); } par.Close(); }
public Sex(sex s) { _sex = s; }
public void AddTosexes(sex sex) { base.AddObject("sexes", sex); }
public static sex Createsex(int ID) { sex sex = new sex(); sex.id = ID; return sex; }
public Frog(string name, int age, sex sex) : base(name, age, sex) { }
public Frog(int age, string name, sex _sex) : base(age, name, _sex) { }
public Cat(int age, string name, sex _sex) : base(age, name, _sex) { }
public Animal(string name, int age, sex sex) { this.Name = name; this.Age = age; this.Sex = sex; }
public Dog(string name, int age, sex gendre) : base(name, age, gendre) { }
public person(int id, string name, sex g) { this.id = id; this.name = name; this.gender = g; }
public void female() { this.sex = sex.FEMALE; //this.role = role.WIFE; }
public HumanBody(sex sex) { _Sex = sex; }
static void Main(string[] args) { //int sum = 0; //for (int i = 1; i <= 100; i++) { // sum += i; // if (sum >= 20) { // Console.WriteLine(i); // break; // } //} //Console.ReadKey(); //String username = ""; //String password = ""; //while (username != "admin" || password != "8888") { // Console.WriteLine("请输入用户名:"); // username = Console.ReadLine(); // Console.WriteLine("请输入密码:"); // password = Console.ReadLine(); // if (username.Equals("admin") && password.Equals("8888")) // { // Console.WriteLine("登录成功"); // } // else { // Console.WriteLine("请重新登录"); // } //} //Console.ReadKey(); //求1-100之间的质数 //for (int i = 2; i <=100; i++)//6 7 8 //{ // bool b = true; // for (int j =2; j < i; j++) // { // if (i % j == 0) { // b = false; // break; // } // } // if (b == true) { // Console.WriteLine(i); // } //} //Console.ReadKey(); //产生随机数 //Random r = new Random(); //while (true) { // int rnumber = r.Next(1,11); // Console.WriteLine(rnumber); // Console.ReadKey(); //} String s = "0"; sex s1 = (sex)Enum.Parse(typeof(sex), s); Console.WriteLine(s1); Console.ReadKey(); }
public Cat(string name, int age, sex sex) : base(name, age, sex) { }
public Cat(int age, string name, sex gender) : base(age, name, gender) { }
public Animal(int age, string name, sex gender) { this.Age = age; this.Name = name; this.Gender = gender; }
public void male() { this.sex = sex.MALE; //this.role = role.HUSB; }
public Animal(int age, string name, sex _sex) : this(age, name) { this.Sex = _sex; }
public void relate(kinship relationship, individual person) { if (person.belongsToFamily == null) { person.belongsToFamily = new family(); } if (person != null) { // if (person.sex == sex.MALE) // { // person.role = role.HUSB; // } // else // { // person.role = role.WIFE; // } // sex correction by known relationships switch (relationship) { case kinship.SELF: this.id = person._id(); this.name = person._name(); this.sex = person._sex(); // this.role = role.SELF; // @todo Copy these records too // @todo Multiple calls should not be available // @todo Must be called and once only break; case kinship.FATHER: person.male(); // @todo add spouse //person.role = role.HUSB; this.father = person; // @if mother available, marry this.father.marry(this.mother); break; case kinship.MOTHER: //person.role = role.WIFE; person.female(); // @todo add spouse this.mother = person; // @if father available, marry this.mother.marry(this.father); break; case kinship.SPOUSE: // @todo sex flip // or often allow same sex spousing if there is an adoptation // what if they do not have a child? if (this.belongsToFamily == null) { this.belongsToFamily = new family(); } if (person.sex == sex.FEMALE) { person.sex = sex.MALE; //person.role = role.HUSB; } else { person.sex = sex.FEMALE; //person.role = role.WIFE; } this.spouses.Add(person); break; case kinship.CHILD: //person.role = role.CHIL; this.children.Add(person); break; } } }
public TennisPlayer(string firstName, string middleName, string lastName, string birthDate, string nationality, sex gender) : base(firstName, middleName, lastName, birthDate, nationality, gender) { }