Exemplo n.º 1
0
        public AddSales(Customer customer)
        {
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this) == false)
            {
                grdBrandAxes.BeginDataUpdate();
                grdBrandAxes.ClearSorting();
                grdBrandAxes.SortInfo.Add(new GridSortInfo("Signature.Name"));
                grdBrandAxes.SortInfo.Add(new GridSortInfo("FullName"));
                grdBrandAxes.EndDataUpdate();

                // Data for BrandAxes
                BrandAxeData = new ObservableCollection<BrandAxe>(BrandAxeManager.Instance.GetAll());
                DataContext = BrandAxeData;

                // Data for RetailSales to add
                grdRetailSales.DataSource = retailSalesToAdd;

                // Data for Benchmark Customer Store
                customerStore = customer;
                cboBenchmarkStore.ItemsSource = CustomerManager.Instance.GetAll().Where(c => c.ID != customerStore.ID).OrderBy(c => c.AccountNumber);

                txtStoreCode.Text = customerStore.AccountNumber;
                txtStoreName.Text = customerStore.Name;
            }
        }
Exemplo n.º 2
0
        private void cboBenchmarkStore_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            benchmarkCustomer = cboBenchmarkStore.SelectedItem as Customer;

            selectedBrands.Clear();
            grdBrandAxes.RefreshData();

            retailSalesToAdd.Clear();
            grdRetailSales.RefreshData();
        }
Exemplo n.º 3
0
        public ReplaceAccountNumber(Customer customer)
        {
            InitializeComponent();

            dummyCustomer = customer;

            txtAccountNumber.Text = dummyCustomer.AccountNumber;
            txtName.Text = dummyCustomer.Name;

            this.DataContext = CustomerManager.Instance.GetAll().Where(c=>c.Manual == false);
          
        }
Exemplo n.º 4
0
        private void btnReplace_Click(object sender, RoutedEventArgs e)
        {
            if (SAPCustomer == null)
            {
               // MessageBox.Show("Select a store to replace from");
                MessageBox.Show(SystemMessagesManager.Instance.GetMessage("ReplaceAccounNumberSelectStore"));
                return;
            }

            try
            {
                dummyCustomer.Name = SAPCustomer.Name;
                dummyCustomer.AccountNumber = SAPCustomer.AccountNumber;
                dummyCustomer.Manual = false;

                dummyCustomer.CleanEntityRef("IDCustomerGroup");
                dummyCustomer.CustomerGroup = SAPCustomer.CustomerGroup;

                dummyCustomer.CleanEntityRef("IDSalesArea_AllocationSalesArea");
                dummyCustomer.SalesArea = SAPCustomer.SalesArea;

                dummyCustomer.CleanEntityRef("IDSalesEmployee");
                dummyCustomer.SalesEmployee = SAPCustomer.SalesEmployee;

                // insert & delete
                CustomerManager manager = CustomerManager.Instance;

                // insert
                manager.InsertOrUpdate(dummyCustomer);

                // delete
                removedSAPCustomer = SAPCustomer;
                SAPCustomer.Deleted = true;
                manager.Delete(SAPCustomer);

                //MessageBox.Show("Successfully replaced the dummy store with a SAP store", "Replace Account");
                MessageBox.Show(SystemMessagesManager.Instance.GetMessage("ReplaceAccountNumberReplaced"), "Replace Account");

                btnClose.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
            }
            catch (Exception exc)
            {
                removedSAPCustomer = null;
                //MessageBox.Show("An error occured when replacing the dummy store with a SAP store: " + LorealOptimiseShared.Utility.GetExceptionsMessages(exc));
                MessageBox.Show(SystemMessagesManager.Instance.GetMessage("ReplaceAccountNumberException", LorealOptimiseShared.Utility.GetExceptionsMessages(exc)));
            }
        }
Exemplo n.º 5
0
        protected Sale CreateSale(Customer customer, BrandAxe brandAxe, decimal manualValue)
        {
            Sale sale = new Sale();
            sale.ID = Guid.NewGuid();
            sale.Customer = customer;
            sale.BrandAxe = brandAxe;
            sale.ManualValue = manualValue;
            sale.Date = DateTime.Now.AddDays(-7);

            return sale;
        }
Exemplo n.º 6
0
        protected CustomerCapacity CreateCustomerCapacity(Customer customer, AnimationType animationType, Priority priority, ItemType itemType, int capacity)
        {
            CustomerCapacity cusCapacity = new CustomerCapacity();
            cusCapacity.ID = Guid.NewGuid();
            cusCapacity.Customer = customer;
            cusCapacity.AnimationType = animationType;
            cusCapacity.Priority = priority;
            cusCapacity.ItemType = itemType;
            cusCapacity.Capacity = capacity;

            return cusCapacity;
        }
Exemplo n.º 7
0
        protected CustomerAllocation CreateCustomerAllocation(Customer customer, AnimationProductDetail animationProductDetail)
        {
            CustomerAllocation customerAllocation = new CustomerAllocation();
            customerAllocation.ID = Guid.NewGuid();
            customerAllocation.Customer = customer;
            customerAllocation.AnimationProductDetail = animationProductDetail;            

            return customerAllocation;
        }
Exemplo n.º 8
0
        protected Customer CreateCustomer(CustomerGroup customerGroup, string name, string code, SalesEmployee employee, Division division)
        {
            Customer customer = new Customer();
            customer.ID = Guid.NewGuid();
            customer.SalesEmployee = employee;
            customer.CustomerGroup = customerGroup;
            customer.AccountNumber = code;
            customer.Name = name;
            customer.IncludeInSystem = true;
            customer.Manual = false;

            return customer;
        }
Exemplo n.º 9
0
        protected CustomerGroupItemType CreateCustomerGroupItemType(CustomerGroup group, ItemType itemType, Customer customer)
        {
            CustomerGroupItemType customerGroupItemType = new CustomerGroupItemType();
            customerGroupItemType.ID = Guid.NewGuid();
            customerGroupItemType.CustomerGroup = group;
            customerGroupItemType.ItemType = itemType;
            customerGroupItemType.IDCustomer = customer.ID;
            customerGroupItemType.IncludeInSAPOrders = true;
            customerGroupItemType.WarehouseAllocation = true;

            return customerGroupItemType;
        }
Exemplo n.º 10
0
        protected CustomerBrandExclusion CreateCustomerBrandExclusion(Customer customer, BrandAxe brand)
        {
            CustomerBrandExclusion cbe = new CustomerBrandExclusion();
            cbe.ID = Guid.NewGuid();
            cbe.Customer = customer;
            cbe.BrandAxe = brand;
            cbe.Excluded = true;

            return cbe;
        }
Exemplo n.º 11
0
        protected CustomerCategory CreateCustomerCategory(Customer customer, Category category)
        {
            CustomerCategory cuCa = new CustomerCategory();
            cuCa.ID = Guid.NewGuid();
            cuCa.Customer = customer;
            cuCa.Category = category;

            return cuCa;
        }
Exemplo n.º 12
0
 private void RadioButton_Click(object sender, RoutedEventArgs e)
 {
     if (grdCustomers.View.FocusedRow != null)
     {
         SAPCustomer = grdCustomers.GetFocusedRow() as Customer;
     }
 }