Exemplo n.º 1
0
        static void Main(string[] args)
        {
            int empId = 4;

            //Employee Personal Details
            EmpPersonalDetails personalDetails = new EmpPersonalDetails();

            Console.WriteLine("Year End bonus for Employee {0} is {1}",
                              personalDetails.GetEmployeeDetails(empId).Name, personalDetails.CalculateYearEndBonus(empId, 12));

            Console.WriteLine("Duration Worked by Employee {0} is {1}",
                              personalDetails.GetEmployeeDetails(empId).Name, personalDetails.GetDurationWorked(empId));

            //Employee PF
            EmpPfDetails pfDetails = new EmpPfDetails(new EmpPersonalDetails());

            Console.WriteLine("Employer Contribution for Employee {0} is {1}",
                              personalDetails.GetEmployeeDetails(empId).Name, pfDetails.GetPfEmployerControlSofar(empId));


            //Employee Benefits
            EmpBenefits empBenefits = new EmpBenefits(new EmpPersonalDetails());

            Console.WriteLine("Benefits of Employee with grade {0} are:",
                              personalDetails.GetEmployeeDetails(empId).Grade);

            foreach (var benefit in empBenefits.GetBasicBenefits(empId))
            {
                Console.Write(benefit + "  ");
            }



            Console.Read();
        }
Exemplo n.º 2
0
        private static void Main(string[] args)
        {
            string returnValue = null;
            string name        = "Name";
            //XName environment = "SYSTare";
            //string reportName = "CognnosHPCReport";
            //string URL = GetCognosUrl(environment, reportName);
            //// Look for the name in the connectionStrings section.
            //ConnectionStringSettings settings =
            //    ConfigurationManager.ConnectionStrings[name];

            //// If found, return the connection string.
            //if (settings != null)
            //    returnValue = settings.ConnectionString;
            int  empId;
            char cont = 'Y';

            while (cont == 'Y')
            {
                empId = GetEmployeeIdFromUser();

                //Employee Personal Details
                EmpPersonalDetails personalDetails = new EmpPersonalDetails();

                Console.WriteLine("Year End bonus for Employee {0} is {1}",
                                  personalDetails.GetEmployeeDetails(empId).Name, personalDetails.CalculateYearEndBonus(empId, 12));

                Console.WriteLine("Duration Worked by Employee {0} is {1}",
                                  personalDetails.GetEmployeeDetails(empId).Name, personalDetails.GetDurationWorked(empId));

                //Employee PF
                EmpPfDetails pfDetails = new EmpPfDetails(new EmpPersonalDetails());

                Console.WriteLine("Employer Contribution for Employee {0} is {1}",
                                  personalDetails.GetEmployeeDetails(empId).Name, pfDetails.GetPfEmployerControlSofar(empId));

                //Employee Benefits
                EmpBenefits empBenefits = new EmpBenefits(new EmpPersonalDetails());
                Console.WriteLine("Benefits of Employee with grade {0} are:",
                                  personalDetails.GetEmployeeDetails(empId).Grade);

                foreach (var benefit in empBenefits.GetBasicBenefits(empId))
                {
                    Console.Write(benefit + "  ");
                }
                Console.WriteLine();
                Console.WriteLine("Press Y is you want to continue");
                cont = Convert.ToChar(Console.ReadLine());

                GenericDelegates dg = new GenericDelegates();
                int d = dg.UseGenericDelegates;
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            int empId = 1;

            EmpPersonalDetails personalDetails = new EmpPersonalDetails();

            Model.Employee emp = personalDetails.GetEmployeeDetails(empId);

            Console.WriteLine("Year end bonus for the employee {0} is {1}"
                              , emp.Name, emp.Salary);

            Console.WriteLine("Duration worked by employee {0} is {1}"
                              , emp.Name, emp.DurationWorked);

            EmpPfDetails empPfDetails = new EmpPfDetails();

            Console.WriteLine("Employer contribution for employee {0} is {1}"
                              , emp.Name, empPfDetails.GetEmployerCOntribution(empId));

            EmpBenefits empBenefits = new EmpBenefits();

            Console.WriteLine("Benefits of employee {0 }with grade 1 {1} are:"
                              , emp.Name, empBenefits.GetBasicBenefits(empId));
        }