public void Start() { var repository = _resolver.Resolve <IProductRepository>(); _outChecker = new OutChecker(repository); _outChecker.Start(); }
public void Start(Action <decimal, decimal> limitExceededAction) { var repository = _resolver.Resolve <IProductRepository>(); _outChecker = new OutChecker(repository); CheckoutLimitExceededDelegate checkoutLimitExceeded = (limit, currentPrice) => { limitExceededAction(limit.Limit, currentPrice); }; _outChecker.CheckoutLimitExceeded += checkoutLimitExceeded; _outChecker.Start(); }
public string GetStringInCaseOfCashLimit(OutChecker _outChecker) { Guard.Operation(_outChecker != null); var remind = CashLimit - GetCurrentBillValue(_outChecker); var retString = "\n"; if (remind <= 0) { retString += "You reach the limit, that is waring, please close the bill... :) \n"; retString += _outChecker.ShowBill().PrintableText + " \n"; } else { retString += string.Format("Reminder rest of cache {0}", remind); } return(retString); }
private decimal GetCurrentBillValue(OutChecker _outChecker) { Guard.Operation(_outChecker != null); return(_outChecker.ShowBill().SumPriceOfBoughtProducts); }