コード例 #1
0
        public static Competitor AddProfessionalCompetitor(string inID, string inName, string inAddress, string inAge, string inScore, string inSponsor) //Makes our professsional competitor.
        {
            newSkiNumber = newSkiNumber + 1;                                                                                                             //Increments the competitor number by 1.
            string       newCompetitorNumberString = newSkiNumber.ToString();                                                                            //Turns that int into a string.
            Professional newProfessional           = new Professional(inID, inName, newCompetitorNumberString, inAddress, inAge, inScore, inSponsor);    //Calls the professional constructor in the Competitor Class.

            skiCompetitors.Add(newCompetitorNumberString, newProfessional);                                                                              //Adds the competitor to the dictionary.
            Income = Income + 200;                                                                                                                       //Professionals have to pay £200.
            return(newProfessional);                                                                                                                     //Returns the professional.
        }
コード例 #2
0
        public void EditProfessional(string inID, string inName, string inNumber, string inAdress, string inAge, string inScore, string inSponsor) //Saves the edited comepetitor data.
        {
            Professional EditedProfessional = new Professional(inID, inName, inNumber, inAdress, inAge, inScore, inSponsor);                       //Creates a new amateur called "EditedProfessional"

            skiCompetitors[inNumber] = EditedProfessional;                                                                                         //Saves the new inforamtion too the dictionary.
        }