Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 public Animal(string name, int age, sex gendre)
     : this()
 {
     this.name = name;
     this.age = age;
     this.gendre = gendre;
 }
Ejemplo n.º 3
0
 public person(string name, int id, int age, sex gender)
 {
     this.name   = name;
     this.age    = age;
     this.id     = id;
     this.gender = gender;
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public Tomcat(string name, int age, sex gendre)
     : base(name, age, gendre)
 {
     if (gendre == sex.female)
     {
         throw new InvalidOperationException("Tomcats are only males");
     }
 }
Ejemplo n.º 6
0
        public ActionResult DeleteConfirmed(int id)
        {
            sex sex = db.sexs.Find(id);

            db.sexs.Remove(sex);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 7
0
        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;
        }
Ejemplo n.º 8
0
        public Kitten(string name, int age, sex gendre)
            : base(name, age, gendre)
        {
            if (gendre == sex.male)
            {
                throw new InvalidOperationException("Kittens are only females");

            }
        }
Ejemplo n.º 9
0
 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);
 }
Ejemplo n.º 10
0
 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));
 }
Ejemplo n.º 11
0
        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));
        }
Ejemplo n.º 12
0
 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;
 }
Ejemplo n.º 13
0
        // 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));
        }
Ejemplo n.º 14
0
 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");
     }
 }
Ejemplo n.º 15
0
    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);
    }
Ejemplo n.º 16
0
        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);
        }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
        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();
        }
Ejemplo n.º 19
0
        //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>();
        }
Ejemplo n.º 20
0
        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();
        }
Ejemplo n.º 21
0
 public Sex(sex s)
 {
     _sex = s;
 }
Ejemplo n.º 22
0
 public void AddTosexes(sex sex)
 {
     base.AddObject("sexes", sex);
 }
Ejemplo n.º 23
0
 public static sex Createsex(int ID)
 {
     sex sex = new sex();
     sex.id = ID;
     return sex;
 }
Ejemplo n.º 24
0
 public Frog(string name, int age, sex sex)
     : base(name, age, sex)
 {
 }
Ejemplo n.º 25
0
 public Frog(int age, string name, sex _sex) : base(age, name, _sex)
 {
 }
Ejemplo n.º 26
0
 public Cat(int age, string name, sex _sex)
     : base(age, name, _sex)
 {
 }
Ejemplo n.º 27
0
 public Animal(string name, int age, sex sex)
 {
     this.Name = name;
     this.Age = age;
     this.Sex = sex;
 }
Ejemplo n.º 28
0
 public Dog(string name, int age, sex gendre)
     : base(name, age, gendre)
 {
 }
Ejemplo n.º 29
0
 public Frog(int age, string name, sex _sex)
     : base(age, name, _sex)
 {
 }
Ejemplo n.º 30
0
 public person(int id, string name, sex g)
 {
     this.id     = id;
     this.name   = name;
     this.gender = g;
 }
Ejemplo n.º 31
0
 public void female()
 {
     this.sex = sex.FEMALE;
     //this.role = role.WIFE;
 }
Ejemplo n.º 32
0
 public HumanBody(sex sex)
 {
     _Sex = sex;
 }
Ejemplo n.º 33
0
        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();
        }
Ejemplo n.º 34
0
 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;
 }
Ejemplo n.º 37
0
 public void male()
 {
     this.sex = sex.MALE;
     //this.role = role.HUSB;
 }
Ejemplo n.º 38
0
 public Animal(int age, string name, sex _sex) : this(age, name)
 {
     this.Sex = _sex;
 }
Ejemplo n.º 39
0
        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;
                }
            }
        }
Ejemplo n.º 40
0
 public TennisPlayer(string firstName, string middleName, string lastName, string birthDate,
                     string nationality, sex gender) : base(firstName, middleName, lastName, birthDate, nationality, gender)
 {
 }
Ejemplo n.º 41
0
 public Cat(int age, string name, sex _sex)
     : base(age, name, _sex)
 {
 }
Ejemplo n.º 42
0
 public Animal(int age, string name, sex _sex)
     : this(age, name)
 {
     this.Sex = _sex;
 }