/// <summary>
 /// Adds the contents of another <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> to the end of the collection.
 /// </summary>
 /// <param name="value">A <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> containing the Components to add to the collection. </param>
 public void AddRange(ShoplinkinfoCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add((Shoplinkinfo)value.List[i]);
     }
 }
Exemple #2
0
 /// <summary>
 /// Adds the contents of another <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> to the end of the collection.
 /// </summary>
 /// <param name="value">A <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> containing the Components to add to the collection. </param>
 public void AddRange(ShoplinkinfoCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add((Shoplinkinfo)value.List[i]);
     }
 }
Exemple #3
0
        protected override void ShowPage()
        {
            if (userid == -1)
            {
                AddErrLine("你尚未登录");
                return;
            }

            if (config.Enablemall < 2)
            {
                AddErrLine("当前操作只有在开启商城(高级)模式时才可以使用!");
                return;
            }

            user = Users.GetUserInfo(userid);

            shopinfo = Shops.GetShopByUserId(user.Uid);

            shoplinkinfolist = ShopLinks.GetShopLinkByShopId(shopinfo.Shopid);
            //如果不是提交...
            if (ispost)
            { 
                string operation = DNTRequest.GetString("operation");

                if (operation == "")
                    operation = "add";

                switch (operation)
                {
                    case "add": //添加店铺友情链接
                        {
                            if (shoplinkinfolist.Count >= 16)
                            {
                                AddErrLine("目前系统允许您最多添加 20 个友情链接");
                                return;
                            }

                            string addusername = DNTRequest.GetString("username");
                            if (addusername == "")
                            {
                                AddErrLine("请输入店主姓名!");
                                return;
                            }

                            int adduserid = Users.GetUserId(addusername);
                            if (adduserid < 0)
                            {
                                AddErrLine("用户名不存在!");
                                return;
                            }
                            if (adduserid == userid)
                            {
                                AddErrLine("店主不能将本人店铺作为友情链接!");
                                return;
                            }

                            Shopinfo add_shopinfo = Shops.GetShopByUserId(Users.GetUserId(addusername));
                            if (add_shopinfo == null && add_shopinfo.Shopid <= 0)
                            {
                                AddErrLine("用户:" + addusername + " 未在本站开店,因此无法添加该友情链接");
                                return;
                            }

                            Shoplinkinfo shoplinkinfo = new Shoplinkinfo();
                            shoplinkinfo.Displayorder = 0;
                            shoplinkinfo.Name = add_shopinfo.Shopname;
                            shoplinkinfo.Linkshopid = add_shopinfo.Shopid;
                            shoplinkinfo.Shopid = shopinfo.Shopid;
                            ShopLinks.CreateShopLink(shoplinkinfo);
                            break;
                        }
                    case "delete": //删除店铺友情链接
                        {
                            string delshoplink = DNTRequest.GetString("shoplinkid");
                            if (delshoplink == "")
                            {
                                AddErrLine("您未选中友情链接");
                                return;
                            }
                            ShopLinks.DeleteShopLink(delshoplink);
                            break;
                        }
                    case "updatedisplayorder": //更新店铺友情链接显示顺序
                        {
                            foreach (Shoplinkinfo shoplinkinfo in shoplinkinfolist)
                            {
                                //当显示顺序值发生变化时,则更新相应的信息
                                if (shoplinkinfo.Displayorder != DNTRequest.GetInt("displayorder_" + shoplinkinfo.Id, 0))
                                {
                                    shoplinkinfo.Displayorder = DNTRequest.GetInt("displayorder_" + shoplinkinfo.Id, 0);
                                    ShopLinks.UpdateShopLink(shoplinkinfo);
                                }
                            }
                            break;
                        }
                }

                SetUrl("usercpshoplink.aspx");
                SetMetaRefresh();
                AddMsgLine("操作成功. <br />(<a href=\"usercpshoplink.aspx\">点击这里返回</a>)<br />");      
            }
        }
Exemple #4
0
             /// <summary>
            /// 获得店铺友情链接信息(DTO)
            /// </summary>
            /// <param name="__idatareader">要转换的数据</param>
            /// <returns>返回店铺友情链接信息</returns>
            public static ShoplinkinfoCollection GetShopLinkList(IDataReader reader)
            {
                ShoplinkinfoCollection shopLinkInfoColl = new ShoplinkinfoCollection();

                while (reader.Read())
                {
                    Shoplinkinfo shoplinkinfo = new Shoplinkinfo();
                    shoplinkinfo.Id = TypeConverter.ObjectToInt(reader["id"]);
                    shoplinkinfo.Displayorder = TypeConverter.ObjectToInt(reader["displayorder"]);
                    shoplinkinfo.Name = reader["name"].ToString().Trim();
                    shoplinkinfo.Linkshopid = TypeConverter.ObjectToInt(reader["linkshopid"]);
                    shoplinkinfo.Shopid = TypeConverter.ObjectToInt(reader["shopid"]);

                    shopLinkInfoColl.Add(shoplinkinfo);
                }
                reader.Close();
                return shopLinkInfoColl;
            }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> class containing the elements of the specified source collection.
 /// </summary>
 /// <param name="value">A <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> with which to initialize the collection.</param>
 public ShoplinkinfoCollection(ShoplinkinfoCollection value)
 {
     this.AddRange(value);
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref=" ShoplinkinfoCollectionEnumerator"> ShoplinkinfoCollectionEnumerator</see> class referencing the specified <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> object.
 /// </summary>
 /// <param name="mappings">The <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> to enumerate.</param>
 public ShoplinkinfoCollectionEnumerator(ShoplinkinfoCollection mappings)
 {
     _temp       = ((IEnumerable)(mappings));
     _enumerator = _temp.GetEnumerator();
 }
 public ShoplinkinfoCollectionEnumerator(ShoplinkinfoCollection mappings)
 {
     this._temp       = mappings;
     this._enumerator = this._temp.GetEnumerator();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> class containing the elements of the specified source collection.
 /// </summary>
 /// <param name="value">A <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> with which to initialize the collection.</param>
 public ShoplinkinfoCollection(ShoplinkinfoCollection value)
 {
     this.AddRange(value);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref=" ShoplinkinfoCollectionEnumerator"> ShoplinkinfoCollectionEnumerator</see> class referencing the specified <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> object.
 /// </summary>
 /// <param name="mappings">The <see cref=" ShoplinkinfoCollection"> ShoplinkinfoCollection</see> to enumerate.</param>
 public ShoplinkinfoCollectionEnumerator(ShoplinkinfoCollection mappings)
 {
     _temp = ((IEnumerable)(mappings));
     _enumerator = _temp.GetEnumerator();
 }