Ejemplo n.º 1
0
        public string CreateSale(PriceRate discount)
        {
            if (_vehicle == null || _compatibleAddons == null || _selectedAddons == null)
            {
                return("Missing key sales details");
            }

            OrderBuilder oBuild = new OrderBuilder();

            oBuild.Add(_vehicle, VehicleType.New);
            oBuild.Add(_tradeIn, VehicleType.Trade);
            oBuild.SetDiscount(discount);
            oBuild.Add(_selectedAddons, _compatibleAddons);
            Order orders = oBuild.Prepare();

            InvoiceBuilder iBuild = new InvoiceBuilder();

            iBuild.Staff = _saleRep;
            iBuild.Order = orders;
            _sInvoice    = iBuild.Prepare() as Sale;

            return(_manager["Invoice"].Add(_sInvoice));
        }