Пример #1
0
 private void btn_AddTempProduct_Click(object sender, RoutedEventArgs e)
 {
     if (decimal.TryParse(textbox_Price.Text, out price) && price > 0 && textbox_Description != null)
     {
         string description = textbox_Description.Text;
         price = decimal.Parse(textbox_Price.Text);
         int         amount  = int.Parse(textBox_ProductAmount.Text);
         TempProduct NewTemp = _storageController.CreateTempTempProduct(description, price, _tempID);
         _storageController.TempTempProductList.Add(NewTemp);
         _posController.AddSaleTransaction(NewTemp, amount);
         UpdateReceiptEventHandler?.Invoke(this, null);
         this.Close();
     }
     else
     {
         textbox_Description.BorderBrush = Brushes.Red;
         textbox_Price.BorderBrush       = Brushes.Red;
     }
 }