Beispiel #1
0
        private void btn_deleteDrink_Click(object sender, EventArgs e)
        {
            Drink drink = new Drink();

            drink.SelectObjectwithID(Oid);
            drink.Delete();
            reLoad();
        }
Beispiel #2
0
        public ActionResult Delete(int id)
        {
            Drink deleteDrink = Drink.Find(id);

            deleteDrink.Delete();

            return(RedirectToAction("Index"));
        }
Beispiel #3
0
 private void btn_deleteDrink_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Bạn có chắc chắn muốn xóa?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         Drink drink = new Drink();
         drink.SelectObjectwithID(Oid);
         drink.Delete();
         MessageBox.Show("Xóa đồ uống thành công!");
         reLoad();
     }
 }
Beispiel #4
0
        public void Delete_A_Specific_Drink()
        {
            //Arrange
            Drink newDrink1 = new Drink("Americano");

            newDrink1.Save();
            Drink newDrink2 = new Drink("Latte");

            newDrink2.Save();
            Assert.IsTrue(Drink.GetAll().Count == 2);

            //Act
            newDrink1.Delete();
            List <Drink> expectedList = new List <Drink> {
                newDrink2
            };

            //Assert
            List <Drink> outputList = Drink.GetAll();

            Assert.IsTrue(outputList.Count == 1);
            CollectionAssert.AreEqual(expectedList, outputList);
        }