Advertisement
_vish_99__

MY_CODE_BISHAL

Jul 15th, 2022
976
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 22.99 KB | None | 0 0
  1. // See https://aka.ms/new-console-template for more information
  2.  
  3. namespace DXC_Employee
  4. {
  5.     abstract class SalarayCounter
  6.     {
  7.         public const int NoofWorkingDays = 30;
  8.         public static int incrementby20(Employee emp)
  9.         {
  10.             //Console.WriteLine((emp.emp_Salary.BaseSalary * 20) / 100);
  11.             return (emp.emp_Salary.BaseSalary * 20) / 100;
  12.         }
  13.  
  14.         public static int incrementby30(Employee emp)
  15.         {
  16.             return (emp.emp_Salary.BaseSalary * 30) / 100;
  17.         }
  18.  
  19.         public static int incrementby40(Employee emp)
  20.         {
  21.             return (emp.emp_Salary.BaseSalary * 40) / 100;
  22.         }
  23.  
  24.         public static int getOneDaySalary(Employee passedEmp)
  25.         {
  26.             return (passedEmp.emp_Salary.BaseSalary / NoofWorkingDays);
  27.         }
  28.  
  29.  
  30.         //Gives the total money that has to be deducted from the employees salary.
  31.         public static int totalMoneyDedctionValue(Employee passedEmp)
  32.         {
  33.             int oneDaySalary = SalarayCounter.getOneDaySalary(passedEmp);
  34.             return oneDaySalary * passedEmp.emp_Attendance.TotalExtraLeaves;
  35.         }
  36.  
  37.         public static int incrementByPercentage(int value, int percentage)
  38.         {
  39.             return (value * percentage) / 100;
  40.         }
  41.     }
  42.  
  43.     // Custom class for designation and level check
  44.     abstract class DesignationSelector
  45.     {
  46.         /// <summary>
  47.         /// Made specifically for the array
  48.         /// </summary>
  49.  
  50.         public static Designations[] designations = new Designations[] {
  51.             new Designations("Manager",1),
  52.             new Designations("Deputy_Manager",1),
  53.             new Designations("Chief_Manager",1),
  54.  
  55.  
  56.             new Designations("AGM",2),
  57.             new Designations("DGM",2),
  58.             new Designations("GM",2),
  59.  
  60.             new Designations("CGM",3),
  61.             new Designations("DMD",3),
  62.             new Designations("MD",3)
  63.         };
  64.  
  65.         public static string getDesignation(int passedIndex)
  66.         {
  67.             return DesignationSelector.designations[passedIndex].Designation;
  68.         }
  69.         public static int getDesignationLevel(int index)
  70.         {
  71.             return DesignationSelector.designations[index].DesignationLevel;
  72.         }
  73.  
  74.         public static int getDesignationsLength()
  75.         {
  76.             return DesignationSelector.designations.Length;
  77.         }
  78.  
  79.         public static void getDesignation(Employee emp)
  80.         {
  81.             Console.WriteLine("Designation : " + emp.empDes.Designation);
  82.             Console.WriteLine("Designation Level : " + emp.empDes.DesignationLevel);
  83.         }
  84.  
  85.     }
  86.     public class Designations
  87.     {
  88.         private string designation;
  89.         private int designationLevel;
  90.  
  91.         public string Designation
  92.         {
  93.             get { return designation; }
  94.             set { designation = value; }    
  95.         }
  96.  
  97.         public int DesignationLevel
  98.         {
  99.             get { return designationLevel; }
  100.             set { designationLevel = value; }
  101.         }
  102.  
  103.         // safety
  104.         public Designations()
  105.         {
  106.             this.Designation = " WAITING FOR THE INPUT ";
  107.             this.DesignationLevel = -1;
  108.         }
  109.         public Designations(string passedDesignation, int passedlevel)
  110.         {
  111.             this.designation = passedDesignation;
  112.             this.designationLevel = passedlevel;
  113.  
  114.             //Console.WriteLine("Value loaded for Designation : ");
  115.  
  116.         }
  117.     }
  118.  
  119.     public class Attendance
  120.     {
  121.         private int totalDaysOfWork;
  122.         private int totalHoursOfWork;
  123.         private int totalPaidHolidays;
  124.         private int totalExtraLeaves;
  125.         private int totalSalaryAfterDeduction;
  126.  
  127.         private int amountDeductedFromSalary;
  128.         //public Boolean runValue = false;
  129.  
  130.         public int TotalDaysOfWork
  131.         {
  132.             get { return totalDaysOfWork; }
  133.             set { totalDaysOfWork = value; }
  134.         }
  135.         public int TotalHoursOfWork
  136.         {
  137.             get { return totalHoursOfWork; }
  138.             set { totalHoursOfWork = value; }
  139.         }
  140.         public int TotalPaidHolidays
  141.         {
  142.             get { return totalPaidHolidays; }
  143.             set { totalPaidHolidays = value; }
  144.         }
  145.         public int TotalExtraLeaves
  146.         {
  147.             get { return totalExtraLeaves; }
  148.             set { totalExtraLeaves = value; }
  149.         }
  150.  
  151.         public int TotalSalaryAfterDeduction
  152.         {
  153.             get { return totalSalaryAfterDeduction; }
  154.             set { totalSalaryAfterDeduction = value; }
  155.         }
  156.  
  157.         public int AmountDeductedFromSalary
  158.         {
  159.             get { return amountDeductedFromSalary; }
  160.             set { amountDeductedFromSalary = value; }
  161.         }
  162.  
  163.         public Attendance()
  164.         {
  165.  
  166.         }
  167.         public Attendance(int passed_TotalDaysOfWork, int passed_TotalHoursOfWork, int passed_TotalPaidHolidays, int passed_TotalExtraLeaves)
  168.         {
  169.             this.TotalDaysOfWork = passed_TotalDaysOfWork;
  170.             this.TotalHoursOfWork = passed_TotalHoursOfWork;
  171.             this.TotalPaidHolidays = passed_TotalPaidHolidays;
  172.             this.TotalExtraLeaves = passed_TotalExtraLeaves;
  173.             this.TotalSalaryAfterDeduction = 0;
  174.  
  175.             //Console.WriteLine("Value loaded for Attendance : ");
  176.  
  177.         }
  178.         public void Display_Total_Attendance(Employee emp)
  179.         {
  180.             Console.WriteLine( "Total Work Days : " + emp.emp_Attendance.TotalDaysOfWork);
  181.             Console.WriteLine("Total Hours of Work : " + emp.emp_Attendance.TotalHoursOfWork);
  182.             Console.WriteLine("Total Paid Holidays : " + emp.emp_Attendance.TotalPaidHolidays);
  183.             Console.WriteLine("Total Extra Leaves : " + emp.emp_Attendance.TotalExtraLeaves);
  184.         }
  185.  
  186.         public void Deduct_Salary(Employee emp)
  187.         {
  188.  
  189.             ///////////////////////////////////////////////////////////////////////////////////////
  190.             ///////////////////////////////////////////////////////////////////////////////////////
  191.             ///////////////////////////////////////////////////////////////////////////////////////
  192.             ///////////////////////////////////////////////////////////////////////////////////////
  193.             ///////////////////////////////////////////////////////////////////////////////////////
  194.             ///////////////////////////////////////////////////////////////////////////////////////
  195.             ///
  196.  
  197.             if (emp.emp_Attendance.TotalExtraLeaves > 0 /*&& !runValue*/)
  198.             {
  199.  
  200.                 // problem was here
  201.                 //TotalSalaryAfterDeduction = emp.emp_Salary.BaseSalary -= SalarayCounter.totalMoneyDedctionValue(emp);
  202.                 TotalSalaryAfterDeduction = emp.emp_Salary.BaseSalary - SalarayCounter.totalMoneyDedctionValue(emp);
  203.  
  204.                 Console.WriteLine("Total Salary Deduction Breakup : " +
  205.                     "\n One day salary : " + SalarayCounter.getOneDaySalary(emp) +
  206.                     "\n Extra Leaves : " + emp.emp_Attendance.TotalExtraLeaves +
  207.                     "\n Total Salary Deducted : " + SalarayCounter.totalMoneyDedctionValue(emp));
  208.  
  209.                 AmountDeductedFromSalary = SalarayCounter.totalMoneyDedctionValue(emp);
  210.                 //runValue = true;
  211.                 return;
  212.             }
  213.  
  214.             Console.WriteLine("No Deduction ");
  215.         }
  216.  
  217.  
  218.     }
  219.     public class Salary:Attendance
  220.     {
  221.         private int baseSalary;
  222.         public int BaseSalary
  223.         {
  224.             get { return baseSalary; }
  225.             set { baseSalary = value; }
  226.         }
  227.         private int costToCompany;
  228.         public int CostToCompany
  229.         {
  230.             get { return costToCompany; }
  231.             set { costToCompany = value; }
  232.         }
  233.  
  234.  
  235.         public Salary()
  236.         {
  237.  
  238.         }
  239.  
  240.         public Salary(int passed_Base_Salary, int passed_Cost_To_Company)
  241.         {
  242.             this.BaseSalary = passed_Base_Salary;
  243.             this.CostToCompany = passed_Cost_To_Company;
  244.  
  245.             //Console.WriteLine("Value loaded for Salary : ");
  246.         }
  247.         public void Display_Employee_Salary(Employee emp)
  248.         {
  249.             Console.WriteLine("--------------------------------------------------");
  250.             Console.WriteLine("Base Salary : " + emp.emp_Salary.BaseSalary);
  251.             Console.WriteLine("Cost to Company : " + emp.emp_Salary.CostToCompany);
  252.             Console.WriteLine("--------------------------------------------------");
  253.  
  254.  
  255.         }
  256.  
  257.        
  258.  
  259.         //public void Increment_Base_Salary_By_Designation(Designation passedEmpObj, Employee passedemp_Base_Salary)
  260.         //{
  261.         //    if (passedEmpObj == Designation.MANAGER || passedEmpObj == Designation.DEPUTY_MANAGER || passedEmpObj == Designation.CHIEF_MANAGER)
  262.         //    {
  263.         //        // Increment By 20%
  264.         //        Console.WriteLine("Incrementing by 20%");
  265.         //        passedemp_Base_Salary.emp_Salary.BaseSalary = SalarayCounter.incrementby20(passedemp_Base_Salary.emp_Salary.BaseSalary);
  266.         //    }
  267.  
  268.  
  269.         //    if (passedEmpObj == Designation.ASSISTANT_GENERAL_MANAGER || passedEmpObj == Designation.DEPUTY_GENERAL_MANAGER || passedEmpObj == Designation.GENERAL_MANAGER)
  270.         //    {
  271.         //        // Increment By 30%
  272.         //        Console.WriteLine("Incrementing by 30%");
  273.         //        passedemp_Base_Salary.emp_Salary.BaseSalary = SalarayCounter.incrementby30(passedemp_Base_Salary.emp_Salary.BaseSalary);
  274.  
  275.         //    }
  276.  
  277.         //    if (passedEmpObj == Designation.CHIEF_GENERAL_MANAGER || passedEmpObj == Designation.DEPUTY_MANAGEMENT_DIRECTOR || passedEmpObj == Designation.MANAGEMENT_DIRECTOR)
  278.         //    {
  279.         //        // Increment By 40%
  280.         //        Console.WriteLine("Incrementing by 40%");
  281.         //        passedemp_Base_Salary.emp_Salary.BaseSalary = SalarayCounter.incrementby40(passedemp_Base_Salary.emp_Salary.BaseSalary);
  282.         //    }
  283.         //}
  284.     }
  285.     public class Allowances : Salary
  286.     {
  287.         private int houseLoanAllowance;
  288.         private int carLoanAllowance;
  289.         private int basicRentAllowance;
  290.  
  291.         public int HouseLoanAllowance
  292.         {
  293.             get { return houseLoanAllowance; }
  294.             set { houseLoanAllowance = value; }
  295.         }
  296.  
  297.         public int CarLoanAllowance
  298.         {
  299.             get { return carLoanAllowance; }
  300.             set { carLoanAllowance = value; }
  301.         }
  302.         public int BasicRentAllowance
  303.         {
  304.             get { return basicRentAllowance; }
  305.             set
  306.             {
  307.                 basicRentAllowance = value;
  308.             }
  309.         }
  310.         public Allowances()
  311.         {
  312.  
  313.         }
  314.         public Allowances(int passed_House_Loan_Allowance, int passed_Car_Loan_Allowance, int Basic_Rent_Allowance)
  315.         {
  316.             this.HouseLoanAllowance = passed_House_Loan_Allowance;
  317.             this.CarLoanAllowance = passed_Car_Loan_Allowance;
  318.             this.BasicRentAllowance = Basic_Rent_Allowance;
  319.  
  320.             //Console.WriteLine("Value Loaded for Allowances : ");
  321.         }
  322.         public void Display_Employee_Allowances(Employee emp)
  323.         {
  324.             Console.WriteLine(" /////////////////////////// ");
  325.             Console.WriteLine("The House Loan Allowance is : " + emp.emp_Allowances.HouseLoanAllowance);
  326.             Console.WriteLine("The Car Loan Allowance is : " + emp.emp_Allowances.CarLoanAllowance);
  327.             Console.WriteLine("The Basic Rent Allowance is : " + emp.emp_Allowances.BasicRentAllowance);
  328.             Console.WriteLine(" /////////////////////////// ");
  329.  
  330.         }
  331.         public void Increment_Base_By_Designation(Employee emp)
  332.         {
  333.             int level = emp.empDes.DesignationLevel;
  334.             if (level == 1)
  335.             {
  336.                 emp.emp_Salary.BaseSalary += SalarayCounter.incrementby20(emp);
  337.             }
  338.             if (level == 2)
  339.             {
  340.                 emp.emp_Salary.BaseSalary += SalarayCounter.incrementby30(emp);
  341.  
  342.             }
  343.             if (level == 3)
  344.             {
  345.                 emp.emp_Salary.BaseSalary += SalarayCounter.incrementby40(emp);
  346.  
  347.             }
  348.         }
  349.         public void Increment_Allow_By_Designation(Employee emp)
  350.         {
  351.             int level = emp.empDes.DesignationLevel;
  352.             if(level == 1)
  353.             {
  354.                 emp.emp_Allowances.CarLoanAllowance += SalarayCounter.incrementByPercentage(emp.emp_Allowances.CarLoanAllowance, 20);
  355.                 emp.emp_Allowances.BasicRentAllowance += SalarayCounter.incrementByPercentage(emp.emp_Allowances.BasicRentAllowance, 20);
  356.                 emp.emp_Allowances.HouseLoanAllowance += SalarayCounter.incrementByPercentage(emp.emp_Allowances.HouseLoanAllowance, 20);
  357.             }
  358.  
  359.             if (level == 2)
  360.             {
  361.                 emp.emp_Allowances.CarLoanAllowance += SalarayCounter.incrementByPercentage(emp.emp_Allowances.CarLoanAllowance, 30);
  362.                 emp.emp_Allowances.BasicRentAllowance += SalarayCounter.incrementByPercentage(emp.emp_Allowances.BasicRentAllowance, 30);
  363.                 emp.emp_Allowances.HouseLoanAllowance += SalarayCounter.incrementByPercentage(emp.emp_Allowances.HouseLoanAllowance, 30);
  364.             }
  365.  
  366.             if (level == 3)
  367.             {
  368.                 emp.emp_Allowances.CarLoanAllowance += SalarayCounter.incrementByPercentage(emp.emp_Allowances.CarLoanAllowance, 40);
  369.                 emp.emp_Allowances.BasicRentAllowance += SalarayCounter.incrementByPercentage(emp.emp_Allowances.BasicRentAllowance, 40);
  370.                 emp.emp_Allowances.HouseLoanAllowance += SalarayCounter.incrementByPercentage(emp.emp_Allowances.HouseLoanAllowance, 40);
  371.             }
  372.  
  373.         }
  374.         //public void Increment_Allowance_By_Designation(Designation passedEmpObj, Employee passedEmp)
  375.         //{
  376.         //    if (passedEmpObj == Designation.MANAGER || passedEmpObj == Designation.DEPUTY_MANAGER || passedEmpObj == Designation.CHIEF_MANAGER)
  377.         //    {
  378.  
  379.         //        passedEmp.emp_Allowances.HouseLoanAllowance = SalarayCounter.incrementby20(passedEmp.emp_Allowances.HouseLoanAllowance);
  380.         //        passedEmp.emp_Allowances.CarLoanAllowance = SalarayCounter.incrementby20(passedEmp.emp_Allowances.CarLoanAllowance);
  381.         //        passedEmp.emp_Allowances.BasicRentAllowance = SalarayCounter.incrementby20(passedEmp.emp_Allowances.HouseLoanAllowance);
  382.  
  383.         //    }
  384.  
  385.         //    if (passedEmpObj == Designation.ASSISTANT_GENERAL_MANAGER || passedEmpObj == Designation.DEPUTY_GENERAL_MANAGER || passedEmpObj == Designation.GENERAL_MANAGER)
  386.         //    {
  387.         //        passedEmp.emp_Allowances.HouseLoanAllowance = SalarayCounter.incrementby30(passedEmp.emp_Allowances.HouseLoanAllowance);
  388.         //        passedEmp.emp_Allowances.CarLoanAllowance = SalarayCounter.incrementby30(passedEmp.emp_Allowances.CarLoanAllowance);
  389.         //        passedEmp.emp_Allowances.BasicRentAllowance = SalarayCounter.incrementby30(passedEmp.emp_Allowances.HouseLoanAllowance);
  390.         //    }
  391.  
  392.         //    if (passedEmpObj == Designation.CHIEF_GENERAL_MANAGER || passedEmpObj == Designation.DEPUTY_MANAGEMENT_DIRECTOR || passedEmpObj == Designation.MANAGEMENT_DIRECTOR)
  393.         //    {
  394.         //        passedEmp.emp_Allowances.HouseLoanAllowance = SalarayCounter.incrementby40(passedEmp.emp_Allowances.HouseLoanAllowance);
  395.         //        passedEmp.emp_Allowances.CarLoanAllowance = SalarayCounter.incrementby40(passedEmp.emp_Allowances.CarLoanAllowance);
  396.         //        passedEmp.emp_Allowances.BasicRentAllowance = SalarayCounter.incrementby40(passedEmp.emp_Allowances.HouseLoanAllowance);
  397.  
  398.         //    }
  399.  
  400.         //}
  401.  
  402.     }
  403.  
  404.     public class Employee : Allowances
  405.     {
  406.  
  407.         public Salary emp_Salary;
  408.         public Allowances emp_Allowances;
  409.         public Attendance emp_Attendance;
  410.        
  411.  
  412.         // employees
  413.         public string name;
  414.         public int age;
  415.         public int emp_id;
  416.         public Designations empDes;
  417.         //public int DOB;
  418.  
  419.         // constructor.
  420.         public Employee()
  421.         {
  422.         }
  423.         public Employee(Attendance emp_Attendance, Salary emp_Salary, Allowances emp_Allowances, string name, int age, int emp_id, Designations des)
  424.         {
  425.             this.emp_Attendance = emp_Attendance;
  426.             this.emp_Salary = emp_Salary;
  427.             this.emp_Allowances = emp_Allowances;
  428.             this.name = name;
  429.             this.age = age;
  430.             this.emp_id = emp_id;
  431.             this.empDes = des;
  432.  
  433.             //Console.WriteLine("Value loaded for Employee : ");
  434.  
  435.            
  436.  
  437.         }
  438.         /// <summary>
  439.         /// Displays Employee Details.
  440.         /// </summary>
  441.         /// <param name="emp"></param>
  442.         public void Display_Employee_Details()
  443.         {
  444.             Console.WriteLine("The Name of the employee is : " + this.name);
  445.             Console.WriteLine("The Age of the employee is : " + this.age);
  446.             Console.WriteLine("The Emp_id of the employee is : " + this.emp_id);
  447.             Display_Employee_Salary(this);
  448.             Display_Employee_Allowances(this);
  449.             Console.WriteLine("The Designation of the employee is : " + this.empDes);
  450.  
  451.         }
  452.  
  453.         public void Display_Employee_Designation()
  454.         {
  455.             Console.WriteLine("The Designation of the employee is : " +
  456.                 "\nEmployee Designation : "+ this.empDes.Designation +
  457.                 "\nEmployee Level : " + this.empDes.DesignationLevel);
  458.  
  459.         }
  460.         public void IncrementDesignation()
  461.         {
  462.        
  463.             //looping through the designations
  464.  
  465.             string des = this.empDes.Designation;
  466.             int lvl = this.empDes.DesignationLevel;
  467.             //Console.WriteLine(des + lvl);
  468.             for (int i = 0; i < DesignationSelector.getDesignationsLength() - 1; i++)
  469.             {
  470.                 if (des == DesignationSelector.getDesignation(i))
  471.                 {
  472.                     des = DesignationSelector.getDesignation(i + 1);
  473.                     lvl = DesignationSelector.getDesignationLevel(i + 1);
  474.                     break;
  475.                 }
  476.             }
  477.  
  478.             this.empDes.Designation = des;
  479.             this.empDes.DesignationLevel = lvl;
  480.  
  481.             Console.WriteLine("Employee Designation has been incremented to : "
  482.                 + "\nEmployee Designation : " + empDes.Designation + "\n" +
  483.                 "Employee Level : " + empDes.DesignationLevel);
  484.         }
  485.  
  486.         public void Promote_Employee()
  487.         {
  488.             // To be Implemented
  489.  
  490.             IncrementDesignation();
  491.             Increment_Allow_By_Designation(this);
  492.             Increment_Base_By_Designation(this);
  493.             Display_Employee_Allowances(this);
  494.         }
  495.     }
  496.  
  497.     public class Manager : Employee
  498.     {
  499.         public Attendance atn;
  500.         public Salary sal;
  501.         public Allowances all;
  502.         public Designations ds;
  503.         public Employee emp;
  504.         public Manager()
  505.         {
  506.  
  507.             this.atn = new Attendance(SalarayCounter.NoofWorkingDays,(30*8),5,5);
  508.             this.sal = new Salary(35000,400000);
  509.             this.all = new Allowances(15000,18000,25000);
  510.             this.ds = new Designations("Manager", 1);
  511.             this.emp = new Employee(atn,sal,all,"Rahul Mishra",22,142218,ds);
  512.  
  513.             //Console.WriteLine("Value inserted for Manger Cosntructor");
  514.         }
  515.  
  516.         public void ShowPaySlip()
  517.         {
  518.             Console.WriteLine();
  519.  
  520.             String[,] paySlip1 = new String[4, 4];
  521.  
  522.             paySlip1[0, 1] = "                                                  PAYSLIP";
  523.             paySlip1[1, 0] = " Employee Designation :        ";
  524.             paySlip1[2, 0] = " Employee ID :                 ";
  525.             paySlip1[3, 0] = " Employee Name :               ";
  526.  
  527.  
  528.             paySlip1[1, 1] = emp.empDes.Designation;
  529.             paySlip1[2, 1] = Convert.ToString(emp.emp_id);
  530.             paySlip1[3, 1] = Convert.ToString(emp.name);
  531.  
  532.  
  533.  
  534.  
  535.  
  536.             for (int i = 0; i <= 3; i++)
  537.             {
  538.                 for (int j = 0; j <= 3; j++)
  539.                 {
  540.                     Console.Write(paySlip1[i, j]);
  541.                 }
  542.                 Console.WriteLine();
  543.             }
  544.  
  545.  
  546.  
  547.             Console.WriteLine("-------------------------------------------------------------------------------------------------------------------------");
  548.  
  549.  
  550.             String[,] paySlip = new String[6,6];
  551.  
  552.             paySlip[0, 0] = "EARNINGS                          ";
  553.             paySlip[0, 1] = "AMOUNT                 ";
  554.             paySlip[0, 2] = "DEUCTIONS                         ";
  555.             paySlip[0, 3] = "AMOUNT                            ";
  556.  
  557.             paySlip[1, 0] = "Basic Salary                       ";
  558.             paySlip[2, 0] = "House Loan Allowance               ";
  559.             paySlip[3, 0] = "Car Loan Allowance                 ";
  560.             paySlip[4, 0] = "Basic Rent Allowance               ";
  561.             paySlip[5, 0] = "Total Earnings :                   ";
  562.  
  563.  
  564.             int total1 = (emp.emp_Salary.BaseSalary + emp.emp_Allowances.HouseLoanAllowance + emp.emp_Allowances.CarLoanAllowance + emp.emp_Allowances.BasicRentAllowance);
  565.             paySlip[1, 1] = Convert.ToString(emp.emp_Salary.BaseSalary);
  566.             paySlip[2, 1] = Convert.ToString(emp.emp_Allowances.HouseLoanAllowance);    
  567.             paySlip[3, 1] = Convert.ToString(emp.emp_Allowances.CarLoanAllowance);
  568.             paySlip[4, 1] = Convert.ToString(emp.emp_Allowances.BasicRentAllowance);
  569.             paySlip[5, 1] = Convert.ToString((total1));
  570.  
  571.             // row change , col same
  572.             paySlip[1,2] = "            Salary Deduction                       ";
  573.  
  574.             paySlip[5, 2] = "            Total Deduction  :                     ";
  575.  
  576.  
  577.             all.Deduct_Salary(emp);
  578.             int total2 = all.AmountDeductedFromSalary;
  579.             paySlip[1, 3] = Convert.ToString(all.AmountDeductedFromSalary);
  580.             paySlip[5, 3] = Convert.ToString(total2);
  581.  
  582.             for (int i = 0; i < 6; i++)
  583.             {
  584.                 for(int j = 0; j < 6; j++)
  585.                 {
  586.                     Console.Write(paySlip[i, j]);
  587.                 }
  588.                 Console.WriteLine();
  589.             }
  590.  
  591.             Console.WriteLine();
  592.  
  593.             Console.WriteLine("-------------------------------------------------------------------------------------------------------------------------");
  594.             Console.WriteLine("                                        Net Payable Amount :    " + (total1 - total2));
  595.             Console.WriteLine("-------------------------------------------------------------------------------------------------------------------------");
  596.  
  597.  
  598.             return;
  599.         }
  600.     }
  601.     class program
  602.     {
  603.         public static void Main()
  604.         {
  605.             Manager mp = new Manager();
  606.             //mp.ShowPaySlip();
  607.             //.Increment_Allow_By_Designation(mp.emp);
  608.             //mp.Increment_Base_By_Designation(mp.emp);
  609.             mp.ShowPaySlip();
  610.  
  611.         }
  612.     }
  613. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement