예제 #1
0
 protected override void AttachChildControls()
 {
     this.favorites               = (Common_Favorite_ProductList)this.FindControl("list_Common_Favorite_ProList");
     this.btnSearch               = ButtonManager.Create(this.FindControl("btnSearch"));
     this.txtKeyWord              = (TextBox)this.FindControl("txtKeyWord");
     this.pager                   = (Pager)this.FindControl("pager");
     this.btnDeleteSelect         = (LinkButton)this.FindControl("btnDeleteSelect");
     this.btnSearch.Click        += new EventHandler(this.btnSearch_Click);
     this.favorites._ItemCommand += new Common_Favorite_ProductList.CommandEventHandler(this.favorites_ItemCommand);
     this.btnDeleteSelect.Click  += new EventHandler(this.btnDeleteSelect_Click);
     PageTitle.AddSiteNameTitle("商品收藏夹", HiContext.Current.Context);
     if (!this.Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ProductId"]))
         {
             int result = 0;
             int.TryParse(this.Page.Request.QueryString["ProductId"], out result);
             if (!CommentsHelper.ExistsProduct(result) && !CommentsHelper.AddProductToFavorite(result))
             {
                 this.ShowMessage("添加商品到收藏夹失败", false);
             }
         }
         this.BindList();
     }
 }
예제 #2
0
파일: Favorites.cs 프로젝트: davinx/himedi
 protected override void AttachChildControls()
 {
     this.favorites = (Common_Favorite_ProductList) this.FindControl("list_Common_Favorite_ProList");
     this.btnSearch = ButtonManager.Create(this.FindControl("btnSearch"));
     this.txtKeyWord = (TextBox) this.FindControl("txtKeyWord");
     this.pager = (Pager) this.FindControl("pager");
     this.btnDeleteSelect = (LinkButton) this.FindControl("btnDeleteSelect");
     this.btnSearch.Click += new EventHandler(this.btnSearch_Click);
     this.favorites.ItemCommand += new Common_Favorite_ProductList.CommandEventHandler(this.favorites_ItemCommand);
     this.btnDeleteSelect.Click += new EventHandler(this.btnDeleteSelect_Click);
     PageTitle.AddSiteNameTitle("商品收藏夹", HiContext.Current.Context);
     if (!this.Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ProductId"]))
         {
             int result = 0;
             int.TryParse(this.Page.Request.QueryString["ProductId"], out result);
             if (!CommentsHelper.ExistsProduct(result) && !CommentsHelper.AddProductToFavorite(result))
             {
                 this.ShowMessage("添加商品到收藏夹失败", false);
             }
         }
         this.BindList();
     }
 }