示例#1
0
        private void TxtQty_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (Convert.ToInt32(txtAvailableQty.Text) >= Convert.ToInt32(TxtQty.Text))
                    {
                        var price   = (txtPrice.Text);
                        var qty     = (TxtQty.Text);
                        var product = Convert.ToDecimal(price) * Convert.ToInt32(qty);
                        txtTotal.Text = product.ToString();
                        TxtQty.Text   = qty.ToString();
                    }
                    else
                    {
                        MessageBox.Show("Available Quantity is " + txtAvailableQty.Text, "Warning",
                                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                        TxtQty.Clear();
                    }
                }
            }
            catch (Exception)
            {
            }

            //MessageBox.Show("Data has update successfully!", "Success",
            //    MessageBoxButtons.OK, MessageBoxIcon.Information);
            //}
        }
示例#2
0
 private void ClearFields()
 {
     CmdMedicineName.SelectedIndex = -1;
     txtAvailableQty.Clear();
     txtPrice.Clear();
     TxtQty.Clear();
     txtTotal.Clear();
 }
 private void BtnNew_Click(object sender, EventArgs e)
 {
     dateTimePicker1.Value = System.DateTime.Today;
     TxtOrder.Clear();
     TxtCustomer.Clear();
     TxtPhone.Clear();
     ComboItem.SelectedIndex = -1;
     TxtPrice.Clear();
     TxtQty.Clear();
     TxtTotal.Clear();
     TxtOrder.Focus();
 }
示例#4
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            TxtName.Clear();
            TxtQty.Clear();
            TxtCost.Clear();
            TxtMarkup.Clear();
            TxtSetupCost.Clear();
            TxtSetupHr.Clear();
            TxtOptCost.Clear();
            TxtOptHr.Clear();

            lockAdd    = false;
            lockModify = true;
        }