Esempio n. 1
0
 /// <summary>
 /// 店铺信息收集
 /// </summary>
 /// <returns>返回1,更新店铺信息;返回2,增加店铺信息</returns>
 public int CollectionTaobaoShops(ShopDetailInfo sinfo)
 {
     DbParameter[] parms = {
                             DbHelper.MakeInParam("sid", (DbType)SqlDbType.BigInt,8,sinfo.sid),
                             DbHelper.MakeInParam("user_id", (DbType)SqlDbType.BigInt,8,sinfo.user_id),
                             DbHelper.MakeInParam("cid", (DbType)SqlDbType.BigInt,8,sinfo.cid),
                             DbHelper.MakeInParam("nick", (DbType)SqlDbType.NVarChar,200,sinfo.nick),
                             DbHelper.MakeInParam("title", (DbType)SqlDbType.NVarChar,500,sinfo.title),
                             DbHelper.MakeInParam("item_score", (DbType)SqlDbType.NChar,10,sinfo.item_score),
                             DbHelper.MakeInParam("service_score", (DbType)SqlDbType.NChar,10,sinfo.service_score),
                             DbHelper.MakeInParam("delivery_score", (DbType)SqlDbType.NChar,10,sinfo.delivery_score),
                             DbHelper.MakeInParam("shop_desc", (DbType)SqlDbType.Text,0,sinfo.shop_desc),
                             DbHelper.MakeInParam("bulletin", (DbType)SqlDbType.NVarChar,200,sinfo.bulletin),
                             DbHelper.MakeInParam("pic_path", (DbType)SqlDbType.VarChar,500,sinfo.pic_path),
                             DbHelper.MakeInParam("created", (DbType)SqlDbType.DateTime,8,sinfo.created),
                             DbHelper.MakeInParam("modified", (DbType)SqlDbType.DateTime,8,sinfo.modified),
                             DbHelper.MakeInParam("promoted_type", (DbType)SqlDbType.VarChar,50,sinfo.promoted_type),
                             DbHelper.MakeInParam("consumer_protection", (DbType)SqlDbType.Bit,1,sinfo.consumer_protection),
                             DbHelper.MakeInParam("shop_status", (DbType)SqlDbType.VarChar,50,sinfo.shop_status),
                             DbHelper.MakeInParam("shop_type", (DbType)SqlDbType.VarChar,20,sinfo.shop_type),
                             DbHelper.MakeInParam("shop_level", (DbType)SqlDbType.Int,4,sinfo.shop_level),
                             DbHelper.MakeInParam("@shop_score", (DbType)SqlDbType.Int,4,sinfo.shop_score),
                             DbHelper.MakeInParam("@total_num", (DbType)SqlDbType.BigInt,8,sinfo.total_num),
                             DbHelper.MakeInParam("@good_num", (DbType)SqlDbType.BigInt,8,sinfo.good_num),
                             DbHelper.MakeInParam("@shop_country", (DbType)SqlDbType.NVarChar,50,sinfo.shop_country),
                             DbHelper.MakeInParam("@shop_province", (DbType)SqlDbType.NVarChar,50,sinfo.shop_province),
                             DbHelper.MakeInParam("@shop_city", (DbType)SqlDbType.NVarChar,50,sinfo.shop_city),
                             DbHelper.MakeInParam("@shop_address", (DbType)SqlDbType.NVarChar,200,sinfo.shop_address),
                             DbHelper.MakeInParam("@commission_rate", (DbType)SqlDbType.VarChar,10,sinfo.commission_rate),
                             DbHelper.MakeInParam("@click_url", (DbType)SqlDbType.VarChar,500,sinfo.click_url)
                           };
     return TypeConverter.ObjectToInt(DbHelper.ExecuteScalar(CommandType.StoredProcedure, string.Format("{0}collectiontaobaoshop", BaseConfigs.GetTablePrefix), parms), 0);
 }
Esempio n. 2
0
    protected override void ShowPage()
    {
        if (string.IsNullOrEmpty(sid))
        {
            AddErrLine("店铺信息展示错误!");
            SetMetaRefresh(2, LogicUtils.GetReUrl());
            return;
        }

        sinfo = TaoBaos.GetTaoBaoShopInfo(sid);

        if (sinfo == null)
        {
            AddErrLine("店铺信息展示错误!");
            SetMetaRefresh(2, LogicUtils.GetReUrl());
            return;
        }

        pagetitle = string.Format("{0}-{0}店铺详细介绍", sinfo.title);
        seokeyword = string.Format("{0}介绍,{0},{1}", sinfo.title, sinfo.nick);
        seodescription = string.Format("{0}店铺详细介绍。{1}。", sinfo.title, Utils.CutString(Utils.RemoveHtml(sinfo.shop_desc), 60));
    }
Esempio n. 3
0
 public static List<ShopDetailInfo> GetTaoBaoShopList(IDataReader reader)
 {
     List<ShopDetailInfo> shoplist = new List<ShopDetailInfo>();
     while (reader.Read())
     {
         ShopDetailInfo sinfo = new ShopDetailInfo();
         sinfo.sid = long.Parse(reader["sid"].ToString());
         sinfo.user_id = long.Parse(reader["user_id"].ToString());
         sinfo.cid = long.Parse(reader["cid"].ToString());
         sinfo.nick = reader["nick"].ToString();
         sinfo.title = reader["title"].ToString();
         sinfo.item_score = reader["item_score"].ToString();
         sinfo.service_score = reader["service_score"].ToString();
         sinfo.delivery_score = reader["delivery_score"].ToString();
         sinfo.shop_desc = reader["shop_desc"].ToString();
         sinfo.bulletin = reader["bulletin"].ToString();
         sinfo.pic_path = reader["pic_path"].ToString();
         sinfo.created = reader["created"].ToString();
         sinfo.modified = reader["modified"].ToString();
         sinfo.promoted_type = reader["promoted_type"].ToString();
         sinfo.consumer_protection = true;
         sinfo.shop_status = reader["shop_status"].ToString();
         sinfo.shop_type = reader["shop_type"].ToString();
         sinfo.shop_level = TypeConverter.ObjectToInt(reader["shop_level"].ToString());
         sinfo.shop_score = TypeConverter.ObjectToInt(reader["shop_score"].ToString());
         sinfo.total_num = long.Parse(reader["total_num"].ToString());
         sinfo.good_num = long.Parse(reader["good_num"].ToString());
         sinfo.shop_country = reader["shop_country"].ToString();
         sinfo.shop_province = reader["shop_province"].ToString();
         sinfo.shop_city = reader["shop_city"].ToString();
         sinfo.shop_address = reader["shop_address"].ToString();
         sinfo.commission_rate = reader["commission_rate"].ToString();
         sinfo.click_url = reader["click_url"].ToString();
         sinfo.relategoods = reader["relategoods"].ToString();
         shoplist.Add(sinfo);
     }
     reader.Close();
     return shoplist;
 }
 private void InitializeComponent()
 {
     EditRecommendInfo.Click += new EventHandler(EditRecommendInfo_Click);
     icatlist = tpb.GetItemCatCache(0);
     sdinfo = tpb.GetTaoBaoShopInfo(sid);
 }
Esempio n. 5
0
        /// <summary>
        /// 搜索并增加或更新店铺信息
        /// </summary>
        /// <param name="nickname">卖家昵称</param>
        public static int SearchAndAddShop(string nickname)
        {
            UserGetRequest ugr = new UserGetRequest();
            ugr.Fields = "user_id,nick,seller_credit,location,type,promoted_type,status,consumer_protection";
            ugr.Nick = nickname;
            User userinfo = new User();
            try
            {
                userinfo = client.UserGet(ugr);
            }
            catch (NTWException ntwe1)
            {
                userinfo = null;
            }
            if (userinfo == null) return 0;
            Location locainfo = userinfo.Location;
            UserCredit ucredit = userinfo.SellerCredit;

            ShopGetRequest sgr = new ShopGetRequest();
            sgr.Fields = "sid,cid,title,nick,desc,bulletin,pic_path,created,modified,shop_score";
            sgr.Nick = nickname;
            Shop shopinfo = new Shop();
            try
            {
                shopinfo = client.ShopGet(sgr);
            }
            catch (NTWException ntwe2)
            {
                shopinfo = null;
            }
            if (shopinfo == null) return 0;
            ShopScore shopscore = shopinfo.ShopScore;

            TaobaokeShopsConvertRequest tcr = new TaobaokeShopsConvertRequest();
            tcr.Fields = "user_id,shop_title,click_url,commission_rate";
            tcr.Nick = SAS_USERNICK;
            tcr.Sids = shopinfo.Sid;
            PageList<TaobaokeShop> tks = client.TaobaokeShopsConvert(tcr);
            if (tks.Content.Count == 0) return 0;
            TaobaokeShop tshopinfo = tks.Content[0];

            ShopDetailInfo sinfo = new ShopDetailInfo();
            sinfo.sid = long.Parse(shopinfo.Sid.Trim());
            sinfo.user_id = long.Parse(tshopinfo.UserId.Trim());
            sinfo.cid = long.Parse(shopinfo.Cid.Trim());
            sinfo.nick = shopinfo.Nick;
            sinfo.title = shopinfo.Title;
            sinfo.item_score = shopscore.ItemScore;
            sinfo.service_score = shopscore.ServiceScore;
            sinfo.delivery_score = shopscore.DeliveryScore;
            sinfo.shop_desc = shopinfo.Desc == null ? "" : shopinfo.Desc;
            sinfo.bulletin = shopinfo.Bulletin == null ? "" : shopinfo.Bulletin;
            sinfo.pic_path = shopinfo.PicPath == null ? "" : shopinfo.PicPath;
            sinfo.created = shopinfo.Created == null ? "" : shopinfo.Created; ;
            sinfo.modified = shopinfo.Modified == null ? "" : shopinfo.Modified; ;
            sinfo.promoted_type = userinfo.PromotedType == null ? "" : userinfo.PromotedType;
            sinfo.consumer_protection = userinfo.ConsumerProtection;
            sinfo.shop_status = userinfo.Status == null ? "" : userinfo.Status;
            sinfo.shop_type = userinfo.Type;
            sinfo.shop_level = ucredit.Level;
            sinfo.shop_score = ucredit.Score;
            sinfo.total_num = ucredit.TotalNum;
            sinfo.good_num = ucredit.GoodNum;
            sinfo.shop_country = locainfo.Country == null ? "" : locainfo.Country;
            sinfo.shop_province = locainfo.State == null ? "" : locainfo.State;
            sinfo.shop_city = locainfo.City == null ? "" : locainfo.City;
            sinfo.shop_address = locainfo.Address == null ? "" : locainfo.Address;
            sinfo.commission_rate = tshopinfo.CommissionRate == null ? "" : tshopinfo.CommissionRate;
            sinfo.click_url = tshopinfo.ClickUrl == null ? "" : tshopinfo.ClickUrl;
            return CollectionTaoBaoShop(sinfo);
        }
Esempio n. 6
0
 /// <summary>
 /// 店铺信息收集
 /// </summary>
 /// <returns>返回1,更新店铺信息;返回2,增加店铺信息</returns>
 public static int CollectionTaoBaoShop(ShopDetailInfo sinfo)
 {
     return Data.DbProvider.GetInstance().CollectionTaobaoShops(sinfo);
 }
Esempio n. 7
0
    protected override void ShowPage()
    {
        if (!string.IsNullOrEmpty(SASRequest.GetString("iid")))
        {
            iid = long.Parse(SASRequest.GetString("iid"));
        }
        tkitem = TaoBaos.GetTaoBaoKeItemDetail(iid);
        if (tkitem == null)
        {
            AddErrLine("商品已过期或已下架!");
            SetMetaRefresh(2, rooturl);
            return;
        }
        iteminfo = tkitem.Item;
        tklocation = iteminfo.Location;

        subcinfo = TaoBaos.GetCategoryInfoByCache(iteminfo.Cid.ToString());

        if (subcinfo != null)
        {
            //AddErrLine("您的页面正在跳转,请稍等!");
            //SetMetaRefresh(2, tkitem.ClickUrl);
            //return;
            rootinfo = TaoBaos.GetCategoryInfoByCache(subcinfo.Parentid);
            sameclassproducts = TaoBaos.GetRecommendProduct(Convert.ToInt16(TaoChanel.Detail), subcinfo.Cid);
        }
        shopname = iteminfo.Nick;
        shopscore = "100";
        shopurl = tkitem.ShopClickUrl;
        shopaddress = tklocation.State + tklocation.City;
        sdinfo = TaoBaos.GetTaoBaoShopInfoByNick(iteminfo.Nick);

        if (sdinfo != null)
        {
            shopname = sdinfo.title;
            shopproducts = sdinfo.relategoods;
            shopscore = (decimal.Round(decimal.Parse((((double)sdinfo.good_num / (double)sdinfo.total_num) * 100).ToString()), 2)).ToString();
            shopurl = "storeshow-" + sdinfo.sid + ".html";
            shopaddress = sdinfo.shop_province + sdinfo.shop_city;
        }

        pagetitle = string.Format("{0}-{0}商品详细介绍", iteminfo.Title);
        seokeyword = string.Format("{0}介绍,{0},{1}", iteminfo.Title, shopname);
        seodescription = string.Format("{0}商品详细介绍。{1}。", iteminfo.Title, Utils.CutString(Utils.RemoveHtml(Utils.StrFormat(iteminfo.Desc)).Trim(), 0, 60));

        string viewinfo = iid + "|" + Utils.UrlEncode(iteminfo.Title) + "|" + iteminfo.Price + "|" + iteminfo.PicUrl;
        string lastviewids = "," + Utils.GetCookie("goodviews") + ",";

        if (!lastviewids.Contains("," + viewinfo + ","))
        {
            if (Utils.GetCookie("goodviews").Split(',').Length > 10)
            {
                Utils.WriteCookie("goodviews", viewinfo + "," + Utils.GetCookie("goodviews").Remove(0, Utils.GetCookie("goodviews").Split(',')[0].Length), 1440);
            }
            else
            {
                Utils.WriteCookie("goodviews", viewinfo + "," + Utils.GetCookie("goodviews"), 1440);
            }
        }
    }