Beispiel #1
0
        private void item_Select(object sender, EventArgs e)
        {
            if (sbxItem.ItemID > 0)
            {
                int BranchID = (int)cbxBranch.SelectedValue;
                Class.StockCalculations StockCalculations = new Cognitivo.Class.StockCalculations();
                Settings      SalesSettings = new Settings();
                sales_invoice sales_invoice = sales_invoiceViewSource.View.CurrentItem as sales_invoice;
                item          item          = SalesInvoiceDB.items.Where(x => x.id_item == sbxItem.ItemID).FirstOrDefault();


                sales_invoice_detail _sales_invoice_detail = SalesInvoiceDB.Select_Item(ref sales_invoice, item, SalesSettings.AllowDuplicateItem);

                _sales_invoice_detail.Quantity_InStock = StockCalculations.Count_ByBranch(BranchID, item.id_item, DateTime.Now);


                sales_invoicesales_invoice_detailViewSource.View.Refresh();
                sales_invoice.RaisePropertyChanged("GrandTotal");
            }
        }
Beispiel #2
0
        private void sbxItem_Select(object sender, RoutedEventArgs e)
        {
            if (sbxItem.ItemID > 0)
            {
                sales_invoice sales_invoice = sales_invoiceViewSource.View.CurrentItem as sales_invoice;

                item item = SalesInvoiceDB.items.Where(x => x.id_item == sbxItem.ItemID).FirstOrDefault();

                sales_invoice_detail _sales_invoice_detail = SalesInvoiceDB.Select_Item(ref sales_invoice, item, false);

                Class.StockCalculations StockCalculations = new Cognitivo.Class.StockCalculations();
                _sales_invoice_detail.Quantity_InStock = StockCalculations.Count_ByBranch(CurrentSession.Id_Branch, item.id_item, DateTime.Now);

                CollectionViewSource sales_invoicesales_invoice_detailViewSource = FindResource("sales_invoicesales_invoice_detailViewSource") as CollectionViewSource;
                sales_invoicesales_invoice_detailViewSource.View.Refresh();

                sales_invoiceViewSource.View.Refresh();
                paymentViewSource.View.Refresh();
                btnPromotion_Click(sender, e);
            }
        }