Beispiel #1
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;
        }
Beispiel #2
0
        void SetIsSelected(Guid id, bool value)
        {
            if (value)
            {
                selectedBrands[id] = value;

                for (int m = -12; m <= 0; m++)
                {
                    Sale newSale = new Sale();

                    newSale.IDBrandAxe = id;
                    newSale.IDCustomer = customerStore.ID;
                    if (benchmarkCustomer != null)
                        newSale.IDCustomer_Benchmark = benchmarkCustomer.ID;
                    newSale.Date = DateTime.Now.AddMonths(m);

                    retailSalesToAdd.Add(newSale);
                }
            }
            else
            {
                selectedBrands.Remove(id);
                retailSalesToAdd.RemoveAll(s => s.IDBrandAxe == id);
            }

            grdRetailSales.RefreshData();
        }