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;; } }
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; ; } }
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(); } }
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(); } }