Пример #1
0
        static void CreatePayroll()
        {
            Console.Clear();
            Console.WriteLine("-------------------------------------------------------------------");
            Console.WriteLine("                   C R E A T E   P A Y R O L L");
            Console.WriteLine("-------------------------------------------------------------------");
            Console.WriteLine("PLEASE ENTER EXISTING EMPLOYEE NAME TO CREATE PAYROLL.");
            Console.WriteLine("REMINDER: Capitalize Only the First Letter of Each Name.");

            Console.Write("\nEmployee Name: ");
            CREATEPAYROLLDetails.NameInput = Console.ReadLine();

            var message = "Name:\t" + CREATEPAYROLLDetails.NameInput;

            USERReports.AddActionReport(message);

            message = "Employee Name:\t\t\t\t\t" + CREATEPAYROLLDetails.NameInput;
            PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

            message = "\t\t" + CREATEPAYROLLDetails.NameInput;
            PAYROLLHISTORY.AddEmployeeName(message);

            if (MANAGEEMPLOYEES.Names.Any(s => s.Equals(CREATEPAYROLLDetails.NameInput, StringComparison.OrdinalIgnoreCase)))
            {
                Console.WriteLine("\n-------------------------------------------------------------------");
                Console.WriteLine("PLEASE ENTER EMPLOYEE'S PAYROLL DETAILS.");

                Console.Write("\nTotal Days Present: ");
                CREATEPAYROLLDetails.DaysPresent = Convert.ToInt32(Console.ReadLine());
                message = "Days Present:\t" + CREATEPAYROLLDetails.DaysPresent + " days";
                USERReports.AddActionReport(message);
                message = "Total Days Present:\t\t\t\t" + CREATEPAYROLLDetails.DaysPresent + " days";
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nTotal Hours Worked: ");
                CREATEPAYROLLDetails.HoursWorked = Convert.ToInt32(Console.ReadLine());
                message = "Hours Worked:\t" + CREATEPAYROLLDetails.HoursWorked + " hours";
                USERReports.AddActionReport(message);
                message = "Total Hours Worked:\t\t\t\t" + CREATEPAYROLLDetails.HoursWorked + " hours";
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nHourly Rate: ");
                CREATEPAYROLLDetails.HourlyRate = Convert.ToInt32(Console.ReadLine());
                message = "Hourly Rate:\tPhp. " + CREATEPAYROLLDetails.HourlyRate;
                USERReports.AddActionReport(message);
                message = "Hourly Rate:\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.HourlyRate;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nTotal Over Time Hours Worked: ");
                CREATEPAYROLLDetails.OTHoursWorked = Convert.ToInt32(Console.ReadLine());
                message = "OT Hours Worked:" + CREATEPAYROLLDetails.OTHoursWorked + " hours";
                USERReports.AddActionReport(message);
                message = "Total OT Hours Worked:\t\t\t\t" + CREATEPAYROLLDetails.OTHoursWorked + " hours";
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nOver Time Rate: ");
                CREATEPAYROLLDetails.OTRate = Convert.ToInt32(Console.ReadLine());
                message = "OT Rate:\tPhp. " + CREATEPAYROLLDetails.OTRate;
                USERReports.AddActionReport(message);
                message = "OT Rate:\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.OTRate;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nBonus: ");
                CREATEPAYROLLDetails.Bonus = Convert.ToInt32(Console.ReadLine());
                message = "Bonus:\t\tPhp. " + CREATEPAYROLLDetails.Bonus;
                USERReports.AddActionReport(message);
                message = "Bonus:\t\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.Bonus;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                CREATEPAYROLL_GrossIncome_.CalculateGrossIncome();

                message = "Gross Income:\tPhp. " + CREATEPAYROLLDetails.GrossIncome;
                USERReports.AddResultReport(message);
                message = "\t\t\t\t\t---------------------------";
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);
                message = "GROSS INCOME:\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.GrossIncome + "\n";
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                message = "\tPhp. " + CREATEPAYROLLDetails.GrossIncome;
                PAYROLLHISTORY.AddGrossIncome(message);

                Console.WriteLine("\n-------------------------------------------------------------------");
                Console.WriteLine("Gross Income: Php. " + CREATEPAYROLLDetails.GrossIncome);

                Console.WriteLine("-------------------------------------------------------------------");
                Console.WriteLine("PLEASE ENTER EMPLOYEE'S WITHHOLDING TAX AND DEDUCTION DETAILS.");

                Console.Write("\nTax: ");
                CREATEPAYROLLDetails.Tax = Convert.ToInt32(Console.ReadLine());
                message = "Tax:\t\tPhp. " + CREATEPAYROLLDetails.Tax;
                USERReports.AddActionReport(message);
                message = "Tax:\t\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.Tax;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nSSS: ");
                CREATEPAYROLLDetails.SSS = Convert.ToInt32(Console.ReadLine());
                message = "SSS:\t\tPhp. " + CREATEPAYROLLDetails.SSS;
                USERReports.AddActionReport(message);
                message = "SSS:\t\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.SSS;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nPhilHealth: ");
                CREATEPAYROLLDetails.PhilHealth = Convert.ToInt32(Console.ReadLine());
                message = "PhilHealth:\tPhp. " + CREATEPAYROLLDetails.PhilHealth;
                USERReports.AddActionReport(message);
                message = "PhilHealth:\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.PhilHealth;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nPag Ibig: ");
                CREATEPAYROLLDetails.PagIbig = Convert.ToInt32(Console.ReadLine());
                message = "Pag Ibig:\tPhp. " + CREATEPAYROLLDetails.PagIbig;
                USERReports.AddActionReport(message);
                message = "Pag Ibig:\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.PagIbig;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nCash Advance: ");
                CREATEPAYROLLDetails.CashAdvance = Convert.ToInt32(Console.ReadLine());
                message = "Cash Advance:\tPhp. " + CREATEPAYROLLDetails.CashAdvance;
                USERReports.AddActionReport(message);
                message = "Cash Advance:\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.CashAdvance;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nSalary Loan: ");
                CREATEPAYROLLDetails.SalaryLoan = Convert.ToInt32(Console.ReadLine());
                message = "Salary Loan:\tPhp. " + CREATEPAYROLLDetails.SalaryLoan;
                USERReports.AddActionReport(message);
                message = "Salary Loan:\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.SalaryLoan;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nPag Ibig Loan: ");
                CREATEPAYROLLDetails.PagIbigLoan = Convert.ToInt32(Console.ReadLine());
                message = "Pag Ibig Loan:\tPhp. " + CREATEPAYROLLDetails.PagIbigLoan;
                USERReports.AddActionReport(message);
                message = "Pag Ibig Loan:\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.PagIbigLoan;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                Console.Write("\nOthers: ");
                CREATEPAYROLLDetails.Others = Convert.ToInt32(Console.ReadLine());
                message = "Others:\t\tPhp. " + CREATEPAYROLLDetails.Others;
                USERReports.AddActionReport(message);
                message = "Others: \t\t\t\t\tPhp. " + CREATEPAYROLLDetails.Others;
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                CREATEPAYROLL_NetIncome_.CalculateNetIncome();

                message = "Net Income:\tPhp. " + CREATEPAYROLLDetails.NetIncome;
                USERReports.AddResultReport(message);
                message = "\t\t\t\t\t---------------------------";
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);
                message = "NET INCOME:\t\t\t\t\tPhp. " + CREATEPAYROLLDetails.NetIncome + "\n";
                PAYROLLPROCESSINGHistory.AddPayrollDetail(message);

                message = "\tPhp. " + CREATEPAYROLLDetails.NetIncome;
                PAYROLLHISTORY.AddNetIncome(message);

                Console.WriteLine("\n-------------------------------------------------------------------");
                Console.WriteLine("Net Income: Php. " + CREATEPAYROLLDetails.NetIncome);

                PayrollProcessing();
            }

            else
            {
                Console.Clear();
                message = "Invalid Employee Name";
                USERReports.AddResultReport(message);
                Console.WriteLine("-------------------------------------------------------------------");
                Console.WriteLine("                            E R R O R");
                Console.WriteLine("-------------------------------------------------------------------");
                Console.WriteLine("EMPLOYEE NAME DOES NOT EXIST. PLEASE PRESS ANY KEY TO TRY AGAIN.\n");
                Console.ReadKey();
                CreatePayroll();
            }
        }