public int GetTotalSalaryAmount(int employeeType)
        {
            GetTotalSalary getTotalSalary = null;

            if (employeeType == 0)
            {
                getTotalSalary = GetConsultantsTotalSalary;
            }
            else if (employeeType == 1) //director
            {
                getTotalSalary = GetDirectorsTotalSalary;
            }
            else if (employeeType == 20) //general employee
            {
                getTotalSalary = GetEmployeesTotalSalary;
            }
            else
            {
                throw new ApplicationException("Sorry! Not a valid employee type.");
            }

            int totalSalaryAmount = getTotalSalary();

            return(totalSalaryAmount);
        }
Exemple #2
0
        private static int RunGetCommandAndReturnExitCode(GetTotalSalary opts)
        {
            var client = new RestClient(opts.BaseUrl)
            {
                RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true,
            };

            var request  = new RestRequest(_path + "salary/sum", Method.GET);
            var response = client.Execute <double>(request);

            Console.Write(response.Data);
            return(0);
        }