示例#1
0
        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);
        }
 public override bool Update(CarouselWidget item, params object[] primaryKeys)
 {
     if (item.CarouselItems != null && item.CarouselItems.Any())
     {
         item.CarouselItems.Each(m =>
         {
             m.CarouselWidgetID = item.ID;
             _carouselItemService.Update(m);
         });
     }
     return(base.Update(item, primaryKeys));
 }
示例#3
0
        public override bool Update(CarouselEntity item, params object[] primaryKeys)
        {
            bool result = base.Update(item, primaryKeys);

            if (item.CarouselItems != null)
            {
                item.CarouselItems.Each(m =>
                {
                    m.CarouselID = item.ID;
                    _carouselItemService.Update(m);
                });
            }
            return(result);
        }