コード例 #1
0
 private void Load()
 {
     using (StreamReader sr = new StreamReader(_directory + _fileName))
     {
         while (sr.Peek() > -1)
         {
             string line = sr.ReadLine();
             if (line.Contains("Kalen"))
             {
                 FullTime f = new FullTime("Kalen".ToUpper(), "2235 River".ToUpper(), 18, 40);
                 _employee.Add(f);
             }
             else if (line.Contains("Marcus"))
             {
                 FullTime f1 = new FullTime("Marcus".ToUpper(), "2235 Land".ToUpper(), 27, 40);
                 _employee.Add(f1);
             }
             else if (line.Contains("Kevin"))
             {
                 FullTime f2 = new FullTime("Kevin".ToUpper(), "2235 Beach".ToUpper(), 27, 40);
                 _employee.Add(f2);
             }
         }
     }
 }
コード例 #2
0
        public void FullTime()
        {
            Console.Clear();
            //Setting UI color
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine("Full Time:");
            Console.WriteLine("==============");
            Console.WriteLine("==============");
            Console.ForegroundColor = ConsoleColor.Gray;

            string  Name         = Validation.ValidateString("\nPlease enter employee name: ");
            string  Address      = Validation.ValidateString("\nPlease enter employee address: ");
            decimal HoursPerWeek = 40;
            decimal PayPerHour   = Validation.ValidateDecimal("\nPlease enter employee pay per hour? ");

            FullTime fullTime = new FullTime(Name.ToUpper(), Address.ToUpper(), PayPerHour, HoursPerWeek);

            _employee.Add(fullTime);


            Console.WriteLine("\nFull Time employee created.");


            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            _myMenu.Display();
            Selection2();
        }