Ejemplo n.º 1
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (listBox1.Items.Count != 0)
     {
         if (!checkBox1.Checked)
         {
             if (inputCheck.SelectedItemCheck(listBox1.SelectedIndex))
             {
                 int ind = listBox1.SelectedIndex;
                 if (inputCheck.AccessMessage(String.Format("Do you want delete this records? ({0})", OneProd(products[ind]))))
                 {
                     bd.WorkWithBD(String.Format("UPDATE Products SET Quantity = {0} WHERE Id = {1}", Int32.Parse(products[ind][4]) + 1, products[ind][5]));
                     bd.WorkWithBD(String.Format("DELETE TOP (1) FROM Buckets WHERE idProducts = {0}", products[ind][5]));
                     Bucket();
                 }
             }
         }
         else
         {
             if (inputCheck.AccessMessage("Do you want delete all records?"))
             {
                 for (int i = 0; i < products.Length; i++)
                 {
                     bd.WorkWithBD(String.Format("UPDATE Products SET Quantity = {0} WHERE Id = {1}", Int32.Parse(products[i][4]) + 1, products[i][5]));
                     bd.WorkWithBD(String.Format("DELETE TOP (1) FROM Buckets WHERE idProducts = {0}", products[i][5]));
                 }
                 Bucket();
             }
         }
     }
     else
     {
         error.ErrorMessage(12);
     }
 }
Ejemplo n.º 2
0
        public void AccessMessage_Yes_TrueReturned()
        {
            string msg = "YES";

            CorrectInputCheck inputCheck = GetInputCheck();
            bool actual = inputCheck.AccessMessage(msg);

            Assert.IsTrue(actual);
        }
Ejemplo n.º 3
0
        public void AccessMessage_No_FalseReturned()
        {
            string msg = "NO";

            CorrectInputCheck inputCheck = GetInputCheck();
            bool actual = inputCheck.AccessMessage(msg);

            Assert.IsFalse(actual);
        }
Ejemplo n.º 4
0
        private void button3_Click(object sender, EventArgs e)
        {
            int id = bd.OrderId(idBucket);

            if (inputCheck.AccessMessage("Do you want delete this order?"))
            {
                bd.WorkWithBD(String.Format("DELETE Orders WHERE Id = {0}", id));
            }

            seccessList.SeccessMessage(6);
            ChangeOrderForm();
        }