示例#1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            if (txtQuantity.Text.All(Char.IsDigit) && (!(String.IsNullOrWhiteSpace(txtQuantity.Text))))
            {
                GeneralMethods.UpdatePurchaseOrderTransactionQuantity(ID, Convert.ToInt32(txtQuantity.Text));
                MessageBox.Show("Successfully updated!", "Success");

                this.Close();
            }

            else if (!(txtQuantity.Text.All(Char.IsDigit)))
            {
                MessageBox.Show("Quantity must only contain numbers!", "Error");
            }

            else
            {
                MessageBox.Show("Field cannot be left empty!");
            }
        }