Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string title       = textBox1.Text;
            int    category    = comboBox1.SelectedIndex;
            string cost        = textBox2.Text;
            string discription = textBox3.Text;
            string quantity    = textBox4.Text;

            string categoryMess;
            int    costInt;
            int    quantityInt;

            if (correctInput == null)
            {
                correctInput = new CorrectInputCheck();
            }

            if (bd == null)
            {
                bd = new BD();
            }

            if (correctInput.CheckAddEdit(title, category, cost, discription, quantity))
            {
                categoryMess = comboBox1.SelectedItem.ToString();
                costInt      = Int32.Parse(cost);
                quantityInt  = Int32.Parse(quantity);

                bd.WorkWithBD(String.Format("INSERT INTO Products VALUES ('{0}','{1}',{2},'{3}',{4})", title, categoryMess, cost, discription, quantity));

                secces.SeccessMessage(1);

                textBox1.Text           = "";
                comboBox1.SelectedIndex = -1;
                textBox2.Text           = "";
                textBox3.Text           = "";
                textBox4.Text           = "";
            }
        }
Esempio n. 2
0
        private void button4_Click(object sender, EventArgs e)
        {
            string login    = textBox1.Text;
            string password = textBox2.Text;


            correctInput = new CorrectInputCheck();

            bd = new BD();

            seccess = new SeccessList();

            if (correctInput.CheckLogPas(login, password))
            {
                if (correctInput.CorrectInputLogin(login))
                {
                    if (correctInput.LoginExist(login))
                    {
                        bd.WorkWithBD(String.Format("INSERT INTO Accounts VALUES('{0}','{1}','{2}',{3})", login, password, "Guest", correctInput.BucketIdGen()));
                        seccess.SeccessMessage(2);
                    }
                }
            }
        }