예제 #1
0
        public void SetUp()
        {
            MyBasket=new Basket();
             toShoping = new Products();

             testShop = new Shop();
             testShop.NameShop = "mój sklep spożywczy";
             Article testArticle1 = new Article() {
                                                     GraphElem = null,
                                                     ImagePath = "c:\\ggg.png",
                                                     Name = "maslo",
                                                     Price = 23.2M,
                                                     Quantity = 23.6,
                                                     IsForShooping = true,
                                                 };
            Article testArticle2 = new Article() {
                                                     GraphElem = null,
                                                     ImagePath = "c:\\ggg.png",
                                                     Name = "mleko",
                                                     Price = 0M,
                                                     Quantity = 23.6,
                                                     IsForShooping = false,
                                                 };
            Article testArticle3 = new Article() {
                                                     GraphElem = null,
                                                     ImagePath = "c:\\ggg.png",
                                                     Name = "cukier",
                                                     Price = 15.2m,
                                                     Quantity = 100.1,
                                                     IsForShooping = true,
                                                 };
            toShoping.AddArticle(testArticle1);
            toShoping.AddArticle(testArticle2);
            toShoping.AddArticle(testArticle3);

             MyClient=new Client(){Cash = 50m,Name = "klient",ToShoping = toShoping};
             ArticlesRepository myArticlesRepository = new ArticlesRepository();
             testShop.AllArticles = myArticlesRepository.GenerSomeOfProducts("images/");
             myDoShoping = new DoShoping(MyClient, MyBasket);
        }
예제 #2
0
 public Transaction(Client client, Basket basket)
 {
     this.MyClient = client;
     this.MyBasket = basket;
 }
예제 #3
0
        private void SetClient()
        {
            //  Products toShoping = startWindow.GetProductsForShoping;
            ObservableCollection<Article> toShoping = startWindow.GetProducts.GetShopingProducts();
            //client = new Client() {
            //                          GraphElem = clientRect,
            //                          Name = "sluchacz1",
            //                          ToShoping = toShoping,
            //                          Cash = 100.00M,
            //                          IsCalculate = true,
            //                          IsShowList = true,};

            client = startWindow.DataRepoAll.Clients[0];
            client.GraphElem = clientRect;
            // cashBinding = new Binding();
            // cashBinding.Source = client;
            //decimal ff = 23.23M;
            // ClientCash.DataContext = client;
            ClientCash.DataContext = client;

            clientX = Canvas.GetLeft(client.GraphElem);
            clientY = Canvas.GetTop(client.GraphElem);
            clientRect.RenderTransform = transform;
            ClientName.Content = client.Name;
            ArticleShoping.ItemsSource = toShoping;
        }