public void AddHour(int day, Day.TimeCodes type, float hours)
 {
     days[day].Add(type, hours);
 }
 public void RemoveHours(int day, Day.TimeCodes type, float hours)
 {
     days[day].Remove(type, hours);
 }
Exemple #3
0
        public static void Run()
        {
            Console.WriteLine("What year are you in!");
            int Year = PromptForInt();

            Console.WriteLine("What Month now?");
            int Month = PromptForInt();

            Console.WriteLine("What day?");
            int      day      = PromptForInt();
            DateTime daytime  = new DateTime(Year, Month, day);
            TimeCard c        = new TimeCard(daytime);
            bool     finished = false;

            while (!finished)
            {
                Console.WriteLine("Would you like to add(press 1) or remove(press 2) exit(press 0)");
                int choice = PromptForIntInRange(0, 2);
                if (choice == 1)
                {
                    Console.WriteLine("Yo boi what day would you like to modifiiii!");
                    int addDay = PromptForIntInRange(1, 14);
                    Console.WriteLine("Regular: 1, Sick: 2, Vacation: 3");
                    choice = PromptForIntInRange(1, 3);
                    Day.TimeCodes timCody = Day.TimeCodes.REGULAR;
                    switch (choice)
                    {
                    case 1:
                        timCody = Day.TimeCodes.REGULAR;
                        break;

                    case 2:
                        timCody = Day.TimeCodes.SICK;
                        break;

                    case 3:
                        timCody = Day.TimeCodes.VACATION;
                        break;
                    }
                    Console.WriteLine("Yess thats good I think now give me how many hours m8..yes");
                    float amount = PromptForFloat();
                    c.AddHour((addDay - 1), timCody, amount);
                }
                else if (choice == 2)
                {
                    Console.WriteLine("Yo boi what day would you like to modifiiii!");
                    int removeDay = PromptForIntInRange(1, 14);
                    Console.WriteLine("Regular: 1, Sick: 2, Vacation: 3");
                    choice = PromptForIntInRange(1, 3);
                    Day.TimeCodes timCody = Day.TimeCodes.REGULAR;
                    switch (choice)
                    {
                    case 1:
                        timCody = Day.TimeCodes.REGULAR;
                        break;

                    case 2:
                        timCody = Day.TimeCodes.SICK;
                        break;

                    case 3:
                        timCody = Day.TimeCodes.VACATION;
                        break;
                    }
                    Console.WriteLine("Yess thats good I think now give me how many removed hours m8..yes");
                    float amount = PromptForFloat();
                    c.RemoveHours((removeDay - 1), timCody, amount);
                }
                else if (choice == 0)
                {
                    finished = true;
                }

                Console.WriteLine(c);
                Console.ReadLine();
            }
        }