示例#1
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);
        }
示例#2
0
        private void ChooseModelModifCB_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            СhooseMarkModifCB.Items.Clear();
            string sqlExpression = "SELECT Mark_auto FROM Automobile Where Model_auto = '" + ChooseModelModifCB.Text + "'";

            CBquery(sqlExpression, СhooseMarkModifCB);
            if (!Model)
            {
                ++countChosenauto;
                Model = true;
            }
            if (countChosenauto == 2)
            {
                countChosenauto = 0;
                ColorModif.Show();
                EngineModif.Show();
                ComplectationModif.Show();
                YearModif.Show();
                YearTB.Show();
                Pricelbl.Show();
                PriceTB.Show();
                ModifButton.Show();
                ColorModifCB.Show();
                sqlExpression = "SELECT Colour FROM Automobile_colour Where _ID_Auto IN(select ID_Auto from Automobile Where Mark_Auto = '" + СhooseMarkModifCB.Text + "' AND Model_auto = '" + ChooseModelModifCB.Text + "')";
                CBquery(sqlExpression, ColorModifCB);
                SpecsModifCB.Show();
                sqlExpression = "SELECT Engine_type FROM Automobile_Specification Where _ID_Auto IN(select ID_Auto from Automobile Where Mark_Auto = '" + СhooseMarkModifCB.Text + "' AND Model_auto = '" + ChooseModelModifCB.Text + "')";
                CBquery(sqlExpression, SpecsModifCB);
                ComplectModifCB.Show();
                sqlExpression = "SELECT Equipment FROM Automobile_Complectation Where _ID_Auto IN(select ID_Auto from Automobile Where Mark_Auto = '" + СhooseMarkModifCB.Text + "' AND Model_auto = '" + ChooseModelModifCB.Text + "')";
                CBquery(sqlExpression, ComplectModifCB);
                Model = false;
            }
        }
示例#3
0
 private void SunStoreDisconnectedModefrm_Load_1(object sender, EventArgs e)
 {
     LoadIDs();
     LoadData();
     ProductIDcbx.Hide();
     ProductsIDlbl.Hide();
     ProductNametxt.Hide();
     ProductNamelbl.Hide();
     Pricetxt.Hide();
     Pricelbl.Hide();
     btn.Hide();
     btn.Text = "";
 }
示例#4
0
 private void Searchbtn_CheckedChanged_1(object sender, EventArgs e)
 {
     if (Searchbtn.Checked == true)
     {
         ProductIDcbx.Hide();
         ProductsIDlbl.Hide();
         ProductNametxt.Show();
         ProductNamelbl.Show();
         Pricetxt.Show();
         Pricelbl.Show();
         btn.Show();
         btn.Text = "Search";
     }
 }
示例#5
0
 private void DELradiobtn_CheckedChanged(object sender, EventArgs e)
 {
     if (DELradiobtn.Checked == true)
     {
         ProductIDcbx.Show();
         ProductsIDlbl.Show();
         ProductNametxt.Hide();
         ProductNamelbl.Hide();
         Pricetxt.Hide();
         Pricelbl.Hide();
         btn.Show();
         btn.Text = "Delete";
     }
 }
示例#6
0
 private void UPDradiobtn_CheckedChanged(object sender, EventArgs e)
 {
     if (UPDradiobtn.Checked == true)
     {
         ProductIDcbx.Show();
         ProductsIDlbl.Show();
         ProductNametxt.Show();
         ProductNamelbl.Show();
         Pricetxt.Show();
         Pricelbl.Show();
         btn.Show();
         btn.Text = "Edit";
     }
 }