Beispiel #1
0
 protected override void AttachChildControls()
 {
     int num;
     int num2;
     int num3;
     int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
     this.keyWord = this.Page.Request.QueryString["keyWord"];
     this.imgUrl = (HiImage) this.FindControl("imgUrl");
     this.litContent = (Literal) this.FindControl("litContent");
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptGroupBuyProducts");
     this.txtTotal = (HtmlInputHidden) this.FindControl("txtTotal");
     this.rptCategories = (VshopTemplatedRepeater) this.FindControl("rptCategories");
     if (this.rptCategories != null)
     {
         IList<CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 0x3e8);
         this.rptCategories.DataSource = maxSubCategories;
         this.rptCategories.DataBind();
     }
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 10;
     }
     this.rptProducts.DataSource = GroupBuyBrowser.GetGroupBuyProducts(new int?(this.categoryId), this.keyWord, num, num2, out num3, true);
     this.rptProducts.DataBind();
     this.txtTotal.SetWhenIsNotNull(num3.ToString());
     PageTitle.AddSiteNameTitle("团购搜索页");
 }
Beispiel #2
0
		public void Defaults ()
		{
			HtmlInputHidden h = new HtmlInputHidden ();

			Assert.AreEqual (h.Type, "hidden", "A1");
			Assert.AreEqual (h.Value, String.Empty, "A2");
		}
Beispiel #3
0
        protected override void AttachChildControls()
        {
            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.keyWord       = this.Page.Request.QueryString["keyWord"];
            this.imgUrl        = (HiImage)this.FindControl("imgUrl");
            this.litContent    = (System.Web.UI.WebControls.Literal) this.FindControl("litContent");
            this.rptProducts   = (VshopTemplatedRepeater)this.FindControl("rptCountDownProducts");
            this.txtTotal      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            if (this.rptCategories != null)
            {
                System.Collections.Generic.IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 1000);
                this.rptCategories.DataSource = maxSubCategories;
                this.rptCategories.DataBind();
            }
            int page;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out page))
            {
                page = 1;
            }
            int size;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out size))
            {
                size = 10;
            }
            int       num;
            DataTable countDownProductList = ProductBrowser.GetCountDownProductList(new int?(this.categoryId), this.keyWord, page, size, out num, true);

            this.rptProducts.DataSource = countDownProductList;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(num.ToString());
            PageTitle.AddSiteNameTitle("限时抢购");
        }
Beispiel #4
0
 private void FindControls()
 {
     this.rptProductImages      = (WapTemplatedRepeater)this.FindControl("rptProductImages");
     this.litProdcutName        = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
     this.litShortDescription   = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
     this.litDescription        = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription");
     this.litSoldCount          = (System.Web.UI.WebControls.Literal) this.FindControl("soldCount");
     this.litprice              = (System.Web.UI.WebControls.Literal) this.FindControl("price");
     this.litcontent            = (System.Web.UI.WebControls.Literal) this.FindControl("content");
     this.litminCount           = (System.Web.UI.WebControls.Literal) this.FindControl("minCount");
     this.litGroupBuyId         = (System.Web.UI.HtmlControls.HtmlInputControl) this.FindControl("litGroupbuyId");
     this.litLeftSeconds        = (System.Web.UI.WebControls.Literal) this.FindControl("leftSeconds");
     this.skuSelector           = (Common_SKUSelector)this.FindControl("skuSelector");
     this.linkDescription       = (System.Web.UI.WebControls.HyperLink) this.FindControl("linkDescription");
     this.expandAttr            = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
     this.salePrice             = (System.Web.UI.WebControls.Literal) this.FindControl("salePrice");
     this.leftCount             = (System.Web.UI.WebControls.Literal) this.FindControl("leftCount");
     this.minSuccessCount       = (System.Web.UI.WebControls.Literal) this.FindControl("minSuccessCount");
     this.txtProductId          = (System.Web.UI.HtmlControls.HtmlInputControl) this.FindControl("txtProductId");
     this.litConsultationsCount = (System.Web.UI.WebControls.Literal) this.FindControl("litConsultationsCount");
     this.litReviewsCount       = (System.Web.UI.WebControls.Literal) this.FindControl("litReviewsCount");
     this.litMaxCount           = (System.Web.UI.WebControls.Literal) this.FindControl("litMaxCount");
     this.startTime             = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("startTime");
     this.endTime                = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("endTime");
     this.groupBuySoldCount      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("groupBuySoldCount");
     this.groupBuyMinCount       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("groupBuyMinCount");
     this.litGroupbuyDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litGroupbuyDescription");
     this.groupBuyMaxCount       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("groupBuyMaxCount");
 }
Beispiel #5
0
    private String saveImage(FileUpload fileupload, System.Web.UI.HtmlControls.HtmlInputHidden inputc)
    {
        try
        {
            if (fileupload.PostedFile.ContentLength > 5048576 || fileupload.PostedFile.ContentLength == 0)
            {
                if (inputc.Value != "")
                {
                    return(inputc.Value.Substring(13));
                }

                return("");
            }
            else
            {
                string strBaseLoactionImg = Server.MapPath(System.Configuration.ConfigurationSettings.AppSettings["SLIDERIMAGE"].ToString());

                string sFileName = "0-" + DateTime.Now.ToString("dd-MM-yyy hh-mm-ss-fffffff-");
                string strEx     = System.IO.Path.GetFileName(fileupload.PostedFile.FileName);
                //strEx = strEx.Substring(strEx.LastIndexOf("."), strEx.Length - strEx.LastIndexOf("."));
                strBaseLoactionImg += sFileName + strEx;
                strBaseLoactionImg  = strBaseLoactionImg.Replace("/", "\\");
                fileupload.PostedFile.SaveAs(strBaseLoactionImg);

                inputc.Value = "/Images/News/" + sFileName + strEx;
                return(sFileName + strEx);
            }
        }
        catch //(Exception ex)
        {
            //this.lblMsg.Text = ex.Message; //HttpContext.Current.Response.Write(ex.Message);
            return("");
        }
    }
Beispiel #6
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["BrandId"], out this.BrandId))
            {
                base.GotoResourceNotFound("");
            }
            this.imgUrl         = (HiImage)this.FindControl("imgUrl");
            this.rptProducts    = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.litBrandDetail = (System.Web.UI.WebControls.Literal) this.FindControl("litBrandDetail");
            this.txtTotal       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            BrandCategoryInfo brandCategory = CategoryBrowser.GetBrandCategory(this.BrandId);

            this.litBrandDetail.SetWhenIsNotNull(brandCategory.Description);
            this.imgUrl.ImageUrl = brandCategory.Logo;
            int pageNumber;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageNumber))
            {
                pageNumber = 1;
            }
            int maxNum;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out maxNum))
            {
                maxNum = 20;
            }
            int num;

            this.rptProducts.DataSource = ProductBrowser.GetBrandProducts(MemberProcessor.GetCurrentMember(), new int?(this.BrandId), pageNumber, maxNum, out num);
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(num.ToString());
            PageTitle.AddSiteNameTitle("品牌详情");
        }
 protected override void AttachChildControls()
 {
     int num;
     int num2;
     MemberInfo currentMember = MemberProcessor.GetCurrentMember();
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     this.txtTotal = (HtmlInputHidden) this.FindControl("txtTotal");
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 20;
     }
     ProductConsultationAndReplyQuery consultationQuery = new ProductConsultationAndReplyQuery {
         UserId = currentMember.UserId,
         IsCount = true,
         PageIndex = num,
         PageSize = num2,
         SortBy = "ConsultationId",
         SortOrder = SortAction.Desc
     };
     DbQueryResult productConsultations = ProductBrowser.GetProductConsultations(consultationQuery);
     this.rptProducts.DataSource = productConsultations.Data;
     this.rptProducts.DataBind();
     this.txtTotal.SetWhenIsNotNull(productConsultations.TotalRecords.ToString());
     PageTitle.AddSiteNameTitle("商品咨询");
 }
Beispiel #8
0
        protected override void AttachChildControls()
        {
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember != null)
            {
                System.Web.UI.WebControls.Literal          control  = (System.Web.UI.WebControls.Literal) this.FindControl("txtUserBindName");
                System.Web.UI.HtmlControls.HtmlInputText   control2 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtRealName");
                System.Web.UI.HtmlControls.HtmlInputText   control3 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtPhone");
                System.Web.UI.HtmlControls.HtmlInputText   control4 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtEmail");
                System.Web.UI.HtmlControls.HtmlInputHidden control5 = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtUserName");
                System.Web.UI.HtmlControls.HtmlInputText   control6 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtCardID");
                this.imglogo    = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imglogo");
                this.Nickname   = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("Nickname");
                this.WeixinHead = (System.Web.UI.HtmlControls.HtmlControl) this.FindControl("WeixinHead");
                if (!string.IsNullOrEmpty(currentMember.UserHead))
                {
                    this.imglogo.Src = currentMember.UserHead;
                }
                this.Nickname.InnerText = currentMember.UserName;
                if (string.IsNullOrEmpty(currentMember.OpenId))
                {
                    this.WeixinHead.Attributes.Add("noOpenId", "true");
                }
                control.SetWhenIsNotNull(currentMember.UserBindName);
                control5.SetWhenIsNotNull(currentMember.UserName);
                control2.SetWhenIsNotNull(currentMember.RealName);
                control3.SetWhenIsNotNull(currentMember.CellPhone);
                control4.SetWhenIsNotNull(currentMember.QQ);
                control6.SetWhenIsNotNull(currentMember.CardID);
            }
            PageTitle.AddSiteNameTitle("修改用户信息");
        }
Beispiel #9
0
        protected override void AttachChildControls()
        {
            this.txtTotal      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.txtShowTabNum = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtShowTabNum");
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 10;
            }
            OrderQuery orderQuery = new OrderQuery();

            orderQuery.PageIndex = pageIndex;
            orderQuery.PageSize  = pageSize;
            orderQuery.SortBy    = "OrderDate";
            orderQuery.SortOrder = SortAction.Desc;
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(Globals.GetCurrentMemberUserId(false));

            if (userIdDistributors == null)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else if (userIdDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                this.vshoporders  = (VshopTemplatedRepeater)this.FindControl("vshoporders");
                this.litfinishnum = (System.Web.UI.WebControls.Literal) this.FindControl("litfinishnum");
                this.litallnum    = (System.Web.UI.WebControls.Literal) this.FindControl("litallnum");
                PageTitle.AddSiteNameTitle("店铺订单");
                int num = 0;
                int.TryParse(System.Web.HttpContext.Current.Request.QueryString.Get("status"), out num);
                orderQuery.UserId = new int?(Globals.GetCurrentMemberUserId(false));
                if (num != 5)
                {
                    orderQuery.Status      = OrderStatus.Finished;
                    this.litfinishnum.Text = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                    orderQuery.Status      = OrderStatus.All;
                    this.litallnum.Text    = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                }
                else
                {
                    this.litallnum.Text    = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                    orderQuery.Status      = OrderStatus.Finished;
                    this.litfinishnum.Text = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                }
                this.vshoporders.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.vshoporders_ItemDataBound);
                DataSet distributorOrder = DistributorsBrower.GetDistributorOrder(orderQuery);
                this.vshoporders.DataSource = distributorOrder;
                this.vshoporders.DataBind();
            }
        }
Beispiel #10
0
		/// <summary>Creates the hidden field control that stores the challenge ID.</summary>
		protected override void CreateChildControls()
		{
			_hiddenData = new HtmlInputHidden();
			_hiddenData.EnableViewState = false;
			Controls.Add(_hiddenData);
			base.CreateChildControls();
		}
Beispiel #11
0
        protected override void AttachChildControls()
        {
            this.litShipTo    = (System.Web.UI.WebControls.Literal) this.FindControl("litShipTo");
            this.litCellPhone = (System.Web.UI.WebControls.Literal) this.FindControl("litCellPhone");
            this.litAddress   = (System.Web.UI.WebControls.Literal) this.FindControl("litAddress");
            this.rptAddress   = (VshopTemplatedRepeater)this.FindControl("rptAddress");
            System.Collections.Generic.IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses();
            this.rptAddress.DataSource = from item in shippingAddresses
                                         orderby item.IsDefault
                                         select item;

            this.rptAddress.DataBind();
            this.litAddAddress = (System.Web.UI.WebControls.Literal) this.FindControl("litAddAddress");
            this.selectShipTo  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("selectShipTo");
            this.regionId      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("regionId");
            ShippingAddressInfo shippingAddressInfo = shippingAddresses.FirstOrDefault((ShippingAddressInfo item) => item.IsDefault);

            if (shippingAddressInfo == null)
            {
                shippingAddressInfo = ((shippingAddresses.Count > 0) ? shippingAddresses[0] : null);
            }
            if (shippingAddressInfo != null)
            {
                this.litShipTo.Text    = shippingAddressInfo.ShipTo;
                this.litCellPhone.Text = shippingAddressInfo.CellPhone;
                this.litAddress.Text   = shippingAddressInfo.Address;
                this.selectShipTo.SetWhenIsNotNull(shippingAddressInfo.ShippingId.ToString());
                this.regionId.SetWhenIsNotNull(shippingAddressInfo.RegionId.ToString());
            }
            this.litAddAddress.Text = " href='/Vshop/AddShippingAddress.aspx?returnUrl=" + Globals.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()) + "'";
            PageTitle.AddSiteNameTitle("中奖记录");
        }
Beispiel #12
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("下级分销商");
            this.rpdistributor = (VshopTemplatedRepeater)this.FindControl("rpdistributor");
            this.hiddTotal     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddTotal");
            DistributorsQuery distributorsQuery = new DistributorsQuery();

            distributorsQuery.PageIndex = 0;
            distributorsQuery.PageSize  = 10;
            DistributorsInfo currentDistributors = DistributorsBrower.GetCurrentDistributors(Globals.GetCurrentMemberUserId(), true);

            if (currentDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                distributorsQuery.GradeId = 3;
                int userId = 0;
                if (int.TryParse(this.Page.Request.QueryString["UserId"], out userId))
                {
                    distributorsQuery.UserId = userId;
                }
                distributorsQuery.ReferralPath = userId.ToString();
                int       num = 0;
                DataTable threeDistributors = DistributorsBrower.GetThreeDistributors(distributorsQuery, out num);
                this.hiddTotal.Value          = num.ToString();
                this.rpdistributor.DataSource = threeDistributors;
                this.rpdistributor.DataBind();
            }
        }
Beispiel #13
0
        protected override void AttachChildControls()
        {
            Member member = HiContext.Current.User as Member;

            if (member != null)
            {
                this.rptProducts = (AppshopTemplatedRepeater)this.FindControl("rptProducts");
                this.txtTotal    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
                int pageIndex;
                if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
                {
                    pageIndex = 1;
                }
                int pageSize;
                if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
                {
                    pageSize = 20;
                }
                DbQueryResult productConsultations = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery
                {
                    UserId    = member.UserId,
                    IsCount   = true,
                    PageIndex = pageIndex,
                    PageSize  = pageSize,
                    SortBy    = "ConsultationId",
                    SortOrder = SortAction.Desc
                });
                this.rptProducts.DataSource = productConsultations.Data;
                this.rptProducts.DataBind();
                this.txtTotal.SetWhenIsNotNull(productConsultations.TotalRecords.ToString());
            }
            PageTitle.AddSiteNameTitle("商品咨询");
        }
Beispiel #14
0
        protected override void AttachChildControls()
        {
            this.txtTotal      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.txtShowTabNum = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtShowTabNum");
            PageTitle.AddSiteNameTitle("评价列表");
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 10;
            }
            OrderQuery orderQuery = new OrderQuery();

            orderQuery.PageIndex = pageIndex;
            orderQuery.PageSize  = pageSize;
            orderQuery.SortBy    = "Id";
            orderQuery.SortOrder = SortAction.Desc;
            int currentMemberUserId = Globals.GetCurrentMemberUserId(false);
            int orderItemsStatus    = 5;

            this.rptOrderItemList = (VshopTemplatedRepeater)this.FindControl("rptOrderItemList");
            DbQueryResult orderMemberComment = ProductBrowser.GetOrderMemberComment(orderQuery, currentMemberUserId, orderItemsStatus);

            this.rptOrderItemList.DataSource = orderMemberComment.Data;
            this.rptOrderItemList.DataBind();
            this.txtTotal.SetWhenIsNotNull(orderMemberComment.TotalRecords.ToString());
        }
 public HiddenWebQuestion(string strId)
     : base(strId, "hidden")
 {
     this.m_hiddenInput = new HtmlInputHidden();
     this.Controls.Add(this.m_hiddenInput);
     this.m_hiddenInput.ID = "hidden_" + strId;
 }
Beispiel #16
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["voteId"], out this.voteId))
            {
                base.GotoResourceNotFound("");
            }
            this.litVoteName  = (System.Web.UI.WebControls.Literal) this.FindControl("litVoteName");
            this.litVoteNum   = (System.Web.UI.WebControls.Literal) this.FindControl("litVoteNum");
            this.rptVoteItems = (VshopTemplatedRepeater)this.FindControl("rptVoteItems");
            this.hidCheckNum  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidCheckNum");
            this.divVoteOk    = (System.Web.UI.HtmlControls.HtmlGenericControl) this.FindControl("divVoteOk");
            string    empty = string.Empty;
            int       num   = 1;
            DataTable vote  = VshopBrowser.GetVote(this.voteId, out empty, out num, out this.voteNum);

            if (vote == null)
            {
                base.GotoResourceNotFound("");
            }
            this.LoadVoteItemTable(vote);
            this.rptVoteItems.DataSource = vote;
            this.rptVoteItems.DataBind();
            this.litVoteName.Text  = empty;
            this.hidCheckNum.Value = num.ToString();
            this.litVoteNum.Text   = string.Format("共有{0}人参与投票", this.voteNum);
            if (VshopBrowser.IsVote(this.voteId))
            {
                System.Web.UI.WebControls.Literal expr_158 = this.litVoteNum;
                expr_158.Text         += "(您已投票)";
                this.divVoteOk.Visible = false;
            }
            PageTitle.AddSiteNameTitle("投票调查");
        }
Beispiel #17
0
		public void PropertiesNull ()
		{
			HtmlInputHidden h = new HtmlInputHidden ();

			h.Value = null;
			Assert.AreEqual (h.Value, String.Empty, "A1");
		}
        protected void Page_Load( Object sender, EventArgs e )
        {
            // set page title
            string strTitle = PortalSettings.PortalName + " > Insert Link";

            // show copyright credits?
            if( Globals.GetHashValue( Globals.HostSettings["Copyright"], "Y" ) == "Y" )
            {
                strTitle += " ( DNN " + PortalSettings.Version + " )";
            }
            Title = strTitle;

            HtmlInputHidden htmlhidden = new HtmlInputHidden();
            PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings();

            htmlhidden.ID = "TargetFreeTextBox";
            htmlhidden.Value = Request.Params["ftb"];
            phHidden.Controls.Add( htmlhidden );

            htmlhidden = new HtmlInputHidden();
            htmlhidden.ID = "DNNDomainNameTabid";
            htmlhidden.Value = "http://" + Globals.GetDomainName( Request ) + "/" + Globals.glbDefaultPage + "?tabid=";
            phHidden.Controls.Add( htmlhidden );

            htmlhidden = new HtmlInputHidden();
            htmlhidden.ID = "DNNDomainNameFilePath";
            htmlhidden.Value = "http://" + Globals.GetDomainName( Request ) + _portalSettings.HomeDirectory.Replace( Request.ApplicationPath, "" );
            phHidden.Controls.Add( htmlhidden );
        }
Beispiel #19
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["voteId"], out this.voteId))
     {
         base.GotoResourceNotFound("");
     }
     this.litVoteName = (Literal) this.FindControl("litVoteName");
     this.litVoteNum = (Literal) this.FindControl("litVoteNum");
     this.rptVoteItems = (VshopTemplatedRepeater) this.FindControl("rptVoteItems");
     this.hidCheckNum = (HtmlInputHidden) this.FindControl("hidCheckNum");
     this.divVoteOk = (HtmlGenericControl) this.FindControl("divVoteOk");
     string voteName = string.Empty;
     int checkNum = 1;
     DataTable table = VshopBrowser.GetVote(this.voteId, out voteName, out checkNum, out this.voteNum);
     if (table == null)
     {
         base.GotoResourceNotFound("");
     }
     this.LoadVoteItemTable(table);
     this.rptVoteItems.DataSource = table;
     this.rptVoteItems.DataBind();
     this.litVoteName.Text = voteName;
     this.hidCheckNum.Value = checkNum.ToString();
     this.litVoteNum.Text = string.Format("共有{0}人参与投票", this.voteNum);
     if (VshopBrowser.IsVote(this.voteId))
     {
         this.litVoteNum.Text = this.litVoteNum.Text + "(您已投票)";
         this.divVoteOk.Visible = false;
     }
     PageTitle.AddSiteNameTitle("投票调查");
 }
Beispiel #20
0
 protected override void AttachChildControls()
 {
     int num;
     int num2;
     int num3;
     if (!int.TryParse(this.Page.Request.QueryString["BrandId"], out this.BrandId))
     {
         base.GotoResourceNotFound("");
     }
     this.imgUrl = (HiImage) this.FindControl("imgUrl");
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     this.litBrandDetail = (Literal) this.FindControl("litBrandDetail");
     this.txtTotal = (HtmlInputHidden) this.FindControl("txtTotal");
     BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(this.BrandId);
     this.litBrandDetail.SetWhenIsNotNull(brandCategory.Description);
     this.imgUrl.ImageUrl = brandCategory.Logo;
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 20;
     }
     this.rptProducts.DataSource = ProductBrowser.GetBrandProducts(MemberProcessor.GetCurrentMember(), new int?(this.BrandId), num, num2, out num3);
     this.rptProducts.DataBind();
     this.txtTotal.SetWhenIsNotNull(num3.ToString());
     PageTitle.AddSiteNameTitle("品牌详情");
 }
Beispiel #21
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            _tagsList = new HtmlInputHidden();
            _tagsList.Name = "alltags";
            _tagsList.ID = "alltags";

            StringBuilder tagList = new StringBuilder();
            Dictionary<string, bool> renderedTags = new Dictionary<string, bool>();
            foreach (Tag tag in TagCollection.FetchAll())
            {
                if (!renderedTags.ContainsKey(tag.Name))
                {
                    if (tagList.Length > 0)
                        tagList.Append("&");

                    tagList.Append(HttpUtility.UrlEncode(HttpUtility.HtmlDecode(tag.Name)));
                    tagList.Append("&");
                    tagList.Append(HttpUtility.UrlEncode(tag.Name));

                    renderedTags[tag.Name] = true;
                }
            }
            _tagsList.Value = tagList.ToString();

            this.Controls.Add(_tagsList);

            this.EnsureID();
        }
        protected void Page_Load( Object sender, EventArgs e )
        {
            // set page title
            string strTitle = PortalSettings.PortalName + " > Insert Smiley";

            // show copyright credits?
            if( Globals.GetHashValue( Globals.HostSettings["Copyright"], "Y" ) == "Y" )
            {
                strTitle += " ( DNN " + PortalSettings.Version + " )";
            }
            Title = strTitle;

            HtmlInputHidden htmlhidden = new HtmlInputHidden();

            htmlhidden.ID = "TargetFreeTextBox";
            htmlhidden.Value = Request.Params["ftb"];
            phHidden.Controls.Add( htmlhidden );

            //Get Host level Smileys
            string strSmileyPath = Globals.HostPath + "Smileys/";
            string strSmileyMapPath = Globals.HostMapPath + "Smileys\\";

            DirectoryInfo folder = new DirectoryInfo( strSmileyMapPath );
            FileInfo[] arrFiles = folder.GetFiles();
            lstSmileys.DataSource = arrFiles;
            lstSmileys.DataBind();
        }
Beispiel #23
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺消息");
            this.imglogo        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imglogo");
            this.hdlogo         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hdlogo");
            this.txtstorename   = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtstorename");
            this.txtdescription = (System.Web.UI.HtmlControls.HtmlTextArea) this.FindControl("txtdescription");
            this.txtacctount    = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtacctount");
            this.txtStoreTel    = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtStoreTel");
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(Globals.GetCurrentMemberUserId());

            if (userIdDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                if (userIdDistributors != null)
                {
                    if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                    {
                        this.imglogo.Src = userIdDistributors.Logo;
                    }
                    this.hdlogo.Value         = userIdDistributors.Logo;
                    this.txtstorename.Value   = userIdDistributors.StoreName;
                    this.txtdescription.Value = userIdDistributors.StoreDescription;
                    this.txtacctount.Value    = userIdDistributors.RequestAccount;
                    this.txtStoreTel.Value    = currentMember.CellPhone;
                }
            }
        }
Beispiel #24
0
        protected override void AttachChildControls()
        {
            this.litIsEnable = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litIsEnable");
            this.litRMsg     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litRMsg");
            this.litApplicationDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litApplicationDescription");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            this.litApplicationDescription.Text = System.Web.HttpUtility.HtmlDecode(masterSettings.DistributorDescription);
            PageTitle.AddSiteNameTitle("分销说明信息");
            this.Page.Session["stylestatus"] = "2";
            int currentMemberUserId             = Globals.GetCurrentMemberUserId();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            if (userIdDistributors != null)
            {
                this.IsEnable = "1";
            }
            else
            {
                int        finishedOrderMoney = masterSettings.FinishedOrderMoney;
                MemberInfo currentMember      = MemberProcessor.GetCurrentMember();
                this.RMsg = string.Format(this.RMsg, finishedOrderMoney, currentMember.Expenditure);
                if (currentMember.Expenditure >= finishedOrderMoney)
                {
                    this.IsEnable = "2";
                }
            }
            this.litIsEnable.Value = this.IsEnable;
            this.litRMsg.Value     = this.RMsg;
        }
Beispiel #25
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("砍价活动");
            this.rpMyMemberList = (VshopTemplatedRepeater)this.FindControl("rpBargainList");
            this.hiddTotal      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddTotal");
            this.hiddPageIndex  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddPageIndex");
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 10;
            }
            int          num          = Globals.RequestQueryNum("status");
            BargainQuery bargainQuery = new BargainQuery();

            bargainQuery.Type      = num.ToString();
            bargainQuery.PageSize  = pageSize;
            bargainQuery.PageIndex = pageIndex;
            int           total       = BargainHelper.GetTotal(bargainQuery);
            DbQueryResult bargainList = BargainHelper.GetBargainList(bargainQuery);

            this.hiddTotal.Value           = ((DataTable)bargainList.Data).Rows.Count.ToString();
            this.hiddPageIndex.Value       = pageIndex.ToString();
            this.rpMyMemberList.DataSource = bargainList.Data;
            this.rpMyMemberList.DataBind();
        }
Beispiel #26
0
        protected override void AttachChildControls()
        {
            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.keyWord = this.Page.Request.QueryString["keyWord"];
            //this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.litCategoryId = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litCategoryId");
            this.litCategoryId.SetWhenIsNotNull(this.categoryId.ToString());


            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember == null)
            {
                this.Page.Response.Redirect("UserLogin.aspx");
            }
            HttpCookie cookie         = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
            int        ReferralUserId = 0;

            if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
            {
                ReferralUserId = Convert.ToInt32(cookie.Value);
            }

            Hidistro.Core.HiCache.Remove("DataCache-CategoriesRange");//清除分类缓存
            //获取手机端所有商品的分类
            DataTable dt = CategoryBrowser.GetCategoriesByRange(2);

            this.rptCategories.DataSource = dt;
            this.rptCategories.DataBind();
        }
Beispiel #27
0
 /// <summary>
 /// 构造函数。
 /// </summary>
 public PickerBase()
     : base()
 {
     this.Width = new Unit("200px");
     this.txtText = new TextBox();
     this.txtValue = new HtmlInputHidden();
 }
Beispiel #28
0
 protected override void AttachChildControls()
 {
     int num;
     int num2;
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound("");
     }
     this.litProdcutName = (Literal) this.FindControl("litProdcutName");
     this.litSalePrice = (Literal) this.FindControl("litSalePrice");
     this.litShortDescription = (Literal) this.FindControl("litShortDescription");
     this.litSoldCount = (Literal) this.FindControl("litSoldCount");
     this.productImage = (HtmlImage) this.FindControl("productImage");
     this.productLink = (HyperLink) this.FindControl("productLink");
     this.txtTotal = (HtmlInputHidden) this.FindControl("txtTotal");
     string str = this.Page.Request["OrderId"];
     string str2 = "";
     if (!string.IsNullOrEmpty(str))
     {
         OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(str);
         if ((orderInfo != null) && (orderInfo.ReferralUserId > 0))
         {
             str2 = "&&ReferralId=" + orderInfo.ReferralUserId;
         }
     }
     else if (Globals.GetCurrentDistributorId() > 0)
     {
         str2 = "&&ReferralId=" + Globals.GetCurrentDistributorId().ToString();
     }
     ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);
     this.litProdcutName.SetWhenIsNotNull(product.ProductName);
     this.litSalePrice.SetWhenIsNotNull(product.MinSalePrice.ToString("F2"));
     this.litShortDescription.SetWhenIsNotNull(product.ShortDescription);
     this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
     this.productImage.Src = product.ThumbnailUrl180;
     this.productLink.NavigateUrl = "ProductDetails.aspx?ProductId=" + product.ProductId + str2;
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 20;
     }
     ProductReviewQuery reviewQuery = new ProductReviewQuery {
         productId = this.productId,
         IsCount = true,
         PageIndex = num,
         PageSize = num2,
         SortBy = "ReviewId",
         SortOrder = SortAction.Desc
     };
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     DbQueryResult productReviews = ProductBrowser.GetProductReviews(reviewQuery);
     this.rptProducts.DataSource = productReviews.Data;
     this.rptProducts.DataBind();
     this.txtTotal.SetWhenIsNotNull(productReviews.TotalRecords.ToString());
     PageTitle.AddSiteNameTitle("商品评价");
 }
Beispiel #29
0
        protected override void AttachChildControls()
        {
            this.lbCouponValue        = (HiLiteral)this.FindControl("lbCouponValue");
            this.lbCouponTj           = (HiLiteral)this.FindControl("lbCouponTj");
            this.lbBeginTime          = (HiLiteral)this.FindControl("lbBeginTime");
            this.lbEndTime            = (HiLiteral)this.FindControl("lbEndTime");
            this.lbCounponValue1      = (HiLiteral)this.FindControl("lbCounponValue1");
            this.lbCouponTj1          = (HiLiteral)this.FindControl("lbCouponTj1");
            this.lbLeftCount          = (HiLiteral)this.FindControl("lbLeftCount");
            this.lbCouponUseCount     = (HiLiteral)this.FindControl("lbCouponUseCount");
            this.lbCouponUsedShopBook = (HiLiteral)this.FindControl("lbCouponUsedShopBook");
            this.lbCouponDateTime     = (HiLiteral)this.FindControl("lbCouponDateTime");
            this.lbCouponName         = (HiLiteral)this.FindControl("lbCouponName");
            this.hideImgUrl           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideImgUrl");
            this.hideDesc             = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideDesc");
            CouponInfo coupon = CouponHelper.GetCoupon(this.couponId);

            if (coupon != null)
            {
                System.Uri url = System.Web.HttpContext.Current.Request.Url;
                string     str = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                this.hideImgUrl.Value      = str + "/Utility/pics/coupon.png";
                this.hideDesc.Value        = "面值:" + coupon.CouponValue.ToString("n0") + "元,活动时间:" + string.Format("{0:yyyy-MM-dd}~{1:yyyy-MM-dd}", coupon.BeginDate, coupon.EndDate);
                this.htmlTitle             = coupon.CouponName;
                this.lbCouponValue.Text    = coupon.CouponValue.ToString("n0");
                this.lbCounponValue1.Text  = coupon.CouponValue.ToString("n0");
                this.lbBeginTime.Text      = coupon.BeginDate.ToString("yyyy-MM-dd HH:mm:ss");
                this.lbEndTime.Text        = coupon.EndDate.ToString("yyyy-MM-dd HH:mm:ss");
                this.lbLeftCount.Text      = (coupon.StockNum - coupon.ReceiveNum).ToString();
                this.lbCouponUseCount.Text = coupon.maxReceivNum.ToString();
                this.lbCouponName.Text     = coupon.CouponName;
                if (coupon.IsAllProduct)
                {
                    this.lbCouponUsedShopBook.Text = "适应任意商品";
                }
                else
                {
                    this.lbCouponUsedShopBook.Text = string.Format("部分商品参与<a href=\"../productList.aspx?pIds={0}\">查看活动商品</a>", CouponHelper.GetCouponProductIds(coupon.CouponId));
                }
                string text;
                if (coupon.ConditionValue > 0m)
                {
                    text = string.Format("订单满{0:n0}", coupon.ConditionValue);
                }
                else
                {
                    text = "直";
                }
                text = string.Format("{0}减{1:n0}", text, coupon.CouponValue);
                this.lbCouponTj.Text       = text;
                this.lbCouponTj1.Text      = text;
                this.lbCouponDateTime.Text = string.Format("{0:yyyy-MM-dd}~{1:yyyy-MM-dd}", coupon.BeginDate, coupon.EndDate);
            }
            else
            {
                base.GotoResourceNotFound("");
            }
            PageTitle.AddSiteNameTitle(this.htmlTitle);
        }
Beispiel #30
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("余额明细");
            int num = Globals.RequestQueryNum("type");

            System.Web.UI.HtmlControls.HtmlInputHidden htmlInputHidden = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidType");
            htmlInputHidden.Value = num.ToString();
        }
Beispiel #31
0
        public IEnumerable<object> Render(PanelItem panelItem)
        {
            HtmlInputHidden hidden = new HtmlInputHidden {ID = panelItem.GetId()};

            panelItem.Target = hidden;

            return new object[] { hidden };
        }
Beispiel #32
0
        protected override void AttachChildControls()
        {
            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.txtCategoryName = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtCategoryName");
            this.txtCategoryId   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtCategoryId");
            this.keyWord         = this.Page.Request.QueryString["keyWord"];
            if (!string.IsNullOrWhiteSpace(this.keyWord))
            {
                this.keyWord = this.keyWord.Trim();
            }
            this.rptArticles   = (VshopTemplatedRepeater)this.FindControl("rptArticles");
            this.txtTotalPages = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 20;
            }
            ArticleQuery articleQuery = new ArticleQuery();

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["CategoryId"]))
            {
                int value = 0;
                if (int.TryParse(this.Page.Request.QueryString["CategoryId"], out value))
                {
                    ArticleCategoryInfo articleCategory = CommentBrowser.GetArticleCategory(value);
                    if (articleCategory != null)
                    {
                        PageTitle.AddSiteNameTitle(articleCategory.Name);
                        articleQuery.CategoryId    = new int?(value);
                        this.txtCategoryId.Value   = value.ToString();
                        this.txtCategoryName.Value = articleCategory.Name;
                    }
                    else
                    {
                        PageTitle.AddSiteNameTitle("文章分类搜索页");
                    }
                }
            }
            articleQuery.Keywords  = this.keyWord;
            articleQuery.PageIndex = pageIndex;
            articleQuery.PageSize  = pageSize;
            articleQuery.SortBy    = "AddedDate";
            articleQuery.SortOrder = SortAction.Desc;
            DbQueryResult articleList = CommentBrowser.GetArticleList(articleQuery);

            this.rptArticles.DataSource = articleList.Data;
            this.rptArticles.DataBind();
            int totalRecords = articleList.TotalRecords;

            this.txtTotalPages.SetWhenIsNotNull(totalRecords.ToString());
        }
        private static MvcHtmlString GoogleMap(HtmlHelper helper, string id, Models.Map map, bool editor)
        {
            StringBuilder sbControlHtml = new StringBuilder();
            using (StringWriter stringWriter = new StringWriter())
            {
                using (HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter))
                {
                    //Generate container div control
                    HtmlGenericControl divWrapperControl = new HtmlGenericControl("div");
                    HtmlGenericControl divMapControl = new HtmlGenericControl("div");
                    divMapControl.Attributes.Add("class", "map-container");
                    divMapControl.Attributes.Add("id", string.Format("map-{0}", id));
                    if (map.height > 0 || map.width > 0)
                    {
                        string widthStyle = "width:{0}px;";
                        if (map.width > 0)
                        {
                            widthStyle = string.Format(widthStyle, map.width);
                        }
                        else
                        {
                            widthStyle = string.Empty;
                        }

                        string heightStyle = "height:{0}px;";
                        if (map.height > 0)
                        {
                            heightStyle = string.Format(heightStyle, map.height);
                        }
                        else
                        {
                            heightStyle = string.Empty;
                        }

                        divMapControl.Attributes.Add("style", string.Concat(widthStyle, heightStyle));
                    }

                    divWrapperControl.Controls.Add(divMapControl);

                    //value input control
                    HtmlInputHidden hidden = new HtmlInputHidden();
                    HtmlInputHidden hiddenValueControl = new HtmlInputHidden();
                    hiddenValueControl.ID = id;
                    divWrapperControl.Controls.Add(hiddenValueControl);

                    HtmlGenericControl scriptControl = new HtmlGenericControl("script");
                    scriptControl.Attributes.Add("type", "text/javascript");
                    scriptControl.InnerHtml = string.Format(@"$(document).ready(function(){{
                                                    $('#map-{0}').GoogleMapEditor($.extend({{}},{1},{{dataChange:function(sender, data){{ $(sender.container).next().next().val(data); }}}}));}});", id, map.ToJsonString());
                    divWrapperControl.Controls.Add(scriptControl);
                    divWrapperControl.RenderControl(htmlWriter);
                    sbControlHtml.Append(stringWriter.ToString());
                    divWrapperControl.Dispose();
                }
            }
            return new MvcHtmlString(sbControlHtml.ToString());
        }
Beispiel #34
0
 protected override void AttachChildControls()
 {
     this.orderId = this.Page.Request.QueryString["orderId"];
     this.order   = ShoppingProcessor.GetOrderInfo(this.orderId);
     if (this.order == null)
     {
         base.GotoResourceNotFound("");
     }
     if (!this.Page.IsPostBack)
     {
         //string text = System.Web.HttpContext.Current.Request.QueryString["action"];
         //if (!string.IsNullOrEmpty(text) && text == "topay")
         //{
         //    this.GotoPay();
         //}
         this.GotoPay();
     }
     this.litOrderId     = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderId");
     this.litOrderTotal  = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderTotal");
     this.litPaymentType = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litPaymentType");
     this.litPaymentName = (System.Web.UI.WebControls.Literal) this.FindControl("litPaymentName");
     this.litPaymentType.SetWhenIsNotNull(this.order.PaymentTypeId.ToString());
     this.litOrderId.SetWhenIsNotNull(this.orderId);
     this.litOrderTotal.SetWhenIsNotNull(this.order.GetTotal().ToString("F2"));
     //if (TradeHelper.CheckIsUnpack(order.OrderId))
     //{
     //    decimal childOrdertotal = ShoppingProcessor.GetChildOrderTotal(order.OrderId);
     //    this.litOrderTotal.Text = childOrdertotal.ToString("F2");
     //}
     this.litPaymentName.Text = this.order.PaymentType;
     this.divhelper           = (System.Web.UI.HtmlControls.HtmlGenericControl) this.FindControl("helper");
     if (this.order.Gateway != "ecdev.plugins.payment.bankrequest")
     {
         this.divhelper.Visible = false;
     }
     else
     {
         this.divhelper.Visible = true;
         this.litHelperText     = (System.Web.UI.WebControls.Literal) this.FindControl("litHelperText");
         SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
         this.litHelperText.SetWhenIsNotNull(masterSettings.OffLinePayContent);
     }
     this.btnToPay = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("btnToPay");
     if (this.btnToPay != null)
     {
         this.btnToPay.HRef = "FinishOrder.aspx?orderId=" + this.orderId + "&action=topay";
     }
     else
     {
         this.GotoPay();
     }
     if (this.btnToPay != null && (this.order.Gateway == "ecdev.plugins.payment.podrequest" || this.order.Gateway == "ecdev.plugins.payment.bankrequest"))
     {
         this.btnToPay.Visible = false;
     }
     PageTitle.AddSiteNameTitle("下单成功");
 }
Beispiel #35
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺会员");
            int currentMemberUserId             = Globals.GetCurrentMemberUserId();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            if (userIdDistributors == null)
            {
                this.Context.Response.Redirect("/default.aspx");
                this.Context.Response.End();
            }
            this.litUserId      = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId");
            this.litUserId.Text = userIdDistributors.UserId.ToString();
            this.litMysubMember = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubMember");
            this.litMysubFirst  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubFirst");
            this.litMysubSecond = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubSecond");
            DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);

            if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0)
            {
                this.litMysubMember.Text = distributorsSubStoreNum.Rows[0]["memberCount"].ToString();
                this.litMysubFirst.Text  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
            }
            else
            {
                this.litMysubMember.Text = "0";
                this.litMysubFirst.Text  = "0";
                this.litMysubSecond.Text = "0";
            }
            this.rpMyMemberList = (VshopTemplatedRepeater)this.FindControl("rpMyMemberList");
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 10;
            }
            this.hiddTotal     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddTotal");
            this.hiddPageIndex = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddPageIndex");
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["UserID"]))
            {
                int       referralUserId  = int.Parse(this.Page.Request.QueryString["UserID"]);
                int       num             = 0;
                DataTable membersByUserId = MemberProcessor.GetMembersByUserId(referralUserId, pageIndex, pageSize, out num);
                this.hiddTotal.Value           = num.ToString();
                this.hiddPageIndex.Value       = pageIndex.ToString();
                this.rpMyMemberList.DataSource = membersByUserId;
                this.rpMyMemberList.DataBind();
            }
        }
Beispiel #36
0
 protected override void AttachChildControls()
 {
     this.imgWeixin = (HtmlImage) this.FindControl("imgWeixin");
     this.hidWeixinNumber = (HtmlInputHidden) this.FindControl("hidWeixinNumber");
     this.hidWeixinLoginUrl = (HtmlInputHidden) this.FindControl("hidWeixinLoginUrl");
     SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
     this.hidWeixinNumber.Value = masterSettings.WeixinNumber;
     this.imgWeixin.Src = masterSettings.WeiXinCodeImageUrl;
     PageTitle.AddSiteNameTitle("登录向导");
 }
Beispiel #37
0
        protected override void AttachChildControls()
        {
            this.txtTotalPages  = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.rptDrawRecodes = (VshopTemplatedRepeater)this.FindControl("rptDrawRecodes");
            PageTitle.AddSiteNameTitle("提现记录");
            Users.GetUser(HiContext.Current.User.UserId, false);
            int arg_5B_0 = HiContext.Current.User.UserId;

            this.BindDrawRecords();
        }
Beispiel #38
0
        protected override void AttachChildControls()
        {
            this.hidurl = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidurl");
            string text = System.Web.HttpContext.Current.Request.QueryString.ToString();

            text = Globals.UrlDecode(text);
            text = System.Text.RegularExpressions.Regex.Match(text, "(returnUrl=.*)", System.Text.RegularExpressions.RegexOptions.IgnoreCase).ToString();
            text = System.Text.RegularExpressions.Regex.Replace(text, "(returnUrl=)", "", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
            this.hidurl.Value = text;
        }
        protected override void AttachChildControls()
        {
            this.txtTotalPages   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.rptSubReferrals = (AliOHTemplatedRepeater)this.FindControl("rptSubReferrals");
            PageTitle.AddSiteNameTitle("下级推广员");
            Users.GetUser(HiContext.Current.User.UserId, false);
            int arg_5B_0 = HiContext.Current.User.UserId;

            this.BindSubReferrals();
        }
Beispiel #40
0
        protected override void AttachChildControls()
        {
            this.imgWeixin         = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("imgWeixin");
            this.hidWeixinNumber   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidWeixinNumber");
            this.hidWeixinLoginUrl = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidWeixinLoginUrl");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            this.hidWeixinNumber.Value = masterSettings.WeixinNumber;
            this.imgWeixin.Src         = masterSettings.WeiXinCodeImageUrl;
            PageTitle.AddSiteNameTitle("登录向导");
        }
Beispiel #41
0
        /// <summary>
        /// 保存角色/用户的权限
        /// </summary>
        /// <param name="objectGridView"></param>
        /// <param name="ownerType"></param>
        void SaveObjectPermissions(GridView objectGridView, string ownerType)
        {
            if (DemoSiteMessage)
            {
                return;
            }

            int typeID = ownerType == "role" ? Constants.OwnerRole : Constants.OwnerAccount;

            for (int i = 0; i < objectGridView.Rows.Count; i++)
            {
                System.Web.UI.HtmlControls.HtmlInputHidden objIDHidden = (System.Web.UI.HtmlControls.HtmlInputHidden)objectGridView.Rows[i].FindControl("IDHidden");
                string ownerID = objIDHidden.Value;

                AccountHelper.DeletePermission(typeID, ownerID, ChannelID);
                ArrayList al = new ArrayList();
                if (((CheckBox)objectGridView.Rows[i].FindControl("ChannelReadCheckbox")).Checked)
                {
                    al.Add("Channel.Read");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("ChannelInputCheckbox")).Checked)
                {
                    al.Add("Channel.Input");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("ChannelArticleCheckbox")).Checked)
                {
                    al.Add("Channel.Article");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("ChannelFirstAuditCheckbox")).Checked)
                {
                    al.Add("Channel.FirstAudit");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("ChannelSecondAuditCheckbox")).Checked)
                {
                    al.Add("Channel.SecondAudit");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("ChannelThirdAuditCheckbox")).Checked)
                {
                    al.Add("Channel.ThirdAudit");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("ChannelAdminCheckbox")).Checked)
                {
                    al.Add("Channel.Admin");
                }

                string[] adds = (string[])al.ToArray(typeof(string));
                AccountHelper.DeletePermission(typeID, ownerID, ChannelID);
                AccountHelper.AddPermission(typeID, ownerID, ChannelID, adds);

                //处理子栏目的权限信息
                ChannelHelper.DeleteChildrenPermission(typeID, ownerID, ChannelID);
                ChannelHelper.AddChildrenPermission(typeID, ownerID, ChannelID, adds);
            }
        }
Beispiel #42
0
    //############################################################
    //############################################################
    void UpdateVSFDetails()
    {
        Repeater oRpt = (Repeater)this.form1.FindControl("repeaterVSFDetails");

        foreach (RepeaterItem oItem in oRpt.Items)
        {
            System.Web.UI.HtmlControls.HtmlInputHidden VendorId         = ((System.Web.UI.HtmlControls.HtmlInputHidden)oItem.FindControl("VendorId"));
            System.Web.UI.HtmlControls.HtmlInputText   SAPRatingScore   = ((System.Web.UI.HtmlControls.HtmlInputText)oItem.FindControl("SAPRatingScore"));
            System.Web.UI.HtmlControls.HtmlInputText   SAPRatingRank    = ((System.Web.UI.HtmlControls.HtmlInputText)oItem.FindControl("SAPRatingRank"));
            System.Web.UI.HtmlControls.HtmlInputText   MaxExposureLimit = ((System.Web.UI.HtmlControls.HtmlInputText)oItem.FindControl("MaxExposureLimit"));
            System.Web.UI.HtmlControls.HtmlInputText   AmountUnservedPO = ((System.Web.UI.HtmlControls.HtmlInputText)oItem.FindControl("AmountUnservedPO"));
            System.Web.UI.HtmlControls.HtmlInputText   AvailBalance     = ((System.Web.UI.HtmlControls.HtmlInputText)oItem.FindControl("AvailBalance"));
            System.Web.UI.HtmlControls.HtmlInputText   FCRank           = ((System.Web.UI.HtmlControls.HtmlInputText)oItem.FindControl("FCRank"));
            //System.Web.UI.HtmlControls.HtmlInputText EndoresedBy = ((System.Web.UI.HtmlControls.HtmlInputText)oItem.FindControl("EndoresedBy"));
            //RadioButtonList ProductTypeApproval = ((RadioButtonList)oItem.FindControl("ProductTypeApproval"));
            System.Web.UI.HtmlControls.HtmlInputText OverallRanking = ((System.Web.UI.HtmlControls.HtmlInputText)oItem.FindControl("OverallRanking"));
            CheckBox Selected = ((CheckBox)oItem.FindControl("Selected"));


            query = "UPDATE tblVSFDetails SET SAPRatingScore=@SAPRatingScore, SAPRatingRank=@SAPRatingRank, MaxExposureLimit=@MaxExposureLimit, AmountUnservedPO=@AmountUnservedPO, AvailBalance=@AvailBalance, FCRank=@FCRank, EndoresedBy=@EndoresedBy, ProductTypeApproval=@ProductTypeApproval, OverallRanking=@OverallRanking, Selected=@Selected WHERE VendorId = @VendorId AND VSFId=@VSFId";
            //query = "sp_GetVendorInformation"; //##storedProcedure
            using (conn = new SqlConnection(connstring))
            {
                using (cmd = new SqlCommand(query, conn))
                {
                    //cmd.CommandType = CommandType.StoredProcedure; //##storedProcedure
                    cmd.Parameters.AddWithValue("@VSFId", Convert.ToInt32(Session["VSFId"].ToString()));
                    cmd.Parameters.AddWithValue("@VendorId", Convert.ToInt32(VendorId.Value));
                    cmd.Parameters.AddWithValue("@SAPRatingScore", SAPRatingScore.Value != "" ? Convert.ToDouble(SAPRatingScore.Value.Replace(",", "")) : 0);
                    cmd.Parameters.AddWithValue("@SAPRatingRank", SAPRatingRank.Value != "" ? Convert.ToInt32(SAPRatingRank.Value.Replace(",", "")) : 0);
                    cmd.Parameters.AddWithValue("@MaxExposureLimit", MaxExposureLimit.Value != "" ? Convert.ToDouble(MaxExposureLimit.Value.Replace(",", "")) : 0);
                    cmd.Parameters.AddWithValue("@AmountUnservedPO", AmountUnservedPO.Value != "" ? Convert.ToDouble(AmountUnservedPO.Value.Replace(",", "")) : 0);
                    cmd.Parameters.AddWithValue("@AvailBalance", AvailBalance.Value != "" ? Convert.ToDouble(AvailBalance.Value.Replace(",", "")) : 0);
                    cmd.Parameters.AddWithValue("@FCRank", FCRank.Value != "" ? Convert.ToInt32(FCRank.Value.Replace(",", "")) : 0);
                    cmd.Parameters.AddWithValue("@EndoresedBy", ((DropDownList)oItem.FindControl("EndoresedBy")).SelectedValue);
                    cmd.Parameters.AddWithValue("@ProductTypeApproval", ((DropDownList)oItem.FindControl("ProductTypeApproval")).SelectedValue);
                    cmd.Parameters.AddWithValue("@OverallRanking", OverallRanking.Value != "" ? Convert.ToDouble(OverallRanking.Value.Replace(",", "")) : 0);
                    cmd.Parameters.AddWithValue("@Selected", Selected.Checked == true ? 1 : 0);
                    conn.Open(); cmd.ExecuteNonQuery();
                }
            }
        }

        query = "sp_updateVSFRanking"; //##storedProcedure
        using (conn = new SqlConnection(connstring))
        {
            using (cmd = new SqlCommand(query, conn))
            {
                cmd.CommandType = CommandType.StoredProcedure; //##storedProcedure
                cmd.Parameters.AddWithValue("@VSFId", Convert.ToInt32(Session["VSFId"].ToString()));
                conn.Open(); cmd.ExecuteNonQuery();
            }
        }
    }
Beispiel #43
0
 //############################################################
 //############################################################
 protected void repeaterVSFDetails_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         System.Web.UI.HtmlControls.HtmlInputHidden oHiddenVendors = ((System.Web.UI.HtmlControls.HtmlInputHidden)e.Item.FindControl("VendorId"));
         ((System.Web.UI.WebControls.Image)e.Item.FindControl("imgVendor")).Attributes.Add("onclick", "javascript: __doPostBack('deleteVendor', '" + ((DataRowView)e.Item.DataItem)["VendorID"].ToString() + "');");
         ((DropDownList)e.Item.FindControl("ProductTypeApproval")).SelectedValue = (((DataRowView)e.Item.DataItem)["ProductTypeApproval"].ToString());
         ((DropDownList)e.Item.FindControl("EndoresedBy")).SelectedValue         = (((DataRowView)e.Item.DataItem)["EndoresedBy"].ToString());
         ((CheckBox)e.Item.FindControl("Selected")).Checked = (((DataRowView)e.Item.DataItem)["Selected"].ToString()) == "1" ? true : false;
     }
 }
Beispiel #44
0
        protected override void AttachChildControls()
        {
            this.hidOrderStatus = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("OrderStatus");
            this.hidskuid       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("skuid");
            this.hidorderid     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("orderid");
            this.hidorderitemid = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("orderitemid");
            this.hidproductid   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("productid");
            this.orderId        = this.Page.Request.QueryString["orderId"].Trim();
            this.SKuId          = Globals.RequestQueryStr("skuid").Trim();
            if (string.IsNullOrEmpty(this.SKuId))
            {
                int          id           = Globals.RequestQueryNum("ID");
                LineItemInfo lineItemInfo = OrderSplitHelper.GetLineItemInfo(id, this.orderId);
                if (lineItemInfo != null)
                {
                    this.SKuId = lineItemInfo.SkuId;
                    this.hidorderitemid.Value = id.ToString();
                }
            }
            this.hidorderid.Value     = this.orderId;
            this.hidskuid.Value       = this.SKuId;
            this.litimage             = (System.Web.UI.WebControls.Literal) this.FindControl("litimage");
            this.litname              = (System.Web.UI.WebControls.Literal) this.FindControl("litname");
            this.litItemAdjustedPrice = (System.Web.UI.WebControls.Literal) this.FindControl("litItemAdjustedPrice");
            this.litQuantity          = (System.Web.UI.WebControls.Literal) this.FindControl("litQuantity");
            this.rptOrderProducts     = (VshopTemplatedRepeater)this.FindControl("rptOrderProducts");
            OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(this.orderId);

            this.hidOrderStatus.Value = ((int)orderInfo.OrderStatus).ToString();
            if (orderInfo == null)
            {
                base.GotoResourceNotFound("此订单已不存在");
            }
            bool flag = false;

            foreach (LineItemInfo current in orderInfo.LineItems.Values)
            {
                if (current.SkuId.ToString() == this.SKuId)
                {
                    this.litimage.Text             = "<image src=\"" + current.ThumbnailsUrl + "\"></image>";
                    this.litname.Text              = current.ItemDescription;
                    this.litItemAdjustedPrice.Text = current.ItemAdjustedPrice.ToString("0.00");
                    this.litQuantity.Text          = current.Quantity.ToString();
                    this.hidproductid.Value        = current.ProductId.ToString();
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                base.GotoResourceNotFound("此订单商品不存在");
            }
            PageTitle.AddSiteNameTitle("申请退货");
        }
Beispiel #45
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("下级分销商");
            this.litMysubMember = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubMember");
            this.litMysubFirst  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubFirst");
            this.litMysubSecond = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubSecond");
            int currentMemberUserId             = Globals.GetCurrentMemberUserId();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            this.litUserId      = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId");
            this.litUserId.Text = userIdDistributors.UserId.ToString();
            DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);

            if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0)
            {
                this.litMysubMember.Text = distributorsSubStoreNum.Rows[0]["memberCount"].ToString();
                this.litMysubFirst.Text  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
            }
            else
            {
                this.litMysubMember.Text = "0";
                this.litMysubFirst.Text  = "0";
                this.litMysubSecond.Text = "0";
            }
            this.rpdistributor = (VshopTemplatedRepeater)this.FindControl("rpdistributor");
            this.hiddTotal     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddTotal");
            DistributorsQuery distributorsQuery = new DistributorsQuery();

            distributorsQuery.PageIndex = 0;
            distributorsQuery.PageSize  = 10;
            DistributorsInfo currentDistributors = DistributorsBrower.GetCurrentDistributors(Globals.GetCurrentMemberUserId(), true);

            if (currentDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                distributorsQuery.GradeId = 2;
                int gradeId = 0;
                if (int.TryParse(this.Page.Request.QueryString["gradeId"], out gradeId))
                {
                    distributorsQuery.GradeId = gradeId;
                }
                distributorsQuery.ReferralPath = currentDistributors.UserId.ToString();
                distributorsQuery.UserId       = currentDistributors.UserId;
                int       num = 0;
                DataTable downDistributors = DistributorsBrower.GetDownDistributors(distributorsQuery, out num);
                this.hiddTotal.Value          = num.ToString();
                this.rpdistributor.DataSource = downDistributors;
                this.rpdistributor.DataBind();
            }
        }
Beispiel #46
0
        protected override void AttachChildControls()
        {
            this.specialHideShow = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("specialHideShow");
            //传递爽爽挝啡的特殊名到前端,前端用jquery进行相应的功能隐藏
            if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.AutoShipping)
            {
                specialHideShow.Value = "sswk";//爽爽挝啡
            }
            if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.IsProLa)
            {
                specialHideShow.Value = "prola";//prola
            }
            this.orderId = this.Page.Request.QueryString["orderId"];
            OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(this.orderId);

            if (orderInfo == null)
            {
                base.GotoResourceNotFound("");
            }
            if (!string.IsNullOrEmpty(orderInfo.Gateway) && (orderInfo.Gateway == "hishop.plugins.payment.offlinerequest"))
            {
                this.litMessage = (Literal)this.FindControl("litMessage");
                this.litMessage.SetWhenIsNotNull(SettingsManager.GetMasterSettings(false).OffLinePayContent);
            }
            this.btnToPay = (HtmlAnchor)this.FindControl("btnToPay");
            if (!string.IsNullOrEmpty(orderInfo.Gateway) && (orderInfo.Gateway == "hishop.plugins.payment.weixinrequest"))
            {
                this.btnToPay.Visible = true;
                this.btnToPay.HRef    = "~/pay/wx_Submit.aspx?orderId=" + orderInfo.OrderId;
                specialHideShow.Value = "prolaQuickpay";//自动快速支付
            }
            if ((!string.IsNullOrEmpty(orderInfo.Gateway) && (orderInfo.Gateway != "hishop.plugins.payment.podrequest")) && ((orderInfo.Gateway != "hishop.plugins.payment.offlinerequest") && (orderInfo.Gateway != "hishop.plugins.payment.weixinrequest")))
            {
                PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode(orderInfo.PaymentTypeId);
                string          attach      = "";
                string          showUrl     = string.Format("http://{0}/vshop/", HttpContext.Current.Request.Url.Host);
                PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单支付", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, showUrl, Globals.FullPath("/pay/PaymentReturn_url.aspx"), Globals.FullPath("/pay/PaymentNotify_url.aspx"), attach).SendRequest();
            }
            else
            {
                this.litOrderId     = (Literal)this.FindControl("litOrderId");
                this.litOrderTotal  = (Literal)this.FindControl("litOrderTotal");
                this.litPaymentType = (HtmlInputHidden)this.FindControl("litPaymentType");
                this.litPaymentType.SetWhenIsNotNull(orderInfo.PaymentTypeId.ToString());
                this.litOrderId.SetWhenIsNotNull(this.orderId);
                this.litOrderTotal.SetWhenIsNotNull(orderInfo.GetTotal().ToString("F2"));
                this.litHelperText = (Literal)this.FindControl("litHelperText");
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                this.litHelperText.SetWhenIsNotNull(masterSettings.OffLinePayContent);
                PageTitle.AddSiteNameTitle("支付");
            }
        }
Beispiel #47
0
		public void Postback ()
		{
			HtmlInputHidden h = new HtmlInputHidden ();
			IPostBackDataHandler p = (IPostBackDataHandler) h;
			NameValueCollection collection = new NameValueCollection ();
			string key = "key";
			string value = "Hi i am a value";
			
			collection [key] = value;
			p.LoadPostData (key, collection);

			Assert.AreEqual (h.Value, value, "A1");
		}
Beispiel #48
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public TabControl()
        {
            this.SelectedTab = new HtmlInputHidden();
            this._SelectedIndex = -1;
            this.SelectedTab.Value = string.Empty;
            this._Width = Unit.Pixel(350);
            this._Height = Unit.Pixel(150);
            this._Items = new TabPageCollection(this);
            this._SelectionMode = SelectionModeEnum.Client;

            this.Height = Unit.Pixel(100);
            this.Width = Unit.Pixel(100);
            this._HeightUnitMode = HeightUnitEnum.percent;
            this._WidthUnitMode = WidthUnitEnum.percent;
            this.LeftOffSetX = 0;
        }
 protected override void AttachChildControls()
 {
     this.orderId = this.Page.Request.QueryString["orderId"];
     this.litShipTo = (Literal) this.FindControl("litShipTo");
     this.litPhone = (Literal) this.FindControl("litPhone");
     this.litAddress = (Literal) this.FindControl("litAddress");
     this.litOrderId = (Literal) this.FindControl("litOrderId");
     this.litOrderDate = (Literal) this.FindControl("litOrderDate");
     this.litOrderStatus = (OrderStatusLabel) this.FindControl("litOrderStatus");
     this.rptOrderProducts = (VshopTemplatedRepeater) this.FindControl("rptOrderProducts");
     this.litTotalPrice = (Literal) this.FindControl("litTotalPrice");
     this.litPayTime = (Literal) this.FindControl("litPayTime");
     this.orderStatus = (HtmlInputHidden) this.FindControl("orderStatus");
     this.txtOrderId = (HtmlInputHidden) this.FindControl("txtOrderId");
     this.litRemark = (Literal) this.FindControl("litRemark");
     this.litShipToDate = (Literal) this.FindControl("litShipToDate");
     this.litShippingCost = (Literal) this.FindControl("litShippingCost");
     this.litCounponPrice = (Literal) this.FindControl("litCounponPrice");
     this.litBuildPrice = (Literal) this.FindControl("litBuildPrice");
     this.litDisCountPrice = (Literal) this.FindControl("litDisCountPrice");
     this.litActualPrice = (Literal) this.FindControl("litActualPrice");
     OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(this.orderId);
     if (orderInfo == null)
     {
         base.GotoResourceNotFound("此订单已不存在");
     }
     this.litShipTo.Text = orderInfo.ShipTo;
     this.litPhone.Text = orderInfo.CellPhone;
     this.litAddress.Text = orderInfo.ShippingRegion + orderInfo.Address;
     this.litOrderId.Text = this.orderId;
     this.litOrderDate.Text = orderInfo.OrderDate.ToString();
     this.litTotalPrice.SetWhenIsNotNull(orderInfo.GetAmount().ToString("F2"));
     this.litOrderStatus.OrderStatusCode = orderInfo.OrderStatus;
     this.litPayTime.SetWhenIsNotNull(orderInfo.PayDate.HasValue ? orderInfo.PayDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "");
     this.orderStatus.SetWhenIsNotNull(((int) orderInfo.OrderStatus).ToString());
     this.txtOrderId.SetWhenIsNotNull(this.orderId.ToString());
     this.litCounponPrice.SetWhenIsNotNull(orderInfo.CouponValue.ToString("F2"));
     this.litShippingCost.SetWhenIsNotNull(orderInfo.AdjustedFreight.ToString("F2"));
     this.litShipToDate.SetWhenIsNotNull(orderInfo.ShipToDate);
     this.litBuildPrice.SetWhenIsNotNull(orderInfo.GetAmount().ToString("F2"));
     this.litDisCountPrice.SetWhenIsNotNull(orderInfo.AdjustedDiscount.ToString("F2"));
     this.litActualPrice.SetWhenIsNotNull(orderInfo.TotalPrice.ToString("F2"));
     this.litRemark.SetWhenIsNotNull(orderInfo.Remark);
     this.rptOrderProducts.DataSource = orderInfo.LineItems.Values;
     this.rptOrderProducts.DataBind();
     PageTitle.AddSiteNameTitle("订单详情");
 }
Beispiel #50
0
        protected override void OnPageLoad(Page page)
        {
            if (page.Form != null)
            {
                HtmlGenericControl div = new HtmlGenericControl();
                div.Style["display"] = "none";
                HtmlInputHidden hidden = new HtmlInputHidden() {ID = UserIDInputName()};
                
                if (DeluxePrincipal.IsAuthenticated)
                {
                    hidden.Value = DeluxeIdentity.CurrentUser.ID;
                }

                div.Controls.Add(hidden);
                page.Form.Controls.AddAt(0, div);
            }
        }
 protected override void AttachChildControls()
 {
     this.shipTo = (HtmlInputText) this.FindControl("shipTo");
     this.address = (HtmlTextArea) this.FindControl("address");
     this.cellphone = (HtmlInputText) this.FindControl("cellphone");
     this.Hiddenshipid = (HtmlInputHidden) this.FindControl("shipId");
     this.regionText = (HtmlInputHidden) this.FindControl("regionText");
     this.region = (HtmlInputHidden) this.FindControl("region");
     ShippingAddressInfo shippingAddress = MemberProcessor.GetShippingAddress(this.shippingid);
     string fullRegion = RegionHelper.GetFullRegion(shippingAddress.RegionId, " ");
     this.shipTo.Value = shippingAddress.ShipTo;
     this.address.Value = shippingAddress.Address;
     this.cellphone.Value = shippingAddress.CellPhone;
     this.Hiddenshipid.Value = this.shippingid.ToString();
     this.regionText.SetWhenIsNotNull(fullRegion);
     this.region.SetWhenIsNotNull(shippingAddress.RegionId.ToString());
     PageTitle.AddSiteNameTitle("编辑收货地址");
 }
 protected override void AttachChildControls()
 {
     int num;
     int num2;
     if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
     {
         base.GotoResourceNotFound("");
     }
     ProductConsultationAndReplyQuery consultationQuery = new ProductConsultationAndReplyQuery();
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 20;
     }
     consultationQuery.ProductId = this.productId;
     consultationQuery.IsCount = true;
     consultationQuery.PageIndex = num;
     consultationQuery.PageSize = num2;
     consultationQuery.SortBy = "ConsultationId";
     consultationQuery.SortOrder = SortAction.Desc;
     consultationQuery.HasReplied = true;
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     this.txtTotal = (HtmlInputHidden) this.FindControl("txtTotal");
     DbQueryResult productConsultations = ProductBrowser.GetProductConsultations(consultationQuery);
     this.rptProducts.DataSource = productConsultations.Data;
     this.rptProducts.DataBind();
     this.txtTotal.SetWhenIsNotNull(productConsultations.TotalRecords.ToString());
     this.litProductTitle = (Literal) this.FindControl("litProductTitle");
     this.litShortDescription = (Literal) this.FindControl("litShortDescription");
     this.litSoldCount = (Literal) this.FindControl("litSoldCount");
     this.litSalePrice = (Literal) this.FindControl("litSalePrice");
     this.imgProductImage = (HtmlImage) this.FindControl("imgProductImage");
     ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);
     this.litProductTitle.SetWhenIsNotNull(product.ProductName);
     this.litShortDescription.SetWhenIsNotNull(product.ShortDescription);
     this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
     this.litSalePrice.SetWhenIsNotNull(product.MinSalePrice.ToString("F2"));
     this.imgProductImage.Src = product.ThumbnailUrl60;
     PageTitle.AddSiteNameTitle("商品咨询");
 }
Beispiel #53
0
 protected override void AttachChildControls()
 {
     int num;
     int num2;
     int num3;
     int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
     this.keyWord = this.Page.Request.QueryString["keyWord"];
     if (!string.IsNullOrWhiteSpace(this.keyWord))
     {
         this.keyWord = this.keyWord.Trim();
     }
     this.imgUrl = (HiImage) this.FindControl("imgUrl");
     this.litContent = (Literal) this.FindControl("litContent");
     this.rptProducts = (VshopTemplatedRepeater) this.FindControl("rptProducts");
     this.rptCategories = (VshopTemplatedRepeater) this.FindControl("rptCategories");
     this.txtTotalPages = (HtmlInputHidden) this.FindControl("txtTotal");
     string str = this.Page.Request.QueryString["sort"];
     if (string.IsNullOrWhiteSpace(str))
     {
         str = "DisplaySequence";
     }
     string str2 = this.Page.Request.QueryString["order"];
     if (string.IsNullOrWhiteSpace(str2))
     {
         str2 = "desc";
     }
     if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
     {
         num = 1;
     }
     if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
     {
         num2 = 20;
     }
     IList<CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategories(this.categoryId, 0x3e8);
     this.rptCategories.DataSource = maxSubCategories;
     this.rptCategories.DataBind();
     this.rptProducts.DataSource = ProductBrowser.GetProducts(MemberProcessor.GetCurrentMember(), null, new int?(this.categoryId), this.keyWord, num, num2, out num3, str, str2);
     this.rptProducts.DataBind();
     this.txtTotalPages.SetWhenIsNotNull(num3.ToString());
     PageTitle.AddSiteNameTitle("分类搜索页");
 }
Beispiel #54
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("店铺消息");
     this.imglogo = (HtmlImage) this.FindControl("imglogo");
     this.litBackImg = (Literal) this.FindControl("litBackImg");
     this.hdbackimg = (HtmlInputHidden) this.FindControl("hdbackimg");
     this.hdlogo = (HtmlInputHidden) this.FindControl("hdlogo");
     this.txtstorename = (HtmlInputText) this.FindControl("txtstorename");
     this.txtdescription = (HtmlTextArea) this.FindControl("txtdescription");
     DistributorsInfo currentDistributors = DistributorsBrower.GetCurrentDistributors(Globals.GetCurrentMemberUserId());
     if (currentDistributors != null)
     {
         if (!string.IsNullOrEmpty(currentDistributors.Logo))
         {
             this.imglogo.Src = currentDistributors.Logo;
         }
         this.hdbackimg.Value = currentDistributors.BackImage;
         this.txtstorename.Value = currentDistributors.StoreName;
         this.txtdescription.Value = currentDistributors.StoreDescription;
         if (this.litBackImg != null)
         {
             List<string> list = SettingsManager.GetMasterSettings(false).DistributorBackgroundPic.Split(new char[] { '|' }).ToList<string>();
             foreach (string str in list)
             {
                 if (!string.IsNullOrEmpty(str))
                 {
                     if (this.hdbackimg.Value == str)
                     {
                         this.litBackImg.Text = this.litBackImg.Text + "<div class=\"disactive\"><span class=\"mark\"></span><img src=\"" + str + "\"/></div>";
                     }
                     else
                     {
                         this.litBackImg.Text = this.litBackImg.Text + "<div><span class=\"mark\"></span><img src=\"" + str + "\" /></div>";
                     }
                 }
             }
         }
     }
 }
Beispiel #55
0
 protected override void AttachChildControls()
 {
     this.orderId = this.Page.Request.QueryString["orderId"];
     OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(this.orderId);
     if (orderInfo == null)
     {
         base.GotoResourceNotFound("");
     }
     if (!(string.IsNullOrEmpty(orderInfo.Gateway) || !(orderInfo.Gateway == "hishop.plugins.payment.offlinerequest")))
     {
         this.litMessage = (Literal) this.FindControl("litMessage");
         this.litMessage.SetWhenIsNotNull(SettingsManager.GetMasterSettings(false).OffLinePayContent);
     }
     if (!(string.IsNullOrEmpty(orderInfo.Gateway) || !(orderInfo.Gateway == "hishop.plugins.payment.weixinrequest")))
     {
         HttpContext.Current.Response.Redirect("~/pay/wx_Submit.aspx?orderId=" + orderInfo.OrderId);
     }
     if (((!string.IsNullOrEmpty(orderInfo.Gateway) && (orderInfo.Gateway != "hishop.plugins.payment.podrequest")) && (orderInfo.Gateway != "hishop.plugins.payment.offlinerequest")) && (orderInfo.Gateway != "hishop.plugins.payment.weixinrequest"))
     {
         PaymentModeInfo paymentMode = ShoppingProcessor.GetPaymentMode(orderInfo.PaymentTypeId);
         string attach = "";
         string showUrl = string.Format("http://{0}/vshop/", HttpContext.Current.Request.Url.Host);
         PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单支付", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, showUrl, Globals.FullPath("/pay/PaymentReturn_url.aspx"), Globals.FullPath("/pay/PaymentNotify_url.aspx"), attach).SendRequest();
     }
     else
     {
         this.litOrderId = (Literal) this.FindControl("litOrderId");
         this.litOrderTotal = (Literal) this.FindControl("litOrderTotal");
         this.litPaymentType = (HtmlInputHidden) this.FindControl("litPaymentType");
         this.litPaymentType.SetWhenIsNotNull(orderInfo.PaymentTypeId.ToString());
         this.litOrderId.SetWhenIsNotNull(this.orderId);
         this.litOrderTotal.SetWhenIsNotNull(orderInfo.GetTotal().ToString("F2"));
         this.litHelperText = (Literal) this.FindControl("litHelperText");
         SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
         this.litHelperText.SetWhenIsNotNull(masterSettings.OffLinePayContent);
         PageTitle.AddSiteNameTitle("下单成功");
     }
 }
Beispiel #56
0
 protected override void SetValueByquery(HtmlInputHidden control, string query)
 {
     if (XYECOM.Core.XYRequest.GetQueryString(query) != "")
         control.Value = XYECOM.Core.XYRequest.GetQueryString(query);
 }
Beispiel #57
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            if ( !_controlsLoaded )
            {
                Controls.Clear();

                _hfExistingKeyNames = new HtmlInputHidden();
                _hfExistingKeyNames.AddCssClass( "js-existing-key-names" );
                _hfExistingKeyNames.ID = this.ID + "_hfExistingKeyNames";
                Controls.Add( _hfExistingKeyNames );

                _lAttributeActionTitle = new Literal();
                _lAttributeActionTitle.ID = "lAttributeActionTitle";
                Controls.Add( _lAttributeActionTitle );

                _validationSummary = new ValidationSummary();
                _validationSummary.ID = "valiationSummary";
                _validationSummary.CssClass = "alert alert-danger";
                _validationSummary.HeaderText = "Please Correct the Following";
                Controls.Add( _validationSummary );

                _tbName = new RockTextBox();
                _tbName.ID = "tbName";
                _tbName.Label = "Name";
                _tbName.Required = true;
                Controls.Add( _tbName );

                _tbDescription = new RockTextBox();
                _tbDescription.Label = "Description";
                _tbDescription.ID = "tbDescription";
                _tbDescription.TextMode = TextBoxMode.MultiLine;
                _tbDescription.Rows = 3;
                Controls.Add( _tbDescription );

                _cpCategories = new CategoryPicker();
                _cpCategories.ID = "cpCategories_" + this.ID.ToString();
                _cpCategories.Label = "Categories";
                _cpCategories.AllowMultiSelect = true;
                _cpCategories.EntityTypeId = EntityTypeCache.Read( typeof( Rock.Model.Attribute ) ).Id;
                _cpCategories.EntityTypeQualifierColumn = "EntityTypeId";
                Controls.Add( _cpCategories );

                _tbKey = new RockTextBox();
                _tbKey.ID = "tbKey";
                _tbKey.Label = "Key";
                _tbKey.Required = true;
                Controls.Add( _tbKey );

                _cvKey = new CustomValidator();
                _cvKey.ID = "cvKey";
                _cvKey.ControlToValidate = _tbKey.ID;
                _cvKey.ClientValidationFunction = "validateKey";
                _cvKey.ServerValidate += cvKey_ServerValidate;
                _cvKey.Display = ValidatorDisplay.Dynamic;
                _cvKey.CssClass = "validation-error help-inline";
                _cvKey.ErrorMessage = "There is already an existing property with the key value you entered or the key has illegal characters. Please select a different key value and use only letters, numbers and underscores.";
                Controls.Add( _cvKey );

                _tbIconCssClass = new RockTextBox();
                _tbIconCssClass.ID = "_tbIconCssClass";
                _tbIconCssClass.Label = "Icon CSS Class";
                Controls.Add( _tbIconCssClass );

                _cbRequired = new RockCheckBox();
                _cbRequired.ID ="cbRequired";
                _cbRequired.Label = "Required";
                _cbRequired.Text = "Require a value";
                Controls.Add( _cbRequired );

                _cbShowInGrid = new RockCheckBox();
                _cbShowInGrid.ID = "cbShowInGrid";
                _cbShowInGrid.Label = "Show in Grid";
                _cbShowInGrid.Text = "Yes";
                _cbShowInGrid.Help = "If selected, this attribute will be included in a grid.";
                Controls.Add( _cbShowInGrid );

                _cbAllowSearch = new RockCheckBox();
                _cbAllowSearch.ID = "cbAllowSearch";
                _cbAllowSearch.Label = "Allow Search";
                _cbAllowSearch.Text = "Yes";
                _cbAllowSearch.Help = "If selected, this attribute can be search on.";
                _cbAllowSearch.Visible = false;  // Default is to not show this option
                Controls.Add( _cbAllowSearch );

                _ddlFieldType = new RockDropDownList();
                _ddlFieldType.ID = "ddlFieldType";
                _ddlFieldType.Label = "Field Type";
                _ddlFieldType.AutoPostBack = true;
                _ddlFieldType.SelectedIndexChanged += _ddlFieldType_SelectedIndexChanged;
                _ddlFieldType.DataValueField = "Id";
                _ddlFieldType.DataTextField = "Name";
                Controls.Add( _ddlFieldType );

                _phQualifiers = new PlaceHolder();
                _phQualifiers.ID = "phQualifiers";
                _phQualifiers.EnableViewState = false;
                Controls.Add( _phQualifiers );

                _phDefaultValue = new PlaceHolder();
                _phDefaultValue.ID = "phDefaultValue";
                _phDefaultValue.EnableViewState = false;
                Controls.Add( _phDefaultValue );

                _btnSave = new LinkButton();
                _btnSave.ID = "btnSave";
                _btnSave.Text = "OK";
                _btnSave.CssClass = "btn btn-primary";
                _btnSave.Click += btnSave_Click;
                Controls.Add( _btnSave );

                _btnCancel = new LinkButton();
                _btnCancel.ID = "btnCancel";
                _btnCancel.Text = "Cancel";
                _btnCancel.CssClass = "btn btn-link";
                _btnCancel.CausesValidation = false;
                _btnCancel.Click += btnCancel_Click;
                Controls.Add( _btnCancel );

                _controlsLoaded = true;
            }
        }
Beispiel #58
0
        /// <summary>
        /// Creates the control sub-components of the
        ///   control.
        /// </summary>
        /// <remarks>
        /// Sets the user <see cref="_contentCell"/> container
        ///   object render delegate as the
        ///   <see cref="RenderPanelContent"/> method using the
        ///   <see cref="Control.SetRenderMethodDelegate">
        ///     SetRenderMethodDelegate</see> method. This allows
        ///   the content (this panel control) to be rendered as a 
        ///   child object of the <see cref="_contentCell"/> container.
        /// </remarks>
        private void CreateControlComponents()
        {
            // Create the header panel and
            // set its state to this control state.
            this._headerPanel = new Panel
                                    {
                                        ID = this.HeaderPanelId,
                                        Visible = this.Visible,
                                        Width = this.Width,
                                        Height = this.Height
                                    };
            foreach (string key in this.Attributes.Keys)
            {
                string val = this.Attributes[key];
                this._headerPanel.Attributes.Add(key, val);
            }

            this._headerPanel.ToolTip = this.ToolTip;
            this._headerPanel.ApplyStyle(this.ControlStyle);

            // Ensures that if a border is required,
            // the content panel (this) does not get a 
            // second border.
            this.BorderStyle = BorderStyle.NotSet;

            // Create the hidden input and set the
            // control collapsed state value.
            this._currentState = new HtmlInputHidden
                                     {
                                         ID = this.CollapsedStateId,
                                         Value = this.Collapsed ? "true" : "false"
                                     };

            // Create the control table container.
            this._controlTable = new HtmlTable
                                     {
                                         ID = string.Format("{0}_Table", this.ID),
                                         Width = "100%",
                                         CellSpacing = 0,
                                         CellPadding = 2,
                                         Visible = true
                                     };

            // Create the header container row.
            this._headerRow = new HtmlTableRow { ID = string.Format("{0}_HeaderRow", this.ID), Visible = true };

            // Create the title cell.
            this._titleCell = new HtmlTableCell
                                  {
                                      ID = string.Format("{0}_TitleCell", this.ID),
                                      Align = "left",
                                      Width = "90%",
                                      Visible = true
                                  };

            // Set the style of the cell to the TitleStyle.
            this.ApplyStyle(this._titleCell, this.TitleStyle);

            // Create the title link.
            this._titleLink = new HyperLink { ID = this.ID + "_TitleLink", Text = this.TitleText };

            // Set the style of the link to the TitleStyle.
            this._titleLink.ApplyStyle(this.TitleStyle);
            this._titleLink.Visible = true;

            // Create the action cell.
            this._actionCell = new HtmlTableCell
                                   {
                                       ID = this.ID + "_ActionCell",
                                       Align = "right",
                                       Width = "10%",
                                       Visible = true,
                                       NoWrap = true
                                   };

            // Set the style of the cell to the TitleStyle.
            this.ApplyStyle(this._actionCell, this.TitleStyle);

            // Create the action link.
            this._actionLink = new HyperLink { ID = this.ID + "_ActionLink" };

            // Set the style of the link to the TitleStyle.
            this._actionLink.ApplyStyle(this.TitleStyle);

            // Create the row container for this control.
            this._contentRow = new HtmlTableRow { ID = this.ID + "_ContentRow", Visible = true };

            // Create the cell container for this control.
            this._contentCell = new HtmlTableCell
                                    {
                                        ID = this.ID + "_ContentCell",
                                        ColSpan = 2,
                                        Align = "left",
                                        Visible = true
                                    };

            // Set the render method for this control panel.
            // This allows us to render this control (user content panel)
            // as a child of the content cell.
            this._contentCell.SetRenderMethodDelegate(this.RenderPanelContent);
        }
        private void BindDataGenericProperties(bool refresh)
        {
            var tabs = _contentType.getVirtualTabs;
            var propertyTypeGroups = _contentType.PropertyTypeGroups.ToList();
            var dtds = cms.businesslogic.datatype.DataTypeDefinition.GetAll();

            PropertyTypes.Controls.Clear();

            // Add new property
            if (PropertyTypeNew.Controls.Count == 0)
            {
                PropertyTypeNew.Controls.Add(new LiteralControl("<h2 class=\"propertypaneTitel\">Add New Property</h2><ul class='genericPropertyList addNewProperty'>"));
                gp = new GenericPropertyWrapper();
                gp.ID = "GenericPropertyNew";
                gp.Tabs = tabs;
                gp.DataTypeDefinitions = dtds;
                PropertyTypeNew.Controls.Add(gp);
                PropertyTypeNew.Controls.Add(new LiteralControl("</ul>"));
            }
            else if (refresh)
            {
                gp = (GenericPropertyWrapper)PropertyTypeNew.Controls[1];
                gp.ID = "GenericPropertyNew";
                gp.Tabs = tabs;
                gp.DataTypeDefinitions = dtds;
                gp.UpdateEditControl();
                gp.GenricPropertyControl.UpdateInterface();
                gp.GenricPropertyControl.Clear();
            }

            _genericProperties.Clear();
            var inTab = new Hashtable();
            int counter = 0;

            PropertyTypes.Controls.Add(new LiteralControl("<div id='tabs-container'>"));  // opens draggable container for properties on tabs

            foreach (ContentType.TabI tab in tabs)
            {
                string tabName = tab.GetRawCaption();
                string tabCaption = tabName;
                if (tab.ContentType != _contentType.Id) 
                {
                    tabCaption += " (inherited from " + new ContentType(tab.ContentType).Text + ")";
                }

                PropertyTypes.Controls.Add(new LiteralControl("<div class='genericPropertyListBox'><h2 data-tabname='" + tabName + "' class=\"propertypaneTitel\">Tab: " + tabCaption + "</h2>"));

                var propertyGroup = propertyTypeGroups.SingleOrDefault(x => x.ParentId == tab.Id);
                var propertyTypes = propertyGroup == null
                                        ? tab.GetPropertyTypes(_contentType.Id, false)
                                        : propertyGroup.GetPropertyTypes();

                var propertyGroupId = tab.Id;

                var propSort = new HtmlInputHidden();
                propSort.ID = "propSort_" + propertyGroupId.ToString() + "_Content";
                PropertyTypes.Controls.Add(propSort);
                _sortLists.Add(propSort);

                if (propertyTypes.Any(x => x.ContentTypeId == _contentType.Id))
                {
                    PropertyTypes.Controls.Add(new LiteralControl("<ul class='genericPropertyList' id=\"t_" + propertyGroupId.ToString() + "_Contents\">"));

                    foreach (cms.businesslogic.propertytype.PropertyType pt in propertyTypes)
                    {
                        //If the PropertyType doesn't belong on this ContentType skip it and continue to the next one
                        if (pt.ContentTypeId != _contentType.Id) continue;

                        var gpw = new GenericPropertyWrapper();
                        gpw.ID = "gpw_" + pt.Id;
                        gpw.PropertyType = pt;
                        gpw.Tabs = tabs;
                        gpw.TabId = propertyGroupId;
                        gpw.DataTypeDefinitions = dtds;
                        gpw.Delete += new EventHandler(gpw_Delete);
                        gpw.FullId = "t_" + propertyGroupId.ToString() + "_Contents_" + +pt.Id;

                        PropertyTypes.Controls.Add(gpw);
                        _genericProperties.Add(gpw);
                        if (refresh)
                            gpw.GenricPropertyControl.UpdateInterface();

                        inTab.Add(pt.Id.ToString(), "");
                        counter++;
                    }

                    PropertyTypes.Controls.Add(new LiteralControl("</ul>"));
                }
                else
                {
                    AddNoPropertiesDefinedMessage();
                }

                var jsSortable = GetJavaScriptForPropertySorting(propSort.ClientID);
                Page.ClientScript.RegisterStartupScript(this.GetType(), propSort.ClientID, jsSortable, true);

                PropertyTypes.Controls.Add(new LiteralControl("</div>"));
            }

            // Generic properties tab
            counter = 0;
            bool propertyTabHasProperties = false;
            var propertiesPH = new PlaceHolder();
            propertiesPH.ID = "propertiesPH";
            PropertyTypes.Controls.Add(new LiteralControl("<h2 data-tabname=\"Generic Properties\" class=\"propertypaneTitel\">Tab: Generic Properties</h2>"));
            PropertyTypes.Controls.Add(propertiesPH);

            var propSort_gp = new HtmlInputHidden();
            propSort_gp.ID = "propSort_general_Content";
            PropertyTypes.Controls.Add(propSort_gp);
            _sortLists.Add(propSort_gp);
            
            propertiesPH.Controls.Add(new LiteralControl("<ul class='genericPropertyList' id=\"t_general_Contents\">"));
            foreach (cms.businesslogic.propertytype.PropertyType pt in _contentType.PropertyTypes)
            {
                //This use to be:
                if (pt.ContentTypeId == _contentType.Id && inTab.ContainsKey(pt.Id.ToString()) == false)
                //But seriously, if it's not on a tab the tabId is 0, it's a lot easier to read IMO
                //if (pt.ContentTypeId == _contentType.Id && pt.TabId == 0)
                {
                    var gpw = new GenericPropertyWrapper();

                    // Changed by duckie, was:
                    // gpw.ID = "gpw_" + editPropertyType.Alias;
                    // Which is NOT unique!
                    gpw.ID = "gpw_" + pt.Id;

                    gpw.PropertyType = pt;
                    gpw.Tabs = tabs;
                    gpw.DataTypeDefinitions = dtds;
                    gpw.Delete += new EventHandler(gpw_Delete);
                    gpw.FullId = "t_general_Contents_" + pt.Id;

                    propertiesPH.Controls.Add(gpw);
                    _genericProperties.Add(gpw);
                    if (refresh)
                        gpw.GenricPropertyControl.UpdateInterface();
                    inTab.Add(pt.Id, "");
                    propertyTabHasProperties = true;
                    counter++;
                }
            }

            propertiesPH.Controls.Add(new LiteralControl("</ul>"));

            var jsSortable_gp = GetJavaScriptForPropertySorting(propSort_gp.ClientID);

            Page.ClientScript.RegisterStartupScript(this.GetType(), "propSort_gp", jsSortable_gp, true);


            if (!propertyTabHasProperties)
            {
                AddNoPropertiesDefinedMessage();
                PropertyTypes.Controls.Remove(PropertyTypes.FindControl("propertiesPH"));
            }
            else
            {
                PropertyTypes.Controls.Add(propertiesPH);
            }

            PropertyTypes.Controls.Add(new LiteralControl("</div>")); // closes draggable container for properties on tabs

        }
Beispiel #60
0
        public void InstantiateIn(Control objContainer)
        {
            // 04/25/2006 Paul.  The label needs to be created first as the List will need to access it.
            divLabel = new HtmlGenericControl("div");
            objContainer.Controls.Add(divLabel);
            divLabel.Attributes.Add("style", "display: inline");

            lbl = new Literal();
            lbl.DataBinding += new EventHandler(lit_OnDataBinding);
            divLabel.Controls.Add(lbl);

            hid = new HtmlInputHidden();
            objContainer.Controls.Add(hid);

            divList = new HtmlGenericControl("div");
            objContainer.Controls.Add(divList);
            divList.Attributes.Add("style", "display: none");

            lst = new DropDownList();
            lst.DataBinding += new EventHandler(lst_OnDataBinding);
            divList.Controls.Add(lst);

            if ( sACCESS_TYPE == "access" )
            {
                lst.Items.Add(new ListItem("ACLActions.LBL_ACCESS_ENABLED" , ACL_ACCESS.ENABLED .ToString()));
                lst.Items.Add(new ListItem("ACLActions.LBL_ACCESS_DISABLED", ACL_ACCESS.DISABLED.ToString()));
            }
            else if ( sACCESS_TYPE == "import" )
            {
                lst.Items.Add(new ListItem("ACLActions.LBL_ACCESS_ALL" , ACL_ACCESS.ALL .ToString()));
                lst.Items.Add(new ListItem("ACLActions.LBL_ACCESS_NONE", ACL_ACCESS.NONE.ToString()));
            }
            else
            {
                lst.Items.Add(new ListItem("ACLActions.LBL_ACCESS_ALL"  , ACL_ACCESS.ALL  .ToString()));
                lst.Items.Add(new ListItem("ACLActions.LBL_ACCESS_OWNER", ACL_ACCESS.OWNER.ToString()));
                lst.Items.Add(new ListItem("ACLActions.LBL_ACCESS_NONE" , ACL_ACCESS.NONE .ToString()));
            }
        }