Esempio n. 1
0
 private void addItem(SimplePOS.Article.AbstractArticle article, double quantity)
 {
     foreach (InvoiceItem item in items)
     {
         if (item.Article.Number == article.Number)
         {
             item.Quantity++;
             return; // exit der Funktion
         }
     }
     items.Add(new InvoiceItem(article, quantity));
 }
Esempio n. 2
0
        /// <summary>
        /// adds a item to the invoice
        /// </summary>
        /// <param name="article"></param>
        public void addItem(SimplePOS.Article.AbstractArticle article)
        {
            switch (SimplePOS.Article.ArtikelProcessor.convertToType(article.Number))
            {
            case SimplePOS.Article.AbstractArticle.ArticleType.ARTICLE:
                addItem(article, 1);
                return;

            case SimplePOS.Article.AbstractArticle.ArticleType.DISCOUNT:
                addDiscount(article);
                return;
            }
        }
Esempio n. 3
0
 private void addDiscount(SimplePOS.Article.AbstractArticle article)
 {
     foreach (InvoiceItem item in items)
     {
         if (SimplePOS.Article.Discount.isDiscountTag(item.Article.Number))
         {
             ((SimplePOS.Article.Discount)item.Article).RawValue +=
                 ((SimplePOS.Article.Discount)article).RawValue;
             return; // exit der Funktion
         }
     }
     items.Add(new InvoiceItem(article, 1));
 }
Esempio n. 4
0
        private void saveItemFromForm()
        {
            string number = textBox1.Text;

            SimplePOS.Article.AbstractArticle article = db.GetArticleByNumber(number);
            if (article == null)
            {
                // Artikel nicht vorhanden
                SimplePOS.Article.ArticleView window = new
                                                       SimplePOS.Article.ArticleView(db,
                                                                                     new SimplePOS.Article.RegularArticle(number));
                window.Owner = this;
                window.ShowDialog();
                article = db.GetArticleByNumber(number);
                // wenn nichts gültiges eingegeben wird --> beenden
                if (article == null)
                {
                    return;
                }
            }


            double quantity = 0;

            try { quantity = Double.Parse(textBox2.Text); }
            catch
            {
                MessageBox.Show("Bitte Menge eingeben.", "", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }
            SaveableStockItem item = new SaveableStockItem(number, quantity);

            if (singleShow)
            {
                curr_quantity += item.Quantity;
                item.Quantity  = curr_quantity;
                db.SetItemToStock(item);
            }
            else
            {
                db.AddItemToStock(item);
            }
            stop_stocking = false;
        }
Esempio n. 5
0
 public InvoiceItem(SimplePOS.Article.AbstractArticle article, double quantity)
 {
     this.article  = article;
     this.quantity = quantity;
 }
Esempio n. 6
0
 public InvoiceItem(SimplePOS.Article.AbstractArticle article, double quantity)
 {
     this.article = article;
     this.quantity = quantity;
 }