Ejemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            int countBe = listBox1.Items.Count;
            int countAf;

            SeccessList seccessList = new SeccessList();

            bd.WorkWithBD(String.Format("INSERT INTO Buckets VALUES({0}, {1})", idBucket, products[5]));
            bd.WorkWithBD(String.Format("UPDATE Products SET Quantity = {0} WHERE Id = {1}", Int32.Parse(products[4]) - 1, products[5]));
            bd.ViewAll(listBox1, false);

            countAf = listBox1.Items.Count;

            if (countBe != countAf)
            {
                listBox1.SelectedIndex = 0;
                Filded();
            }
            else
            {
                listBox1.SelectedIndex = subString.IdList(listBox1, products[0]);
                Filded();
            }

            seccessList.SeccessMessage(3);
        }
Ejemplo n.º 2
0
        public void IdList_CorrectTitle_GoodID()
        {
            string title    = "RPG";
            int    expected = 0;

            ListBox list = GetListBox();

            list.Items.Add("Id: 3 Title: RPG");
            SubString subString = GetSubString();
            int       actual    = subString.IdList(list, title);

            Assert.AreEqual(expected, actual);
        }