Example #1
0
        public static FullTime AddFTEmployee()
        {
            FullTime AddFullTime = null;

            Console.WriteLine("What is your name?");
            string employeeName = Console.ReadLine();

            employeeName = UserValidation.IsNullOrWhiteSpace(employeeName);
            Console.WriteLine("What is your address?");
            string employeeAddress = Console.ReadLine();

            employeeAddress = UserValidation.IsNullOrWhiteSpace(employeeAddress);
            Console.WriteLine("What is your current pay?");
            decimal employeePay = UserValidation.GetDecimal();

            AddFullTime = new FullTime(employeeName, employeeAddress, employeePay);

            return(AddFullTime);
        }
Example #2
0
        //Metho to add an employee to salary.
        public static Salaried AddSalariedEmployee()
        {
            Salaried AddSalaryEmployee = null;

            Console.WriteLine("What is your name?");
            string employeeName = Console.ReadLine();

            employeeName = UserValidation.IsNullOrWhiteSpace(employeeName);
            Console.WriteLine("What is your address?");
            string employeeAddress = Console.ReadLine();

            employeeAddress = UserValidation.IsNullOrWhiteSpace(employeeAddress);
            Console.WriteLine("What is the employee's salary?");
            decimal employeePay = UserValidation.GetDecimal();

            AddSalaryEmployee = new Salaried(employeeName, employeeAddress, employeePay);

            return(AddSalaryEmployee);
        }
Example #3
0
        public static Manager AddManager()
        {
            Manager AddManager = null;

            Console.WriteLine("What is employee name?");
            string employeeName = Console.ReadLine();

            employeeName = UserValidation.IsNullOrWhiteSpace(employeeName);
            Console.WriteLine("What is the employee address?");
            string employeeAddress = Console.ReadLine();

            employeeAddress = UserValidation.IsNullOrWhiteSpace(employeeAddress);
            Console.WriteLine("What is the annual salary?");
            decimal employeePay = UserValidation.GetDecimal();

            Console.WriteLine("What is the annual bonus?");
            decimal employeeBonus = UserValidation.GetDecimal();

            AddManager = new Manager(employeeName, employeeAddress, employeePay, employeeBonus);

            return(AddManager);
        }
Example #4
0
        public static PartTime AddPTEmployee()
        {
            PartTime AddPartTime = null;

            Console.WriteLine("What is your name?");
            string employeeName = Console.ReadLine();

            employeeName = UserValidation.IsNullOrWhiteSpace(employeeName);
            Console.WriteLine("What is your address?");
            string employeeAddress = Console.ReadLine();

            employeeAddress = UserValidation.IsNullOrWhiteSpace(employeeAddress);
            Console.WriteLine("What is your current pay?");
            decimal employeePay = UserValidation.GetDecimal();

            Console.WriteLine("How many hours per week are you working?");
            decimal hoursPerWeek = UserValidation.GetDecimal();

            AddPartTime = new PartTime(employeeName, employeeAddress, employeePay, hoursPerWeek);

            return(AddPartTime);
        }
Example #5
0
        public static Contractor AddContractorEmployee()
        {
            Contractor AddContractor = null;

            Console.WriteLine("What is your name?");
            string employeeName = Console.ReadLine();

            employeeName = UserValidation.IsNullOrWhiteSpace(employeeName);
            Console.WriteLine("What is your address?");
            string employeeAddress = Console.ReadLine();

            employeeAddress = UserValidation.IsNullOrWhiteSpace(employeeAddress);
            Console.WriteLine("What is your current pay?");
            decimal employeePay = UserValidation.GetDecimal();

            Console.WriteLine("How many hours per week are you working?");
            decimal hoursPerWeek    = UserValidation.GetDecimal();
            decimal noBenefitsBonus = 10;

            AddContractor = new Contractor(employeeName, employeeAddress, noBenefitsBonus, employeePay, hoursPerWeek);

            return(AddContractor);
        }