Example #1
0
        private static void Add_nanny()
        {
            Console.WriteLine("Enter ID:");
            string id = Console.ReadLine();

            Console.WriteLine("Enter family name:");
            string family_name = Console.ReadLine();

            Console.WriteLine("Enter first name:");
            string name = Console.ReadLine();

            Console.WriteLine("Enter birth date: (xx/yy/zzzz)");
            DateTime bitrh_date = Convert.ToDateTime(Console.ReadLine());

            Console.WriteLine("Enter telephone number:");
            string telephone = Console.ReadLine();

            Console.WriteLine("Enter address:");
            string address = Console.ReadLine();

            Console.WriteLine("Enter if has elevator (y/n)");
            bool has_elevator = yes_or_no(Convert.ToChar(Console.ReadLine()));

            Console.WriteLine("Enter floor:");
            int floor = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter years of practice:");
            int years_of_practice = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter maximum number of children:");
            int max_number_childern = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter minimum age:");
            int min_age = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter maximum age:");
            int max_age = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter if works by hours:(y/n)");
            bool works_by_hours = yes_or_no(Convert.ToChar(Console.ReadLine()));

            Console.WriteLine("Enter rate per hour:");
            float rate_per_hour = float.Parse(Console.ReadLine());

            Console.WriteLine("Enter rate per month:");
            float rate_per_month = float.Parse(Console.ReadLine());

            Console.WriteLine("Enter days of word (6 days, y/n for each day):");
            bool[] days_of_work = new bool[6];
            for (int i = 0; i < 6; i++)
            {
                days_of_work[i] = yes_or_no(Convert.ToChar(Console.ReadLine()));
            }
            Console.WriteLine("Enter hours of work (xx.yy)");
            float[,] hours_of_work = new float[6, 2];
            float time = 0;

            for (int i = 0; i < 6; i++)
            {
                if (days_of_work[i])
                {
                    Console.WriteLine(Enum.GetName(typeof(DayOfWeek), i));
                    for (int j = 0; j < 2; j++)
                    {
                        hours_of_work[i, j] = float.Parse(Console.ReadLine());
                    }
                }
                else
                {
                    hours_of_work[i, 0] = (float)00.00;
                    hours_of_work[i, 1] = (float)00.00;
                }
            }
            Console.WriteLine("Enter if gets days off the the education ministry:");
            bool days_off_by_education_ministry = yes_or_no(Convert.ToChar(Console.ReadLine()));

            Console.WriteLine("Enter recomondations:");
            string recommendations = Console.ReadLine();

            BE.Nanny the_nanny = new BE.Nanny(id, family_name, name, telephone, address,
                                              bitrh_date, has_elevator, floor, years_of_practice, max_number_childern, min_age
                                              , max_age, works_by_hours, rate_per_hour, rate_per_month, days_of_work, hours_of_work, days_off_by_education_ministry, recommendations);
            bl.addNanny(the_nanny);
        }