/// <summary> /// 同步添加到B2B平台 /// </summary> /// <param name="model">规格信息</param> /// <returns>罗勤瑶 2017-10-11</returns> public override int AddPdProductSpecToB2B(PdProductSpec model) { return(ContextB2B.Insert("PdProductSpec") .Column("ProductSysNo", model.ProductSysNo) .Column("SpecValues", model.SpecValues) .Execute()); }
/// <summary> /// 检查b2b商品分类对应关系是否存在 /// </summary> /// <param name="productSysNo"></param> /// <param name="categorySysNo"></param> /// <returns>返回 true:包含 false:不包含</returns> /// <remarks>2017-010-11 罗勤瑶 创建</remarks> public override bool IsExistInB2B(int productSysNo, int categorySysNo) { return (ContextB2B.Sql( "select Count(SysNo) from PdCategoryAssociation where productsysno=@0 and CategorySysNo=@1", productSysNo, categorySysNo).QuerySingle <int>() > 0); }
/// <summary> /// 添加b2b品牌 /// </summary> /// <param name="model">品牌实体信息</param> /// <returns>返回新建记录的sysno</returns> /// <remarks>2017-10-10 罗勤瑶 创建</remarks> public override int CreateToB2B(PdBrand model) { int id = ContextB2B.Insert <PdBrand>("pdbrand", model) .AutoMap(x => x.SysNo) .ExecuteReturnLastId <int>("Sysno"); return(id); }
/// <summary> /// 图片添加 /// </summary> /// <param name="model">图片信息</param> /// <returns>返回受影响行</returns> /// <remarks>2013-07-21 苟治国 创建</remarks> public override int InsertB2B(Model.PdProductImage model) { var result = ContextB2B.Insert <PdProductImage>("PdProductImage", model) .AutoMap(x => x.SysNo) .ExecuteReturnLastId <int>("SysNo"); return(result); }
/// <summary> /// 获取B2B指定商品的图片列表 /// </summary> /// <param name="productsysNo">商品系统编号</param> /// <returns>获取指定商品的图片列表</returns> /// <remarks>2017-10-11 罗勤瑶 创建</remarks> public override IList <PdProductImage> GetB2BProductImg(int productsysNo) { const string sql = @"select * from PdProductImage where productsysno=@0 order by DisplayOrder,sysno asc"; var list = ContextB2B.Sql(sql, productsysNo).QueryMany <PdProductImage>(); //返回结果集 return(list); }
/// <summary> /// 获取b2b指定名称的品牌信息 /// </summary> /// <param name="name">品牌名称</param> /// <returns>品牌实体信息</returns> /// <remarks>2017-10-10 罗勤瑶 创建</remarks> public override PdBrand GetB2BEntityByName(string Name) { PdBrand entity = ContextB2B.Select <PdBrand>("*") .From("PdBrand") .Where("Name = @Name") .Parameter("Name", Name) .QuerySingle(); return(entity); }
/// <summary> /// 添加商品的的对应关系 /// </summary> /// <param name="newPdCategoryAssociation">商品分类关联对象</param> /// <returns>返回 true:添加成功 false:添加失败</returns> /// <remarks>2013-07-17 邵斌 创建</remarks> public override int CreateB2B(Model.PdCategoryAssociation newPdCategoryAssociation) { return(ContextB2B.Insert <PdCategoryAssociation>("PdCategoryAssociation", newPdCategoryAssociation) .AutoMap(p => p.SysNo) .ExecuteReturnLastId <int>("SysNo")); }