Пример #1
0
        public static void InputFamilyMemberScreen()
        {
            string             inputName   = "";
            sbyte              inputAge    = 0;
            FamilyMemberStatus inputStatus = 0; //FamilyMemberStatus.Working;

            Console.WriteLine();
            Console.WriteLine();

            Console.WriteLine("Input a family member");
            Console.WriteLine();
            Console.Write("Name: ");
            bool NameIsNotValid = true;

            while (NameIsNotValid)
            {
                try
                {
                    inputName = Console.ReadLine();
                    //Hristo must write the validation for the name
                    NameIsNotValid = false;
                }
                catch
                {
                }
            }
            Console.Write("Age: ");
            bool AgeIsNotValid = true;

            while (AgeIsNotValid)
            {
                try
                {
                    inputAge = sbyte.Parse(Console.ReadLine());
                    //Hristo must write the validation for the age
                    AgeIsNotValid = false;
                }
                catch
                {
                }
            }
            // TODO: Input a family member status
            FamilyMember inputFamilyMember = new FamilyMember(inputName, inputAge, inputStatus);

            Family.AddMember(inputFamilyMember);
            //TODO: add the family member in the list
            InputFamilyMemberMenu();
        }
Пример #2
0
 public FamilyMember(string name, sbyte age, FamilyMemberStatus status)
 {
     this.Name   = name;
     this.Age    = age;
     this.Status = familyMemberStatus;
 }