Esempio n. 1
0
        public DailyOrderDto(_1_Domain.Enquiry enquiry)
        {
            EnquiryId       = enquiry.Id;
            CreatedDate     = enquiry.CreatedDate;
            Type            = enquiry.JobType;
            Door            = enquiry.DoorType;
            Colour          = enquiry.DoorColor;
            DuraformParts   = 0;
            JanperEdgeParts = 0;
            RouteOnlyParts  = 0;
            FlatpackParts   = 0;
            CustomerName    = enquiry.Customer.Name;
            OrderReference  = enquiry.CustomerReference;
            HasFixedPrice   = enquiry.HasFixedPrice;
            TotalPrice      = enquiry.TotalPrice ?? -1;

            switch (enquiry)
            {
            case DuraformEnquiry duraform:
                DuraformParts  = duraform.IsRoutingOnly ? 0 : duraform.PartCount;
                RouteOnlyParts = !duraform.IsRoutingOnly ? 0 : duraform.PartCount;
                break;

            default:
                throw new NotImplementedException("Order Type Supported");
            }
        }
Esempio n. 2
0
        public override void AddOrder(Enquiry enquiry)
        {
            if (enquiry.CustomerId != CustomerId)
            {
                throw new Exception("Cannot pick up other customer's order");
            }

            enquiry.ProcessDelivering(this);
        }
Esempio n. 3
0
        public override void AddOrder(Enquiry enquiry)
        {
            if (!enquiry.IsShippingRequired)
            {
                throw new Exception("Order cannot be shipped! Pick up only");
            }

            enquiry.ProcessDelivering(this);
        }
Esempio n. 4
0
        public Invoice(Enquiry enquiry) : this()
        {
            EnquiryId = enquiry.Id;

            CustomerId        = enquiry.Customer.ManagerId ?? enquiry.CustomerId;
            CustomerReference = enquiry.CustomerReference;

            DoorType  = enquiry.DoorType;
            DoorColor = enquiry.DoorColor;

            InvoiceTo       = enquiry.InvoiceTo;
            InvoiceAddress  = enquiry.InvoiceAddress;
            InvoiceSuburb   = enquiry.InvoiceSuburb;
            InvoiceState    = enquiry.InvoiceState;
            InvoicePostcode = enquiry.InvoicePostcode;

            DeliveryTo       = enquiry.DeliveryTo;
            DeliveryAddress  = enquiry.DeliveryAddress;
            DeliverySuburb   = enquiry.DeliverySuburb;
            DeliveryState    = enquiry.DeliveryState;
            DeliveryPostcode = enquiry.DeliveryPostcode;

            HasFixedPrice = enquiry.HasFixedPrice;
            GstRate       = enquiry.GstRate;
            DiscountRate  = enquiry.DiscountRate;
            DeliveryFee   = enquiry.DeliveryFee;
            SubTotal      = enquiry.SubTotal;
            TotalGst      = enquiry.TotalGst;
            TotalPrice    = enquiry.TotalPrice ?? 0;


            foreach (var component in enquiry.GenerateComponentsForInvoice())
            {
                InvoiceComponents.Add(component);
            }
        }
Esempio n. 5
0
 public abstract void AddOrder(Enquiry enquiry);