private void UpdateItemsUC_Load(object sender, EventArgs e)
 {
     loadData();
     ItemTxtLb.Text = "";
     PriceTB.Hide();
     CategoryTB.Hide();
 }
Exemple #2
0
        private void ModifButton_Click(object sender, EventArgs e)
        {
            string sqlExpression = "Insert into Modification Values((select TOP 1 ID_Auto from Automobile Where Mark_Auto = '" + СhooseMarkModifCB.Text + "' AND Model_auto = '" + ChooseModelModifCB.Text + "'),'" +
                                   ColorModifCB.Text + "','" + ComplectModifCB.Text + "','" + SpecsModifCB.Text + "'," + Convert.ToInt32(YearTB.Text) + "," + Convert.ToInt32(PriceTB.Text) + ", NULL)";

            ExecuteQuery(sqlExpression);
            sqlExpression = "insert into Storage Values((select max(ID_Modification) From Modification), NULL)";
            ExecuteQuery(sqlExpression);
            ColorModif.Hide();
            EngineModif.Hide();
            ComplectationModif.Hide();
            YearModif.Hide();
            YearTB.Hide();
            Pricelbl.Hide();
            PriceTB.Hide();
            ModifButton.Hide();
            ColorModifCB.Hide();
            SpecsModifCB.Hide();
            ComplectModifCB.Hide();
            СhooseMarkModifCB.Items.Clear();
            sqlExpression = "SELECT Distinct Mark_auto FROM Automobile";
            CBquery(sqlExpression, СhooseMarkModifCB);
            ChooseModelModifCB.Items.Clear();
            sqlExpression = "SELECT Model_auto FROM Automobile";
            CBquery(sqlExpression, ChooseModelModifCB);
        }
 private void UpdateItemsUC_Leave(object sender, EventArgs e)
 {
     dataGridView1.ClearSelection();
     PriceTB.Clear();
     CategoryTB.Clear();
     ItemTxtLb.Text = "";
     PriceTB.Hide();
     CategoryTB.Hide();
 }