示例#1
0
 public void ClearTB()
 {
     WarrantyTB.Clear();
     PQtyTB.Clear();
     PriceTB.Clear();
     PModelCombo.Items.Clear();
     TotalTB.Clear();
 }
 private void UpdateItemsUC_Leave(object sender, EventArgs e)
 {
     dataGridView1.ClearSelection();
     PriceTB.Clear();
     CategoryTB.Clear();
     ItemTxtLb.Text = "";
     PriceTB.Hide();
     CategoryTB.Hide();
 }
        private void UpdateBtn_Click(object sender, EventArgs e)
        {
            if (ItemTxtLb.Text == "")
            {
                MessageBox.Show("Choose an item to update", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (CategoryTB.Text == "" || PriceTB.Text == "")
            {
                MessageBox.Show("Complete all the values", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                query = "update items set category = '" + CategoryTB.Text + "', price = '" + PriceTB.Text + "' where name = '" + ItemTxtLb.Text + "'";
                db.setData(query);
                MessageBox.Show("Data Processed Succesfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                loadData();

                SearchTextBox.Text = "Search Item";
                ItemTxtLb.Text     = "";
                CategoryTB.Clear();
                PriceTB.Clear();
            }
        }