public TheRuleList(Employee employee) : base("TheRuleList", employee) { r1 = new Rule1(employee); r2 = new Rule2(employee); r3 = new Rule3(employee); r2_1 = new Rule2_1(employee); r2_2 = new Rule2_2(employee); r2_2_1 = new Rule2_2_1(employee); r2_2_2 = new Rule2_2_2(employee); r3_1 = new Rule3_1(employee); r3_2 = new Rule3_2(employee); r_isSalary1 = new RuleIsSalary(employee); r_isSalary2 = new RuleIsSalary(employee); rt = new RuleTerminator(employee); r1.RegisterRules(rt, r2); r2.RegisterRules(r_isSalary1, r3); r3.RegisterRules(r_isSalary2, rt); r_isSalary1.RegisterRules(r2_2, r2_1); r_isSalary2.RegisterRules(r3_2, r3_1); r2_2.RegisterRules(r2_2_1, r2_2_2); r2_1.RegisterRules(rt, rt); r2_2_1.RegisterRules(rt, rt); r2_2_2.RegisterRules(rt, rt); r3_1.RegisterRules(rt, rt); r3_2.RegisterRules(rt, rt); }
public void _calcOT(string Name, EmployeeType empType, double HoursWorked, double ExpectedOT) { Employee emp = new Employee(Name, empType, HoursWorked); TheRuleList trl = new TheRuleList(emp); trl.Invoke(); Console.WriteLine("Name: {0}\tEmployeeType: {1}\tHoursWorked: {2}\tOverTime: {3}\tExpected OverTime: {4}" , Name, empType.ToString(), HoursWorked.ToString(), emp.OverTimeHours.ToString(), ExpectedOT.ToString()); }
public RuleTerminator(Employee employee) : base("RuleTerminator", employee) {}
public Rule3_2(Employee employee) : base("Rule3_2", employee) {}
public Rule3_1(Employee employee) : base("Rule3_1", employee) {}
public RuleIsSalary(Employee employee) : base("IsSalary", employee) {}
public Rule3(Employee employee) : base("Rule3", employee) {}
public BaseBizRule(string Name, Employee employee) : base(Name) { this.employee = employee; }