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

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

            deleteDrink.Delete();

            return(RedirectToAction("Index"));
        }
示例#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();
     }
 }
示例#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);
        }