Esempio n. 1
0
        static void Main()
        {
            Random rnd = new Random();
            List<DayInfo> lDayInfo = new List<DayInfo>() 
            { 
                new DayInfo() { date = new DateTime(2001,1,1), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,2), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,3), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,4), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,5), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,6), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,7), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,8), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,9), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,10), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,11), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,12), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,13), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,14), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,15), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,16), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,17), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,18), SaleSum = rnd.Next(100,250000) },
                new DayInfo() { date = new DateTime(2001,1,19), SaleSum = rnd.Next(100,250000) }
            
            };

            //IPaymantType context = new StandartPayroll();

            ConditionPaymantType cpt = new ConditionPaymantType(new FixedPaymantType(300));

            cpt
                .If(a => a.SaleSum > 500000, new PercentPaymantType(20))
                .If(a => a.SaleSum > 100000, new PercentPaymantType(15))
                .If(a => a.SaleSum > 50000, new PercentPaymantType(10))
                .If(a => a.SaleSum > 10000, new PercentPaymantType(5));

            Payroll.Payroll p = new Payroll.Payroll(cpt);
            Console.WriteLine("{0}:\t {1}", p.Type, p.MonthCalculation(lDayInfo,new DateTime(2001,1,1)));
            //context = new HardMonthPayroll();
            //p.Type = context;
            //Console.WriteLine("{0}:\t {1}", p.Type, p.MonthCalculation(lDayInfo, new DateTime(2001, 1, 1)));

            


            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            //Payroll value = Payroll.Salaried;
            Payroll  value     = Payroll.Hourly;
            Employee employee  = new Employee();
            Employee employee1 = new Employee();

            employee.Name      = "Minty";
            employee1.Name     = "Molly";
            employee.Hours     = 10;
            employee.HourlyPay = 25;

            if (value == Payroll.Hourly)
            {
                Console.WriteLine("Information: {0} worked {1} hours at an hourly rate of ${2}", employee.Name, employee.Hours, employee.HourlyPay);
                CalcPay(employee.Hours, employee.HourlyPay);
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("Information: {0} worked as salaried and earned a total of ${1}", employee1.Name, employee.PaySalary);
                Console.ReadLine();
            }
        }
Esempio n. 3
0
 public Department()
 {
     InitializeComponent();
     dbcon   = new db();
     payroll = new Payroll();
 }
Esempio n. 4
0
 public Leave()
 {
     InitializeComponent();
     dbcon   = new db();
     payroll = new Payroll();
 }
Esempio n. 5
0
 public Holiday()
 {
     InitializeComponent();
     dbcon   = new db();
     payroll = new Payroll();
 }
Esempio n. 6
0
 public Jobtitle()
 {
     InitializeComponent();
     dbcon   = new db();
     payroll = new Payroll();
 }