public override bool Update(CarouselEntity item, params object[] primaryKeys)
        {
            bool result = base.Update(item, primaryKeys);

            if (item.CarouselItems != null)
            {
                var carouselItemService = new CarouselItemService();
                item.CarouselItems.Each(m =>
                {
                    if (m.ActionType == Constant.ActionType.Update)
                    {
                        m.CarouselID = item.ID;
                        carouselItemService.Update(m);
                    }
                    else if (m.ActionType == Constant.ActionType.Create)
                    {
                        m.CarouselID = item.ID;
                        carouselItemService.Add(m);
                    }
                    else if (m.ActionType == Constant.ActionType.Delete)
                    {
                        carouselItemService.Delete(m.ID);
                    }
                });
            }
            return(result);
        }
Beispiel #2
0
 public override int Delete(DataFilter filter)
 {
     this.Get(filter).Each(m => _carouselItemService.Delete(new DataFilter().Where("CarouselID", OperatorType.Equal, m.ID)));
     return(base.Delete(filter));
 }
 public override void DeleteWidget(string widgetId)
 {
     _carouselItemService.Delete(new DataFilter().Where("CarouselWidgetID", OperatorType.Equal, widgetId));
     base.DeleteWidget(widgetId);
 }