Ejemplo n.º 1
0
 public PendingOrderFile(string key, string custFullName, DateTime orderDate, PendingOrderSaveLocation saveLocation)
 {
     _fileKey = key;
     _fullName = custFullName;
     _orderDate = orderDate;
     _saveLocation = saveLocation;
 }
Ejemplo n.º 2
0
        private void LoadCustomerOrderObj(CustomerOrderObject coo)
        {
            _saveLocation = coo.SaveLocation;
            _fileKey = coo.FileKey;

            txtNotes.Text = coo.Order.Notes;
            dtOrderDate.Value = coo.Order.OrderDate;
            ucCustomerInfo1.SetCustomerInfo(coo.Customer);
            ucBillingAddress.SetAddress(coo.Customer.BillingAddress);
            ucShippingAddress.SetAddress(coo.Customer.ShippingAddress);
            ucCC1.SetCreditCard(coo.Customer.CreditCards[0]);
            ucCC2.SetCreditCard(coo.Customer.CreditCards[1]);
            ucCC3.SetCreditCard(coo.Customer.CreditCards[2]);
            SetVehicleInfo(coo.Vehicle);
            SetPaymentMethod(coo.Order.PaymentMethod);
            ClearOrderDetails();
            foreach (var item in coo.Order.OrderItems)
            {
                var ucLi = ObjectFactory.GetInstance<ucLineItem>();
                ucLi.LoadOrderItems(_orderItems);

                flpMain.Controls.Add(ucLi);
                ucLi.SetOrderItem(item);
                ucLi.DeleteItem += new Action<ucLineItem>(li_DeleteItem);
                ucLi.TotalOrTaxableChanged += new Action(li_TotalChanged);
                ucLi.InsertItem += new Action<ucLineItem>(InsertItem);
            }
            flpMain.Controls.Add(btnAddItem);
            RecalculateTotals();
        }
Ejemplo n.º 3
0
        private void GetCustomerOrderAndSaveFile(PendingOrderSaveLocation saveLocation)
        {
            if (string.IsNullOrEmpty(ucCustomerInfo1.FullName))
            {
                MessageBox.Show("Enter a name before saving.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            var coo = GetCustomerOrderObj();
            coo.SaveLocation = saveLocation;
            if (_fileKey != "")
                coo.FileKey = _fileKey;

            _fsRepo.SavePendingOrder(coo);
            MessageBox.Show(
                string.Format("{0} - order successfully saved to disk.", coo.Customer.FullName),
                "Save", MessageBoxButtons.OK, MessageBoxIcon.Information);

            if (RefreshSpecifiedPanel != null)
                RefreshSpecifiedPanel(saveLocation);

            this.Close();
        }
Ejemplo n.º 4
0
 List<PendingOrderFile> SearchFiles(DateTime pendingSince, PendingOrderSaveLocation loc)
 {
     return (from f in _fileSet.Values
             where f.SaveLocation == loc
             && f.OrderDate >= pendingSince
             select f).ToList();
 }
Ejemplo n.º 5
0
 void RefreshSpecifiedPanel(PendingOrderSaveLocation obj)
 {
     //currently refreshing all panels;  this could be refactored for performance
     RefreshPanels();
 }