Exemple #1
0
        /// <summary>
        /// 分销产品与商城产品映射
        /// </summary>
        /// <param name="dealerMallSysNo">分销商商城系统编号</param>
        /// <param name="mallProductId">商城商品编码</param>
        /// <param name="mallProductAttr">商城商品属性</param>
        /// <param name="hytProductSysNo">商城商品编码</param>
        /// <returns>void</returns>
        /// <remarks>2013-09-13 朱成果 创建</remarks>
        public void SetProductAssociation(int dealerMallSysNo, string mallProductId, string mallProductAttr, int hytProductSysNo)
        {
            var model = Hyt.DataAccess.Distribution.IDsProductAssociationDao.Instance.GetEntity(dealerMallSysNo, mallProductId);

            if (model != null)
            {
                if (model.HytProductSysNo != hytProductSysNo)
                {
                    model.HytProductSysNo = hytProductSysNo;
                    model.MallProductAttr = mallProductAttr;
                    Hyt.DataAccess.Distribution.IDsProductAssociationDao.Instance.Update(model);
                }
            }
            else
            {
                model = new DsProductAssociation()
                {
                    DealerMallSysNo = dealerMallSysNo,
                    HytProductSysNo = hytProductSysNo,
                    MallProductAttr = mallProductAttr,
                    MallProductId   = mallProductId
                };
                Hyt.DataAccess.Distribution.IDsProductAssociationDao.Instance.Insert(model);
            }
        }
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <returns></returns>
 /// <remarks>2013-09-13  朱成果 创建</remarks>
 public override void Update(DsProductAssociation entity)
 {
     Context.Update("DsProductAssociation", entity)
     .AutoMap(o => o.SysNo)
     .Where("SysNo", entity.SysNo)
     .Execute();
 }
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <returns>新增记录编号</returns>
 /// <remarks>2013-09-13  朱成果 创建</remarks>
 public override int Insert(DsProductAssociation entity)
 {
     entity.SysNo = Context.Insert("DsProductAssociation", entity)
                    .AutoMap(o => o.SysNo)
                    .ExecuteReturnLastId <int>("SysNo");
     return(entity.SysNo);
 }
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <returns></returns>
 /// <remarks>2013-09-13  朱成果 创建</remarks>
 public abstract void Update(DsProductAssociation entity);
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <returns>新增记录编号</returns>
 /// <remarks>2013-09-13  朱成果 创建</remarks>
 public abstract int Insert(DsProductAssociation entity);
Exemple #6
0
        /// <summary>
        /// 插入记录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Insert(DsProductAssociation model)
        {
            var SysNo = IDsProductAssociationDao.Instance.Insert(model);

            return(SysNo);
        }