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(); }
public void CheckSumm(float summ, IEmployee employee) { if (summ <= _maxSumm) { SetSignature(employee); } else { if (_nextSignatureUser != null) { _nextSignatureUser.CheckSumm(summ, employee); } else { DeclineSignature(employee); } } }