Example #1
0
        public IActionResult Delete(int id)
        {
            Dish dish = db.GetEntity(id);

            if (dish == null)
            {
                return(NotFound());
            }
            db.Delete(id);
            db.Save();
            return(Ok(dish));
        }
Example #2
0
        public async Task <IHttpActionResult> Delete(int id)
        {
            var dish = await DishRepository.FindOneByAsync(elem => elem.Id == id);

            if (dish == null)
            {
                return(NotFound());
            }
            DishRepository.Delete(dish);
            await UnitOfWork.CommitAsync();

            return(Ok(dish));
        }
Example #3
0
        public ActionResult Delete(int id)
        {
            Employee em   = (Employee)Session[CommonConstants.USER_SESSION];
            var      dish = _dishRepo.GetById(id);

            dish.ModifyBy = em.id;
            var result = _dishRepo.Delete(dish);

            if (result == 1)
            {
                return(Json(new { status = 1, message = "Xóa thành công" }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { status = 1, message = "Xóa thất bại" }, JsonRequestBehavior.AllowGet));
        }
 public void Delete(string DishName)
 {
     DishRepository.Delete(DishName);
 }