Esempio n. 1
0
        public decimal PayAmount(IContribute employee, decimal salary)
        {
            switch (employee.Code())
            {
                case EmployeeType.Intern:
                    return Intern.PayAmount(salary);

                case EmployeeType.Architect:
                    return Architect.PayAmount(salary);

                case EmployeeType.Consultant:
                    // Death Or Glory
                    return Consultant.PayAmount(salary);

                case EmployeeType.Developer:
                    return salary;
                default:
                    throw new WrongEmployeeComplaint();
            }
        }
Esempio n. 2
0
        public decimal PayAmount(IContribute employee, decimal salary)
        {
            const int freeLanceRisk = 1000;
            switch (employee.Code())
            {
                case EmployeeType.Intern:
                    return salary / 2;

                case EmployeeType.Architect:
                    return salary * 2;

                case EmployeeType.Consultant:
                    // Death Or Glory
                    return salary * 4 + freeLanceRisk;

                case EmployeeType.Developer:
                    return salary;
                default:
                    throw new WrongEmployeeComplaint();
            }
        }