Exemple #1
0
        static void Main(string[] args)
        {
            ApplyContext context = new ApplyContext()
            {
                Hour = 10
            };

            PM pm = new PM()
            {
                Name = "PM"
            };
            AbstractAuditor ceo = new CEO()
            {
                Name = "ceo"
            };

            pm.SetNext(ceo);

            pm.Audit(context);

            if (context.AuditResult)
            {
                Console.WriteLine(context.AuditRemark);
            }
            Console.ReadKey();
        }
Exemple #2
0
 public void AuditNext(ApplyContext context)
 {
     if (this._Auditor == null)
     {
         return;
     }
     this._Auditor.Audit(context);
 }
Exemple #3
0
 public override void Audit(ApplyContext context)
 {
     if (context.Hour < 9)
     {
         context.AuditResult = true;
         context.AuditRemark = "PM 同意请假";
     }
     else
     {
         base.AuditNext(context);
     }
 }
Exemple #4
0
 public abstract void Audit(ApplyContext context);