Пример #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 void SetUp()
        {
            testProducts = new Products();

            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,
                                                 };
            testProducts.AddArticle(testArticle1);
            testProducts.AddArticle(testArticle2);
            testProducts.AddArticle(testArticle3);
            myBasket = new Basket();
        }
Пример #3
0
 public Transaction(Client client, Basket basket)
 {
     this.MyClient = client;
     this.MyBasket = basket;
 }
Пример #4
0
        // private ArticlesRepository myArticlesRepository;
        public MainWindow(StarWindow window)
        {
            InitializeComponent();
            // nie lubie definiowac funkcji obslugi zdarzen w xamlu.
            // this.MouseLeftButtonDown += WindowMouseLeftButtonDown;
            //  this.MouseLeftButtonUp += WindowMouseLeftButtonUp;
            //  this.MouseMove += WindowMouseMove;
            startWindow = window;
            //myArticlesRepository=new ArticlesRepository();
            double topCorner = 0;
            double leftCorner = 0;

            KeyDown += WindowKeyDown;

            //SetProductLayout(topCorner);
            SetArticlesLayout(topCorner);
            SetClient();
            myBasket = new Basket();
            BasketShoping.ItemsSource = myBasket.JustShoped;
            if (!client.IsCalculate) SumCoast.Visibility = Visibility.Collapsed;
            if (!client.IsShowList) ArticleShoping.Visibility = Visibility.Collapsed;
        }