示例#1
0
        public ActionResult Delete(string id)
        {
            var existingItem = _eventBL.GetById(id);

            if (existingItem == null)
            {
                return(NotFound());
            }
            _eventBL.DeleteEvent(id);
            return(Ok());
        }
示例#2
0
        public void DeleteEventTest()
        {
            Customer customer = new Customer(101, "Matt", "Knox");
            Sale     sale     = new Sale(customer, DateTime.Today, productRepository.GetProductsState());
            Supply   supply   = new Supply(DateTime.Today, productRepository.GetProductsState());

            eventRepository.AddEvent(sale);
            eventRepository.AddEvent(supply);
            Event _event = eventRepository.GetAllEvents().First();

            Assert.AreEqual(2, eventRepository.GetAllEvents().Count);
            eventRepository.DeleteEvent(_event);
            Assert.AreEqual(1, eventRepository.GetAllEvents().Count);
        }
示例#3
0
 public void DeleteEvent(Event @event)
 {
     eventRepository.DeleteEvent(@event);
 }
 public int Delete(int id)
 {
     return(objevent.DeleteEvent(id));
 }