Beispiel #1
0
        /// <summary>
        /// 增加商品类型
        /// </summary>
        /// <param name="wType"></param>
        public void WareTypeInsert(ProductType wType)
        {
            OtDB db = GetDb();

            try
            {
                db.Begin();
                db.ExecInsert(wType, "ProductType", new string[] { "TID", "Name", "Description", "BEnable", "CreateTime" });
                db.Commit();
            }
            catch (Exception ex)
            {
                OtCom.XLogErr(ex.Message);
                db.Rollback();
            }
        }
Beispiel #2
0
        /// <summary>
        /// 插入商品信息
        /// </summary>
        /// <param name="_myProduct"></param>
        public void WareInsert(ProductInfo _myProduct)
        {
            OtDB db = GetDb();

            try
            {
                db.Begin();
                db.ExecInsert(_myProduct, "ProductInfo", new string[] { "RID", "ProductID", "ProductName", "ProductPrice", "ProductIsSaled",
                                                                        "ProductEvaluateCount", "ProductGoodRate", "ProductImagePath", "ProductURL", "ProductDetail", "ProductBrand",
                                                                        "ProductAttach", "NativeData", "CreateTime", "CreateUser", "BEnable" });
                db.Commit();
            }
            catch (Exception ex)
            {
                OtCom.XLogErr(ex.Message);
                db.Rollback();
            }
        }
Beispiel #3
0
        /// <summary>
        /// 新增商品信息
        /// </summary>
        /// <param name="_myProduct"></param>
        public void WareInsert(ProductInfo _myProduct)
        {
            OtDB db = GetDb();

            try
            {
                db.Begin();
                db.ExecInsert(_myProduct, "ProductInfo", new string[] { "RID", "ProductID", "SkuID", "SkuidKey", "VenderId", "ShopId", "ProductName",
                                                                        "BrandID", "ProductBrand", "ProductAttach", "ProductIsSaled", "ProductTag", "Catalog", "ProductImageWebPath",
                                                                        "ProductImagePath", "ProductURL", "ProductCoupon", "ProductPromoMsg", "ProductDispatchMode",
                                                                        "ProductPrice", "ProductBasePrice", "ProductMobilePrice", "ProductQQPrice", "ProductWXPrice", "ProductType", "ProductPriceTrend",
                                                                        "ProductGeneralRate", "ProductPoorRate", "ProductHotCommentTag", "ProductEvaluateCount", "ProductGoodRate",
                                                                        "CreateTime", "CreateUser", "Focus", "BEnable" });
                db.Commit();
            }
            catch (Exception ex)
            {
                OtCom.XLogErr(ex.Message);
                db.Rollback();
            }
        }
Beispiel #4
0
        /// <summary>
        /// 添加评价信息
        /// </summary>
        /// <param name="msg"></param>
        public void WareMessageAdd(ProductMessage msg)
        {
            if (msg == null)
            {
                return;
            }
            OtDB db = GetDb();

            try
            {
                db.Begin();
                //db.Exec(string.Format("delete from ProductMessage where PID = '{0}'", msg.PID));
                db.ExecInsert(msg, "ProductMessage", new string[] { "PID", "MsgType", "MsgContent", "MsgUser", "MsgUserLevel", "MsgProvince", "MsgDate" });
                db.Commit();
            }
            catch (Exception ex)
            {
                OtCom.XLogErr(ex.Message);
                db.Rollback();
            }
        }
Beispiel #5
0
        /// <summary>
        /// 添加京东商品类别
        /// </summary>
        /// <param name="_types"></param>
        public void WareJDTypeAdd(List <JDWareType> _types)
        {
            if (_types == null && _types.Count == 0)
            {
                return;
            }
            OtDB db = GetDb();

            try
            {
                foreach (var item in _types)
                {
                    db.Begin();
                    db.ExecInsert(item, "JDWareType", new string[] { "TypeID", "TypeName", "TopID", "TypeUrl", "TypeLevel", "BEnable" });
                    db.Commit();
                }
            }
            catch (Exception ex)
            {
                OtCom.XLogErr(ex.Message);
                db.Rollback();
            }
        }