protected override void AttachChildControls()
        {
            if (!int.TryParse(base.GetParameter("productId", false), out this.productId))
            {
                base.GotoResourceNotFound();
            }
            this.txtUserName         = (TextBox)this.FindControl("txtUserName");
            this.txtContent          = (TextBox)this.FindControl("txtContent");
            this.btnRefer            = ButtonManager.Create(this.FindControl("btnRefer"));
            this.txtConsultationCode = (HtmlInputText)this.FindControl("txtConsultationCode");
            this.prodetailsLink      = (ProductDetailsLink)this.FindControl("ProductDetailsLink1");
            this.btnRefer.Click     += this.btnRefer_Click;
            if (!this.Page.IsPostBack && HiContext.Current.UserId != 0)
            {
                this.txtUserName.Text = HiContext.Current.User.UserName;
                this.btnRefer.Text    = "咨询";
            }
            PageTitle.AddSiteNameTitle("商品咨询");
            ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);

            if (productSimpleInfo != null)
            {
                this.prodetailsLink.ProductId   = this.productId;
                this.prodetailsLink.ProductName = productSimpleInfo.ProductName;
            }
            this.txtConsultationCode.Value = string.Empty;
        }
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.txtEmail            = (TextBox)this.FindControl("txtEmail");
     this.txtUserName         = (TextBox)this.FindControl("txtUserName");
     this.txtContent          = (TextBox)this.FindControl("txtContent");
     this.btnRefer            = ButtonManager.Create(this.FindControl("btnRefer"));
     this.txtConsultationCode = (HtmlInputText)this.FindControl("txtConsultationCode");
     this.prodetailsLink      = (ProductDetailsLink)this.FindControl("ProductDetailsLink1");
     this.btnRefer.Click     += new EventHandler(this.btnRefer_Click);
     if (!this.Page.IsPostBack)
     {
         PageTitle.AddSiteNameTitle("商品咨询", HiContext.Current.Context);
         if ((HiContext.Current.User.UserRole == UserRole.Member) || (HiContext.Current.User.UserRole == UserRole.Underling))
         {
             this.txtUserName.Text = HiContext.Current.User.Username;
             this.txtEmail.Text    = HiContext.Current.User.Email;
             this.btnRefer.Text    = "咨询";
         }
         ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);
         if (productSimpleInfo != null)
         {
             this.prodetailsLink.ProductId   = this.productId;
             this.prodetailsLink.ProductName = productSimpleInfo.ProductName;
         }
         this.txtConsultationCode.Value = string.Empty;
     }
 }
 protected void rptProduct_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView          dataRowView          = (DataRowView)e.Item.DataItem;
         HtmlContainerControl htmlContainerControl = e.Item.Controls[0].FindControl("countDownBackGroundImage") as HtmlContainerControl;
         ProductDetailsLink   productDetailsLink   = e.Item.Controls[0].FindControl("ProductDetailsLink3") as ProductDetailsLink;
         Image image = e.Item.Controls[0].FindControl("imageOver") as Image;
         image.Visible = false;
         DateTime?nullable  = dataRowView["StartDate"].ToDateTime();
         DateTime?nullable2 = dataRowView["EndDate"].ToDateTime();
         int      num       = dataRowView["TotalCount"].ToInt(0);
         int      num2      = dataRowView["BoughtCount"].ToInt(0);
         if (htmlContainerControl != null && productDetailsLink != null)
         {
             string text     = "url(/Templates/pccommon/images/sub/buy/countdownpcover.png) no-repeat";
             string text2    = "url(/Templates/pccommon/images/sub/buy/countdownpcwill.png) no-repeat";
             string imageUrl = "/Templates/pccommon/images/sub/buy/countdownovertip.png";
             if (nullable.Value >= DateTime.Now)
             {
                 htmlContainerControl.Style.Add("background", "#66bb6a");
                 productDetailsLink.Text = "即将开始";
             }
             else if (nullable.Value <= DateTime.Now && nullable2.Value >= DateTime.Now && num <= num2)
             {
                 htmlContainerControl.Style.Add("background", "#b9b9b9");
                 productDetailsLink.Text = "已抢完";
                 image.ImageUrl          = imageUrl;
                 image.Visible           = true;
             }
         }
     }
 }
Exemple #4
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound();
     }
     this.txtEmail          = (System.Web.UI.WebControls.TextBox) this.FindControl("txtEmail");
     this.txtUserName       = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName");
     this.txtContent        = (System.Web.UI.WebControls.TextBox) this.FindControl("txtContent");
     this.btnRefer          = ButtonManager.Create(this.FindControl("btnRefer"));
     this.spReviewUserName  = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spReviewUserName");
     this.spReviewPsw       = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spReviewPsw");
     this.spReviewReg       = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("spReviewReg");
     this.txtReviewUserName = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtReviewUserName");
     this.txtReviewPsw      = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtReviewPsw");
     this.txtReviewCode     = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtReviewCode");
     this.productdetailLink = (ProductDetailsLink)this.FindControl("ProductDetailsLink1");
     this.btnRefer.Click   += new System.EventHandler(this.btnRefer_Click);
     if (!this.Page.IsPostBack)
     {
         PageTitle.AddSiteNameTitle("商品评论", Hidistro.Membership.Context.HiContext.Current.Context);
         if (Hidistro.Membership.Context.HiContext.Current.User.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member || Hidistro.Membership.Context.HiContext.Current.User.UserRole == Hidistro.Membership.Core.Enums.UserRole.Underling)
         {
             this.txtUserName.Text         = Hidistro.Membership.Context.HiContext.Current.User.Username;
             this.txtEmail.Text            = Hidistro.Membership.Context.HiContext.Current.User.Email;
             this.txtReviewUserName.Value  = string.Empty;
             this.txtReviewPsw.Value       = string.Empty;
             this.spReviewUserName.Visible = false;
             this.spReviewPsw.Visible      = false;
             this.spReviewReg.Visible      = false;
             this.btnRefer.Text            = "评论";
         }
         else
         {
             this.spReviewUserName.Visible = true;
             this.spReviewPsw.Visible      = true;
             this.spReviewReg.Visible      = true;
             this.btnRefer.Text            = "登录并评论";
         }
         this.txtReviewCode.Value = string.Empty;
         ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);
         if (productSimpleInfo != null)
         {
             this.productdetailLink.ProductId   = this.productId;
             this.productdetailLink.ProductName = productSimpleInfo.ProductName;
         }
     }
 }