コード例 #1
0
        private void Remove_cupiesBtr(object sender, RoutedEventArgs e)
        {
            if (Checks.isTextInt(AmountTxt.Text))// check the input
            {
                //here we check if the amount that we want to remove is more then the items in stock.
                // we cant remove cupies that not existent
                try
                {
                    item.ReduceCopies(int.Parse(AmountTxt.Text));
                    AmountTxt.Text = "";
                    System.Windows.Forms.MessageBox.Show("Stock Reduce!", "Sucess");
                }
                catch (Exception z)
                {
                    System.Windows.Forms.MessageBox.Show(z.Message, "Error");
                }
            }

            else
            {
                System.Windows.Forms.MessageBox.Show("Number Is not Valid!!", "Eroor");
                AmountTxt.Text = "";
            }
        }