Example #1
0
 private void buttonRefresh_Click(object sender, EventArgs e)
 {
     if (x == 1)
     {
         dataGridView.DataSource = DishesDbController.GetDishes();
         dataGridView.Refresh();
     }
     if (x == 2)
     {
         dataGridView.DataSource = RecipeDbController.GetRecipes();
         dataGridView.Refresh();
     }
     if (x == 3)
     {
         dataGridView.DataSource = PurchaseDbController.GetPurchases();
         dataGridView.Refresh();
     }
     if (x == 4)
     {
         dataGridView.DataSource = SaleDbController.GetSales();
         dataGridView.Refresh();
     }
     if (x == 5)
     {
         dataGridView.DataSource = ProductDbController.GetProducts();
         dataGridView.Refresh();
     }
     if (x == 6)
     {
         dataGridView.DataSource = LayoutDbController.GetLayouts();
         dataGridView.Refresh();
     }
 }
Example #2
0
        public void DeleteProductTestMethod()
        {
            bool resAdd = ProductDbController.AddProduct("Potato", "gr");

            Assert.IsTrue(resAdd);
            List <Product> list   = ProductDbController.GetProducts();
            int            count  = list.Count;
            bool           resDel = ProductDbController.DeleteProduct(list[count - 1].Id);

            Assert.IsTrue(resDel);
            Assert.AreEqual(ProductDbController.GetProducts().Count, --count);
        }
Example #3
0
        public void AddProductTestMethod()
        {
            List <Product> list  = ProductDbController.GetProducts();
            int            count = list.Count;
            bool           res   = ProductDbController.AddProduct("Potato", "gr");

            Assert.AreEqual(res, true);
            List <Product> resList = ProductDbController.GetProducts();

            Assert.AreEqual(resList.Count, ++count);
            Assert.AreEqual(resList[count - 1].Name, "Potato");
            Assert.AreEqual(resList[count - 1].Unit, "gr");
        }
Example #4
0
 private void productsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     labelTittle.Text        = "Table Products";
     dataGridView.DataSource = ProductDbController.GetProducts();
     x = 5;
 }
Example #5
0
        public void SelectProductsTestMethod()
        {
            List <Product> list = ProductDbController.GetProducts();

            Assert.IsTrue(list != null);
        }