예제 #1
0
        public void InitDataContext()
        {
            Block = new Models.Block();
            CurrentBlock.DataContext = Block;

            BlockSumms = new BlockSumms();
            CurrentBlockSummary.DataContext = BlockSumms;
        }
예제 #2
0
        /// <summary>
        /// A végösszeg és az össesített adó kiszámítása
        /// </summary>
        private void RecalculateSumms()
        {
            var tmpBlockSumm = new BlockSumms();

            foreach (var item in Block.BlockItems)
            {
                tmpBlockSumm.SumPrice += (int)(item.Volume * item.Product.Prices.Last().price);
                tmpBlockSumm.SumTax   += (int)(item.Volume * item.Product.Prices.Last().price *(item.Product.Prices.Last().taxrate / 100));
            }
            BlockSumms = tmpBlockSumm;
            CurrentBlockSummary.DataContext = null;
            CurrentBlockSummary.DataContext = BlockSumms;
        }