Пример #1
0
        public virtual void Update(SaleAdvertisement entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            if (entity.SysNo <= 0)
            {
                //throw new BizException("系统编号不能为空!");
                throw new BizException(ResouceManager.GetMessageString("MKT.SaleAdvertisement", "SaleAdvertisement_SysNoNotNull"));
            }
            if (string.IsNullOrEmpty(entity.Name.Content))
            {
                //throw new BizException("页面名称不能为空!");
                throw new BizException(ResouceManager.GetMessageString("MKT.SaleAdvertisement", "SaleAdvertisement_PageNameNotNull"));
            }
            if (string.IsNullOrEmpty(entity.Header))
            {
                //throw new BizException("页面头部不能为空!");
                throw new BizException(ResouceManager.GetMessageString("MKT.SaleAdvertisement", "SaleAdvertisement_PageTitleNotNull"));
            }

            if (string.IsNullOrEmpty(entity.CssPath))
            {
                entity.CssPath = null;
            }
            if (string.IsNullOrEmpty(entity.Footer))
            {
                entity.Footer = null;
            }

            da.UpdateSaleAdv(entity);
        }
Пример #2
0
        public void UnLockSaleAdv(int sysNo)
        {
            var entity = new SaleAdvertisement {
                SysNo = sysNo, IsHold = "N"
            };

            ObjectFactory <SaleAdvAppService> .Instance.UpdateIsHoldSaleAdvertisementBySysNo(entity);
        }
Пример #3
0
        public void UpdateSaleAdv(SaleAdvertisement entity)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("MaintainSaleAdv");

            dc.SetParameterValue(entity);

            dc.ExecuteNonQuery();
        }
Пример #4
0
        /// <summary>
        /// 修改模板锁定状态
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public void UpdateIsHoldSaleAdvBySysNo(SaleAdvertisement entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateIsHoldSaleAdvertisementBySysNo");

            cmd.SetParameterValue("@SysNo", entity.SysNo);
            cmd.SetParameterValue("@IsHold", entity.IsHold);

            cmd.ExecuteNonQuery();
        }
Пример #5
0
        public SaleAdvertisement CreateSaleAdv(SaleAdvertisement entity)
        {
            DataCommand command = DataCommandManager.GetDataCommand("CreateSaleAdv");

            command.SetParameterValue(entity);

            command.ExecuteNonQuery();

            entity.SysNo = Convert.ToInt32(command.GetParameterValue("@SysNo"));

            return(entity);
        }
Пример #6
0
        /// <summary>
        /// 获取促销模板信息
        /// </summary>
        /// <param name="promotionSysNo">促销模板编号</param>
        /// <returns></returns>
        public List <SaleAdvModel> GetSaleAdvInfo(int promotionSysNo)
        {
            SaleAdvertisement   promotion = ProductFacade.GetSaleAdvertisementInfo(promotionSysNo);
            List <SaleAdvModel> result    = new List <SaleAdvModel>();

            if (promotion != null && promotion.SaleAdvertisementGroupList != null)
            {
                SaleAdvModel model = null;
                foreach (var group in promotion.SaleAdvertisementGroupList)
                {
                    if (group.SaleAdvertisementItemList != null && group.SaleAdvertisementItemList.Count > 0)
                    {
                        model           = new SaleAdvModel();
                        model.GroupName = group.GroupName;
                        model.ItemList  = MapAdvItem(group.SaleAdvertisementItemList);
                        result.Add(model);
                    }
                }
            }
            return(result);
        }
Пример #7
0
        /// <summary>
        /// 促销模板
        /// </summary>
        /// <param name="sysNo">促销模板编号</param>
        /// <returns></returns>
        public static SaleAdvertisement GetSaleAdvertisementInfo(int sysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("Promotion_SaleAdvertisement");

            cmd.SetParameterValue("@sysNo", sysNo);
            DataSet           ds = cmd.ExecuteDataSet();
            SaleAdvertisement saleAdvertisementInfo = new SaleAdvertisement();
            DataTable         dtSaleAdvertisement   = ds.Tables[0];

            //DataTable dtSaleAdvertisementGroup = ds.Tables[1];
            //DataTable dtSaleAdvertisementItem = ds.Tables[2];

            if (dtSaleAdvertisement != null && dtSaleAdvertisement.Rows.Count > 0)
            {
                //促销模板
                saleAdvertisementInfo = DataMapper.GetEntity <SaleAdvertisement>(dtSaleAdvertisement.Rows[0]);
                //if (dtSaleAdvertisementGroup != null && dtSaleAdvertisementGroup.Rows.Count > 0)
                //{
                //    //促销模板组
                //    saleAdvertisementInfo.SaleAdvertisementGroupList = DataMapper.GetEntityList<SaleAdvertisementGroup, List<SaleAdvertisementGroup>>(dtSaleAdvertisementGroup.Rows);
                //    if (dtSaleAdvertisementItem != null && dtSaleAdvertisementItem.Rows.Count > 0)
                //    {
                //        List<SaleAdvertisementItem> productList = DataMapper.GetEntityList<SaleAdvertisementItem, List<SaleAdvertisementItem>>(dtSaleAdvertisementItem.Rows, (row, entity) => {
                //            entity.IsHaveValidGift = row["IsHaveValidGift"] == null ? false : (row["IsHaveValidGift"].ToString() == "1" ? true : false);
                //        });

                //        saleAdvertisementInfo.SaleAdvertisementGroupList.ForEach(f =>
                //        {
                //            //促销模板商品
                //            f.SaleAdvertisementItemList = productList.FindAll(item => item.GroupSysNo == f.SysNo);
                //        });
                //    }
                //}
            }
            return(saleAdvertisementInfo);
        }
Пример #8
0
 public void UpdateIsHoldSaleAdvertisementBySysNo(SaleAdvertisement entity)
 {
     da.UpdateIsHoldSaleAdvBySysNo(entity);
 }
Пример #9
0
 public virtual void UpdateIsHoldSaleAdvertisementBySysNo(SaleAdvertisement entity)
 {
     processor.UpdateIsHoldSaleAdvertisementBySysNo(entity);
 }
Пример #10
0
 public virtual void Update(SaleAdvertisement entity)
 {
     processor.Update(entity);
 }
Пример #11
0
 public virtual SaleAdvertisement Create(SaleAdvertisement entity)
 {
     return(processor.Create(entity));
 }
Пример #12
0
 public void UpdateSaleAdv(SaleAdvertisement msg)
 {
     ObjectFactory <SaleAdvAppService> .Instance.Update(msg);
 }
Пример #13
0
 public SaleAdvertisement CreateSaleAdv(SaleAdvertisement msg)
 {
     return(ObjectFactory <SaleAdvAppService> .Instance.Create(msg));
 }