Esempio n. 1
0
        private void Button2_Click(object sender, EventArgs e)
        {
            if (Validation())
            {
                SqlConnection con = Connection.GetConnection("WebDev");


                // Insert Logic
                con.Open();
                bool isActive = comboBox1.SelectedIndex == 0;
                ProductManager.InsertUpdate(con, textBox1.Text, textBox2.Text, isActive, ProductManager.IfProductExists(con, textBox1.Text));
                con.Close();

                //Reading Data
                LoadData();
                ResetRecords();
            }
        }