示例#1
0
        static void Main(string[] args)
        {
            SignatureUser chainOfSignature = SetChainOfSignature();
            Employee      employee         = new Employee("Vladimir");
            float         testSumm         = 0;
            string        testString       = string.Empty;

            do
            {
                Console.WriteLine($"What summ {employee.Name} wants?");
                testString = Console.ReadLine();
            }while (!float.TryParse(testString, out testSumm));
            chainOfSignature.CheckSumm(testSumm, employee);
            Console.ReadLine();
        }
示例#2
0
 public void CheckSumm(float summ, IEmployee employee)
 {
     if (summ <= _maxSumm)
     {
         SetSignature(employee);
     }
     else
     {
         if (_nextSignatureUser != null)
         {
             _nextSignatureUser.CheckSumm(summ, employee);
         }
         else
         {
             DeclineSignature(employee);
         }
     }
 }