コード例 #1
0
        public void UpdateWeightLabel(Invoice invoiceSelected)
        {
            InvoiceSQLite        invoiceSQLite = App.InvoiceDatabase.GetInvoiceByInvoiceID(invoiceSelected.InvoiceID);
            List <InvoiceSQLite> temp          = new List <InvoiceSQLite>();

            temp.Add(invoiceSQLite);

            double invoiceWeight = StockManager.CalculateStockWeight(StockManager.GetStock(temp));

            if (invoiceSQLite.InvoiceType == "ACCREC")
            {
                _currentWeight -= invoiceWeight;
            }
            else
            {
                _currentWeight += invoiceWeight;
            }
            TotalWeightLabel.Text = $"{(_currentWeight):F2} Kg";
        }