Пример #1
0
 public Sell()
 {
     InitializeComponent();
     window = new ArticleChoice();
     window.btnAdd.Click      += new RoutedEventHandler(dgCurrSell_DataBind);
     dgCurrentSell.ItemsSource = new List <Goods>();
     this.DateTextBox.Text     = DateTime.Now.ToShortDateString();
     if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
     {
         this.Width  = double.NaN;;
         this.Height = double.NaN;;
     }
 }
Пример #2
0
        public Sell()
        {
            InitializeComponent();
            window = new ArticleChoice();
            window.btnAdd.Click += new RoutedEventHandler(dgCurrSell_DataBind);
            dgCurrentSell.ItemsSource = new List<Goods>();
            this.DateTextBox.Text = DateTime.Now.ToShortDateString();
            if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
            {
                this.Width = double.NaN; ;
                this.Height = double.NaN; ;
            }



        }
Пример #3
0
        private void OnAddButtonClick(object sender, RoutedEventArgs e)
        {
            if (rbStock.IsChecked.GetValueOrDefault())
            {
                ComboBoxItem cbItem = (ComboBoxItem)cbMeasurement.SelectedItem;

                Goods item = new Goods(int.Parse(tbID.Text.Trim()), tbCategory.Text, tbName.Text.Trim(),
                                       decimal.Parse(tbSellPrice.Text.Trim()), decimal.Parse(tbDiscount.Text.Trim()), decimal.Parse(tbValue.Text.Trim()),
                                       cbItem.Content.ToString().Trim(), 0);

                List <Goods> goods = DataHandler.Instance.LoadGoods().ToList <Goods>();
                goods.Add(item);
                DataHandler.Instance.SaveGoods(goods);
                Window artChoice = new ArticleChoice();
                artChoice.Show();
                this.Close();
            }
        }
Пример #4
0
        private void OnAddButtonClick(object sender, RoutedEventArgs e)
        {
            if (rbStock.IsChecked.GetValueOrDefault())
            {
                ComboBoxItem cbItem = (ComboBoxItem)cbMeasurement.SelectedItem;

                Goods item = new Goods(int.Parse(tbID.Text.Trim()), tbCategory.Text, tbName.Text.Trim(),
                    decimal.Parse(tbSellPrice.Text.Trim()), decimal.Parse(tbDiscount.Text.Trim()), decimal.Parse(tbValue.Text.Trim()),
                    cbItem.Content.ToString().Trim(), 0);

                List<Goods> goods = DataHandler.Instance.LoadGoods().ToList<Goods>();
                goods.Add(item);
                DataHandler.Instance.SaveGoods(goods);
                Window artChoice = new ArticleChoice();
                artChoice.Show();
                this.Close();

            }
        }