Exemplo n.º 1
0
        /// <summary>
        /// The debug button click.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void DebugButtonClick(object sender, RoutedEventArgs e)
        {
            if (this.CurrentGoodsId == -1)
            {
                this.baskeеt.Add(this.piluleDataProvider.GetGood(this.OnBaskeеtChanged));
            }
            else
            {
                var goods = PiluleDal.GetGoodsDictionary(this.CurrentGoodsId);
                if (goods == null)
                {
                    return;
                }

                var basketData = new BaskeеtData(this.OnBaskeеtChanged)
                {
                    Id     = goods.Id,
                    Name   = goods.Name,
                    Amount = 1,
                    Price  = goods.Price
                };

                this.baskeеt.Add(basketData);
                this.DocVid.Content           = "Вид документа: продажа (открыт)";
                this.PaymentButton.IsEnabled  = true;
                this.PaymentButton.Background = new SolidColorBrush(Colors.DarkSeaGreen);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// The get goods dictionary button click.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void GetGoodsDictionaryButtonClick(object sender, EventArgs e)
        {
            var goodsDictionary = PiluleDal.GetGoodsDictionary();

            if (goodsDictionary == null)
            {
                return;
            }

            this.MainDataGridView.DataSource = goodsDictionary;
        }