예제 #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();
        }
예제 #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;
            }
        }