public PointOfSaleService Build()
        {
            var service = new PointOfSaleService(query, generator);

            service.BarcodeEvent      += display.BarcodeHandler;
            service.CompleteSaleEvent += display.CompleteSaleHandler;
            return(service);
        }
Пример #2
0
        public decimal ShoppingCartTotalTest(string cartItems)
        {
            PointOfSaleService pointOfSaleService = new PointOfSaleService();

            foreach (char c in cartItems)
            {
                pointOfSaleService.Scan(c.ToString());
            }

            return(pointOfSaleService.Total());
        }
Пример #3
0
    public MainWindow(PointOfSaleService service, ReceiptFactory factory)
        : base(Gtk.WindowType.Toplevel)
    {
        Build();
        this.service = service;
        this.factory = factory;
        this.items   = new ListStore(typeof(string), typeof(string), typeof(string));
        this.service.BarcodeEvent      += BarcodeHandler;
        this.service.CompleteSaleEvent += CompleteSaleHandler;

        SetupWidgets();
    }
Пример #4
0
        public StartViewModel(OrderModel orderModel)
        {
            service     = new PointOfSaleService();
            Model       = orderModel;
            DoneCommand = new DelegateCommand(Done, () => !String.IsNullOrWhiteSpace(Name));
            var provider = new LatLongLocationProvider(10000);

            try
            {
                var report = (LatLongLocationReport)provider.GetReport();
                service.ReportLocation(report.Latitude, report.Longitude);
            }
            catch
            {
                service.LocationMalfunction();
            }
        }
Пример #5
0
 public CheckoutViewModel(OrderModel orderModel)
 {
     Model         = orderModel;
     service       = new PointOfSaleService();
     SubmitCommand = new DelegateCommand(Submit);
 }