protected void dlProdutosVeiculares_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            try
            {
                //divProdutosVeiculares
                System.Web.UI.HtmlControls.HtmlGenericControl btnDivPrincipal         = e.Item.FindControl("btnDivPrincipal") as System.Web.UI.HtmlControls.HtmlGenericControl;
                System.Web.UI.HtmlControls.HtmlGenericControl divPrincipalDescProduto = e.Item.FindControl("divPrincipalDescProduto") as System.Web.UI.HtmlControls.HtmlGenericControl;
                System.Web.UI.HtmlControls.HtmlGenericControl divPrincipalNomeProduto = e.Item.FindControl("divPrincipalNomeProduto") as System.Web.UI.HtmlControls.HtmlGenericControl;

                System.Web.UI.HtmlControls.HtmlInputHidden hdCodigoProdutoTEMP      = e.Item.FindControl("hdCodigoProdutoTEMP") as System.Web.UI.HtmlControls.HtmlInputHidden;
                System.Web.UI.HtmlControls.HtmlInputHidden hdNomeInternoProdutoTEMP = e.Item.FindControl("hdNomeInternoProdutoTEMP") as System.Web.UI.HtmlControls.HtmlInputHidden;

                //Atribuindo ao Hidden o ID do produto preço clicado e o nome interno do mesmo
                btnDivPrincipal.Attributes.Add("onclick", "document.getElementById('" + hdCodigoProduto.ClientID + "').value = document.getElementById('" + hdCodigoProdutoTEMP.ClientID + "').value; document.getElementById('" + hdNomeInternoProduto.ClientID + "').value = document.getElementById('" + hdNomeInternoProdutoTEMP.ClientID + "').value; document.forms[0].submit();");
                divPrincipalDescProduto.Attributes.Add("onclick", "document.getElementById('" + hdCodigoProduto.ClientID + "').value = document.getElementById('" + hdCodigoProdutoTEMP.ClientID + "').value; document.getElementById('" + hdNomeInternoProduto.ClientID + "').value = document.getElementById('" + hdNomeInternoProdutoTEMP.ClientID + "').value;document.forms[0].submit();");
                divPrincipalNomeProduto.Attributes.Add("onclick", "document.getElementById('" + hdCodigoProduto.ClientID + "').value = document.getElementById('" + hdCodigoProdutoTEMP.ClientID + "').value; document.getElementById('" + hdNomeInternoProduto.ClientID + "').value = document.getElementById('" + hdNomeInternoProdutoTEMP.ClientID + "').value; document.forms[0].submit();");
            }
            catch (Exception)
            {
                if (Session["UsuarioLogado"] == null)
                {
                    Response.Redirect("/Home.aspx", false);
                }
                else
                {
                    Response.Redirect("../Home.aspx", false);
                }
            }
        }
Ejemplo n.º 2
0
 protected void Page_Init(object sender, EventArgs e)
 {
     Controls.Add(new LiteralControl("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org" +
                                     "/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xh" +
                                     "tml\">"));
     Controls.Add(new System.Web.UI.HtmlControls.HtmlHead());
     Controls.Add(new LiteralControl("<body>"));
     form1 = new System.Web.UI.HtmlControls.HtmlForm();
     Controls.Add(form1);
     // script manager
     AjaxControlToolkit.ToolkitScriptManager sm = new AjaxControlToolkit.ToolkitScriptManager();
     sm.ID         = "sm";
     sm.ScriptMode = ScriptMode.Release;
     form1.Controls.Add(sm);
     // Div1
     Div1         = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
     Div1.ID      = "Div1";
     Div1.Visible = false;
     form1.Controls.Add(Div1);
     // Extender1
     Extender1    = new XIOT.Web.DataViewExtender();
     Extender1.ID = "Extender1";
     Extender1.TargetControlID = "Div1";
     Extender1.FilterSource    = "ExtenderFilter";
     Extender1.View            = "editForm1";
     Extender1.ShowActionBar   = false;
     form1.Controls.Add(Extender1);
     // ExtenderFilter
     ExtenderFilter      = new System.Web.UI.HtmlControls.HtmlInputHidden();
     ExtenderFilter.Name = "ExtenderFilter";
     ExtenderFilter.ID   = "ExtenderFilter";
     form1.Controls.Add(ExtenderFilter);
     Controls.Add(new LiteralControl("</body></html>"));
 }
Ejemplo n.º 3
0
 protected void SetDataSource(DataView dataSource, string SelectedPageGridValue, System.Web.UI.HtmlControls.HtmlInputHidden SelectedPageGrid)
 {
     this.SelectedPageGridValueBase = SelectedPageGridValue;
     this.SelectedPageGridBase      = SelectedPageGrid;
     if (MyDataGrid.AllowCustomPaging)
     {
         this.MyDataSource = dataSource;
         if ((this.SelectedPageGridValueBase != "") && (this.SelectedPageGridValueBase != null))
         {
             MyDataGrid.CurrentPageIndex     = Int32.Parse(this.SelectedPageGridValueBase);
             this.SelectedPageGridBase.Value = SelectedPageGridValue;
         }
         MyDataGrid.VirtualItemCount = dataSource.Count;
         this.MyDataGrid.DataSource  = this.CreateDataSource();
     }
     else
     {
         this.MyDataSource = dataSource;
         if ((this.SelectedPageGridValueBase != "") && (this.SelectedPageGridValueBase != null))
         {
             MyDataGrid.CurrentPageIndex     = Int32.Parse(this.SelectedPageGridValueBase);
             this.SelectedPageGridBase.Value = SelectedPageGridValue;
         }
         this.MyDataGrid.DataSource = dataSource;
     }
     this.MyDataGrid.DataBind();
 }
Ejemplo n.º 4
0
        protected override void CreateChildControls()
        {
            if (_fileUpload == null)
            {
                _fileUpload    = new System.Web.UI.HtmlControls.HtmlInputFile();
                _fileUpload.ID = "upload";
            }

            if (_label == null)
            {
                _label = new System.Web.UI.WebControls.Panel();
            }

            if (_state == null)
            {
                _state    = new System.Web.UI.HtmlControls.HtmlInputHidden();
                _state.ID = "state";
            }

            Controls.Add(_label);
            Controls.Add(_fileUpload);
            Controls.Add(_state);

            base.CreateChildControls();
        }
Ejemplo n.º 5
0
        protected override void AttachChildControls()
        {
            this.serach_text    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_text");
            this.search_Subtext = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_Subtext");
            this.rptProducts    = (ThemedTemplatedRepeater)this.FindControl("rptProducts");

            this.pager               = (Pager)this.FindControl("pager");
            this.litProductCount     = (System.Web.UI.WebControls.Literal) this.FindControl("litProductCount");
            this.litSupplierDescribe = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierDescribe");

            if (!int.TryParse(this.Page.Request.QueryString["supplierId"], out supplierId))
            {
                base.GotoResourceNotFound();
                return;
            }

            SupplierInfo shipper = SupplierHelper.GetSupplier(this.supplierId);

            if (shipper == null)
            {
                base.GotoResourceNotFound();
                return;
            }
            else
            {
                litSupplierDescribe.Text = shipper.Description;
            }

            if (!this.Page.IsPostBack)
            {
                this.BindSearch();
            }
        }
Ejemplo n.º 6
0
        protected override void AttachChildControls()
        {
            this.specialShow = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("specialShow");

            if (CustomConfigHelper.Instance.IsProLa)
            {
                this.specialShow.Value = "proLa";
            }
        }
Ejemplo n.º 7
0
        protected override void AttachChildControls()
        {
            this.vcountdownproducts = (VshopTemplatedRepeater)this.FindControl("vcountdownproducts");
            this.txtTotal           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.litItemParams      = (Literal)this.FindControl("litItemParams");
            if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
            {
                num = 1;
            }
            if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
            {
                num2 = 10;
            }
            ProductBrowseQuery query = new ProductBrowseQuery
            {
                PageIndex = num,
                PageSize  = num2,
                SortBy    = "CountDownId",
                SortOrder = SortAction.Desc,
            };
            DbQueryResult drSource = ProductBrowser.GetCountDownProductList(query);

            num3 = drSource.TotalRecords;
            txtTotal.SetWhenIsNotNull(num3.ToString());
            this.vcountdownproducts.DataSource = drSource.Data;
            this.vcountdownproducts.DataBind();

            #region 微信分享内容配置
            SiteSettings     masterSettings     = SettingsManager.GetMasterSettings(false);
            DistributorsInfo userIdDistributors = new DistributorsInfo();
            userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
            if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
            {
                PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
            }
            string str3 = "";
            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                str3 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string str4 = "";
            string str5 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName;
            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0];
            }
            string strDes = masterSettings.ShopHomeDescription;
            if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.BrandShow)
            {
                strDes = "低价抢正品,马上有优惠,就在考拉萌购!";
            }

            this.litItemParams.Text = str3 + "|" + masterSettings.ShopHomeName + "|" + strDes + "$";
            this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str4, "|好店推荐之", str5, "商城|" + strDes + "|", HttpContext.Current.Request.Url });
            #endregion
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Hidden input field containing protected data
        /// </summary>
        /// <returns></returns>
        public System.Web.UI.HtmlControls.HtmlInputHidden HiddenFieldData()
        {
            System.Web.UI.HtmlControls.HtmlInputHidden input = new System.Web.UI.HtmlControls.HtmlInputHidden();
            input.Name            = "data";
            input.Value           = EncodedData();
            input.EnableViewState = false;
            input.EnableTheming   = false;

            return(input);
        }
Ejemplo n.º 9
0
 protected override void AttachChildControls()
 {
     //this.dropRegions = (RegionSelector) this.FindControl("dropRegions");
     this.specialHideShow = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("specialHideShow");
     //传递爽爽挝啡的特殊名到前端,前端用jquery进行相应的功能隐藏
     if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.AutoShipping)
     {
         specialHideShow.Value = "sswk";//爽爽挝啡
     }
     PageTitle.AddSiteNameTitle("添加收货地址");
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Overrides <see cref="Control.CreateChildControls"/>
        /// </summary>
        protected override void CreateChildControls()
        {
            widthHolder    = new System.Web.UI.HtmlControls.HtmlInputHidden();
            widthHolder.ID = "ResizeWidth";
            this.Controls.Add(widthHolder);
            widthHolder.ServerChange += new EventHandler(widthChanged);

            heightHolder    = new System.Web.UI.HtmlControls.HtmlInputHidden();
            heightHolder.ID = "ResizeHeight";
            this.Controls.Add(heightHolder);
            heightHolder.ServerChange += new EventHandler(heightChanged);
        }
Ejemplo n.º 11
0
        protected override void AttachChildControls()
        {
            string url = this.Page.Request.QueryString["returnUrl"];

            if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["returnUrl"]))
            {
                this.Page.Response.Redirect(url);
            }
            Member member = HiContext.Current.User as Member;

            if (member == null)
            {
                this.Page.Response.Redirect("/Vshop/Login.aspx");
            }

            this.rptProducts     = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.litProFavCount  = (System.Web.UI.WebControls.Literal) this.FindControl("litProFavCount");
            this.litSuppFavCount = (System.Web.UI.WebControls.Literal) this.FindControl("litSuppFavCount");
            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 = 8;
            }

            //
            ProductFavoriteQuery query = new ProductFavoriteQuery();

            query.PageIndex = pageIndex;
            query.PageSize  = pageSize;
            query.UserId    = member.UserId;
            query.GradeId   = member.GradeId;


            DbQueryResult dr = ProductBrowser.GetFavorites(query);

            this.rptProducts.DataSource = dr.Data;
            this.rptProducts.DataBind();

            this.litProFavCount.Text  = dr.TotalRecords.ToString();
            this.litSuppFavCount.Text = SupplierHelper.GetUserSupplierCollectCount(member.UserId).ToString();
            this.txtTotal.SetWhenIsNotNull(dr.TotalRecords.ToString());

            PageTitle.AddSiteNameTitle("我的收藏");
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 保存角色/用户的权限
        /// </summary>
        /// <param name="objectGridView"></param>
        /// <param name="ownerType"></param>
        void SaveObjectPermissions(GridView objectGridView, string ownerType)
        {
            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 objectID = objIDHidden.Value;

                AccountHelper.DeletePermission(typeID, objectID, AdviceTypeID);
                ArrayList al = new ArrayList();
                if (((CheckBox)objectGridView.Rows[i].FindControl("AdviceReadCheckBox")).Checked)
                {
                    al.Add("Advice.Read");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("AdviceAdminCheckbox")).Checked)
                {
                    al.Add("Advice.Admin");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("AdviceAcceptCheckbox")).Checked)
                {
                    al.Add("Advice.Accept");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("AdviceHandleCheckbox")).Checked)
                {
                    al.Add("Advice.Handle");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("AdviceFirstAuditCheckBox")).Checked)
                {
                    al.Add("Advice.FirstAudit");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("AdviceSecondAuditCheckBox")).Checked)
                {
                    al.Add("Advice.SecondAudit");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("AdviceThirdAuditCheckBox")).Checked)
                {
                    al.Add("Advice.ThirdAudit");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("AdviceRefuseCheckbox")).Checked)
                {
                    al.Add("Advice.Refuse");
                }
                if (((CheckBox)objectGridView.Rows[i].FindControl("AdviceTransferCheckBox")).Checked)
                {
                    al.Add("Advice.Transfer");
                }

                string[] adds = (string[])al.ToArray(typeof(string));
                AccountHelper.AddPermission(typeID, objectID, AdviceTypeID, adds);
            }
        }
Ejemplo n.º 13
0
        protected override void AttachChildControls()
        {
            Member member = (HiContext.Current.User) as  Member;

            this.hiid_AdUserId = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiid_AdUserId");
            if (this.hiid_AdUserId != null)
            {
                if (member != null)
                {
                    this.hiid_AdUserId.Value = member.UserId.ToString();
                }
            }
        }
Ejemplo n.º 14
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            this.litRecemmendCode = (System.Web.UI.WebControls.Literal) this.FindControl("litRecemmendCode");
            this.litJSApi         = (System.Web.UI.WebControls.Literal) this.FindControl("litJSApi");
            this.username         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("username");
            this.vuserid          = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("vuserid");
            this.litTotals        = (System.Web.UI.WebControls.Literal) this.FindControl("litTotals");
            this.litWeekLevel     = (System.Web.UI.WebControls.Literal) this.FindControl("litWeekLevel");
            this.litRecommendList = (System.Web.UI.WebControls.Literal) this.FindControl("litRecommendList");
            if (!this.IsPostBack)
            {
                if (this.Page.Request["userid"] != null)
                {
                    this.userId = SuserId(this.Page.Request["userid"].ToString());
                    Member member = Users.GetUserIdByUserSessionId(this.userId, false) as Member;
                    if (member == null)
                    {
                        Response.Write("会员信息不存在:" + this.Page.Request["userid"] + ";" + this.userId);
                        return;
                    }
                    this.vuserid.Value  = member.UserId.ToString();
                    this.username.Value = member.Username;
                    GetRecemmendCode(member.UserId);
                }
                else
                {
                    Member member = HiContext.Current.User as Member;
                    if (member != null)
                    {
                        this.vuserid.Value  = member.UserId.ToString();
                        this.username.Value = member.Username;
                        GetRecemmendCode(member.UserId);
                    }
                    else
                    {
                        if (user == null)
                        {
                            RegisterUser();
                        }
                        else
                        {
                            ErrorLog.Write("userid:" + user.UserId);
                            SetRecemendCode(user);
                        }
                    }
                }

                litJSApi.Text = GetJSApiScript();
            }
        }
Ejemplo n.º 15
0
        protected override void AttachChildControls()
        {
            this.serach_text    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_text");
            this.search_Subtext = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("search_Subtext");
            this.rptProducts    = (ThemedTemplatedRepeater)this.FindControl("rptProducts");

            this.pager               = (Pager)this.FindControl("pager");
            this.litProductCount     = (System.Web.UI.WebControls.Literal) this.FindControl("litProductCount");
            this.litSupplierDescribe = (System.Web.UI.WebControls.Literal) this.FindControl("litSupplierDescribe");


            if (!this.Page.IsPostBack)
            {
                this.BindSearch();
            }
        }
Ejemplo n.º 16
0
 void productlist_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     System.Web.UI.HtmlControls.HtmlInputHidden promotionProductId = (System.Web.UI.HtmlControls.HtmlInputHidden)e.Item.FindControl("promotionProductId");
     System.Web.UI.WebControls.DataList         dtPresendPro       = (System.Web.UI.WebControls.DataList)e.Item.FindControl("dtPresendPro");
     if (shoppingCart != null)
     {
         // 赠送活动
         List <ShoppingCartPresentInfo> presentList = (List <ShoppingCartPresentInfo>)shoppingCart.LinePresentPro;
         if (presentList != null && presentList.Count > 0)
         {
             var p = presentList.Where(m => m.PromotionProductId == (string.IsNullOrWhiteSpace(promotionProductId.Value) ? 0 : Convert.ToInt32(promotionProductId.Value))).Select(n => n);
             dtPresendPro.DataSource = p;
             dtPresendPro.DataBind();
         }
     }
 }
Ejemplo n.º 17
0
        /* Update Page */
        public void UpdatePage(IPage Source)
        {
            /* Current Page */
            System.Web.UI.HtmlControls.HtmlInputHidden cpage =
                (System.Web.UI.HtmlControls.HtmlInputHidden)(ControlLookup["CurrentPage"]);
            cpage.Value = Source.MainType.ToString();

            /* Select Limit */
            IGameOptionSet options = Source.PrimaryOptions;

            if (null != options.SelectionLimit)
            {
                System.Web.UI.HtmlControls.HtmlInputHidden sellim =
                    (System.Web.UI.HtmlControls.HtmlInputHidden)(ControlLookup["SelectLimit"]);
                sellim.Value = options.SelectionLimit.ToString();
            }
        }
Ejemplo n.º 18
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺列表");
            this.txtTotal         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.rptSupplierList  = (VshopTemplatedRepeater)this.FindControl("rptSupplierList");
            this.rpthistorysearch = (VshopTemplatedRepeater)this.FindControl("rpthistorysearch");

            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;
            }

            string supplierName = this.Page.Request.QueryString["keyWord"];

            SupplierQuery query = new SupplierQuery();

            query.SupplierName = supplierName;
            query.PageIndex    = pageIndex;
            query.PageSize     = pageSize;
            query.UserId       = HiContext.Current.User.UserId;

            DbQueryResult dt = SupplierHelper.GetAppSupplier(query);

            this.rptSupplierList.DataSource = dt.Data;
            this.rptSupplierList.DataBind();
            this.txtTotal.SetWhenIsNotNull(dt.TotalRecords.ToString());

            int userId = HiContext.Current.User.UserId;

            if (userId > 0 && this.rpthistorysearch != null)
            {
                this.rpthistorysearch.DataSource = HistorySearchHelp.GetSearchHistory(userId, ClientType.VShop, 6);
                this.rpthistorysearch.DataBind();
            }
        }
Ejemplo n.º 19
0
 void shoppingCartProductList_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.HtmlControls.HtmlInputHidden hidsupplierId = (System.Web.UI.HtmlControls.HtmlInputHidden)e.Item.FindControl("hidsupplierId");
         System.Web.UI.WebControls.DataList         productlist   = (System.Web.UI.WebControls.DataList)e.Item.FindControl("rpProduct");
         productlist.ItemCommand   += productlist_ItemCommand;
         productlist.ItemDataBound += productlist_ItemDataBound;
         if (productlist != null)
         {
             if (shoppingCart != null)
             {
                 List <ShoppingCartItemInfo> list = (List <ShoppingCartItemInfo>)shoppingCart.LineItems;
                 var llist = list.Where(p => p.SupplierId == Convert.ToInt32(hidsupplierId.Value)).Select(c => c);
                 productlist.DataSource = llist;
                 productlist.DataBind();
             }
         }
     }
 }
Ejemplo n.º 20
0
 void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.HtmlControls.HtmlInputHidden promotionProductId = (System.Web.UI.HtmlControls.HtmlInputHidden)e.Item.FindControl("promotionProductId");
         System.Web.UI.WebControls.Repeater         dtPresendPro       = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("dtPresendPro");
         ShoppingCartInfo shoppingCart = ShoppingCartProcessor.GetShoppingCart();
         if (shoppingCart != null)
         {
             // 赠送活动
             List <ShoppingCartPresentInfo> presentList = (List <ShoppingCartPresentInfo>)shoppingCart.LinePresentPro;
             if (presentList != null && presentList.Count > 0)
             {
                 var p = presentList.Where(m => m.PromotionProductId == (string.IsNullOrWhiteSpace(promotionProductId.Value) ? 0 : Convert.ToInt32(promotionProductId.Value))).Select(n => n);
                 dtPresendPro.DataSource = p;
                 dtPresendPro.DataBind();
             }
         }
     }
 }
Ejemplo n.º 21
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("积分记录");
            this.rptUserPointList = (VshopTemplatedRepeater)this.FindControl("rptUserPointList");
            this.txtTotal         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.litSumPoint      = (System.Web.UI.WebControls.Literal) this.FindControl("litSumPoint");
            this.litPoint         = (System.Web.UI.WebControls.Literal) this.FindControl("litPoint");

            Member member = HiContext.Current.User as Member;

            if (member == null)
            {
                this.Page.Response.Redirect("/Vshop/Login.aspx");
            }

            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 = 8;
            }

            DbQueryResult dr = TradeHelper.GetUserPoints(member.UserId, pageIndex, pageSize);

            this.rptUserPointList.DataSource = dr.Data;
            this.rptUserPointList.DataBind();
            this.txtTotal.SetWhenIsNotNull(dr.TotalRecords.ToString());
            //points = member.Points;
            //availablePoints = member.Points;
            this.litSumPoint.SetWhenIsNotNull(member.Points.ToString());
            this.litPoint.SetWhenIsNotNull(member.Points.ToString());
        }
Ejemplo n.º 22
0
        protected void listOrders_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
            {
                System.Web.UI.HtmlControls.HtmlInputHidden hidsupplierId = (System.Web.UI.HtmlControls.HtmlInputHidden)e.Item.FindControl("hidsupplierId");

                System.Web.UI.WebControls.Repeater repeater = (System.Web.UI.WebControls.Repeater)e.Item.FindControl("rpProduct");
                if (repeater != null)
                {
                    repeater.ItemDataBound += repeater_ItemDataBound;
                    ShoppingCartInfo shoppingCart = ShoppingCartProcessor.GetShoppingCart();

                    if (shoppingCart != null)
                    {
                        List <ShoppingCartItemInfo> list = (List <ShoppingCartItemInfo>)shoppingCart.LineItems;

                        var llist = list.Where(p => p.SupplierId == Convert.ToInt32(hidsupplierId.Value)).Select(c => c);
                        repeater.DataSource = llist;
                        repeater.DataBind();
                    }
                }
            }
        }
Ejemplo n.º 23
0
        protected override void CreateChildControls()
        {
            inputGroup = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
            inputGroup.Attributes.Add("class", "input-group");
            Controls.Add(inputGroup);


                ctrl = new System.Web.UI.HtmlControls.HtmlInputText();
                ctrl.ID = "ctrl";
                ctrl.Attributes.Add("class", "form-control");
                ctrl.Attributes.Add("disabled", "disabled");
                inputGroup.Controls.Add(ctrl);

                inputGroupButton = new System.Web.UI.HtmlControls.HtmlGenericControl();
                inputGroupButton.Attributes.Add("class", "input-group-btn");
                inputGroup.Controls.Add(inputGroupButton);

                PickerButton = new System.Web.UI.HtmlControls.HtmlButton();
                PickerButton.ID = "PickerButton";
                PickerButton.Attributes.Add("class", "btn btn-default");
                PickerButton.InnerText = "...";
                inputGroupButton.Controls.Add(PickerButton);

                ResetButton = new System.Web.UI.WebControls.Button();
                ResetButton.ID = "ResetButton";
                ResetButton.Attributes.Add("class", "btn btn-default");
                ResetButton.Text = "Reset";
                inputGroupButton.Controls.Add(ResetButton);


                ctrlvalue = new System.Web.UI.HtmlControls.HtmlInputHidden();
                ctrlvalue.ID = "ctrlvalue";
                ctrlvalue.Name = "ctrlvalue";
                inputGroup.Controls.Add(ctrlvalue);
   
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Set back the updated value from the dataset to each controls of the panel
        /// Also sets validation and javascript events on the controls.
        /// </summary>
        /// <param name="PanelControls"></param>
        /// <param name="datasetDocument"></param>
        public void SetControlValues(System.Web.UI.WebControls.Panel PanelControls, DataSet datasetDocument)
        {
            try
            {
                System.Web.UI.WebControls.HiddenField HiddenFieldValidation = new System.Web.UI.WebControls.HiddenField();
                using (datasetDocument)
                {
                    HiddenFieldValidation.ID = "HiddenFieldValidation";
                    PanelControls.Controls.Add(HiddenFieldValidation);
                    System.Collections.IEnumerator eControls = PanelControls.Controls.GetEnumerator();
                    while (eControls.MoveNext())
                    {
                        object objCurrentControl = eControls.Current;
                        switch (objCurrentControl.GetType().ToString())
                        {
                        case "System.Web.UI.HtmlControls.HtmlInputHidden":
                        {
                            System.Web.UI.HtmlControls.HtmlInputHidden hdnTemp = (System.Web.UI.HtmlControls.HtmlInputHidden)objCurrentControl;
                            string primaryKey = hdnTemp.Attributes["PrimaryKey"];

                            if (!String.IsNullOrEmpty(primaryKey))
                            {
                                string fieldName = hdnTemp.Attributes["FieldName"];
                                string tableName = hdnTemp.Attributes["TableName"];
                                if (CheckFieldValues(tableName, fieldName, datasetDocument))
                                {
                                    hdnTemp.Value = datasetDocument.Tables[tableName].Rows[0][fieldName].ToString();
                                }
                            }
                            break;
                        }

                        case "System.Web.UI.WebControls.TextBox":
                        {
                            System.Web.UI.WebControls.TextBox txtTemp = (System.Web.UI.WebControls.TextBox)objCurrentControl;
                            txtTemp.Attributes.Add("OnChange", "isdirty()");
                            string fieldName  = txtTemp.Attributes["FieldName"];
                            string tableName  = txtTemp.Attributes["TableName"];
                            string validation = txtTemp.Attributes["Validate"];

                            if (!String.IsNullOrEmpty(validation))
                            {
                                if (HiddenFieldValidation.Value == "")
                                {
                                    HiddenFieldValidation.Value = txtTemp.ClientID;
                                }
                                else
                                {
                                    HiddenFieldValidation.Value += ";" + txtTemp.ClientID;
                                }
                            }
                            if (CheckFieldValues(tableName, fieldName, datasetDocument))
                            {
                                txtTemp.Text = datasetDocument.Tables[tableName].Rows[0][fieldName].ToString();
                            }
                            break;
                        }

                        case "System.Web.UI.WebControls.CheckBox":
                        {
                            System.Web.UI.WebControls.CheckBox chkTemp = (System.Web.UI.WebControls.CheckBox)objCurrentControl;
                            chkTemp.Attributes.Add("OnClick", "isdirty()");
                            string fieldName  = chkTemp.Attributes["FieldName"];
                            string tableName  = chkTemp.Attributes["TableName"];
                            string validation = chkTemp.Attributes["Validate"];

                            if (!String.IsNullOrEmpty(validation))
                            {
                                if (HiddenFieldValidation.Value == "")
                                {
                                    HiddenFieldValidation.Value = chkTemp.ClientID;
                                }
                                else
                                {
                                    HiddenFieldValidation.Value += ";" + chkTemp.ClientID;
                                }
                            }
                            if (CheckFieldValues(tableName, fieldName, datasetDocument))
                            {
                                chkTemp.Checked = datasetDocument.Tables[tableName].Rows[0][fieldName].ToString() == "Y" ? true : false;
                            }
                            break;
                        }

                        case "System.Web.UI.WebControls.DropDownList":
                        {
                            System.Web.UI.WebControls.DropDownList ddlTemp = (System.Web.UI.WebControls.DropDownList)objCurrentControl;
                            ddlTemp.Attributes.Add("OnChange", "isdirty()");
                            string fieldName      = ddlTemp.Attributes["FieldName"];
                            string tableName      = ddlTemp.Attributes["TableName"];
                            string dataSource     = ddlTemp.Attributes["DataSource"];    /////////No Need
                            string SelectCase     = ddlTemp.Attributes["SelectCase"];
                            string SelectType     = ddlTemp.Attributes["SelectType"];
                            string dataTextField  = ddlTemp.Attributes["TextField"];
                            string dataValueField = ddlTemp.Attributes["ValueField"];
                            string validation     = ddlTemp.Attributes["Validate"];

                            if (!String.IsNullOrEmpty(validation))
                            {
                                if (HiddenFieldValidation.Value == "")
                                {
                                    HiddenFieldValidation.Value = ddlTemp.ClientID;
                                }
                                else
                                {
                                    HiddenFieldValidation.Value += ";" + ddlTemp.ClientID;
                                }
                            }

                            //FillDropDowns(ddlTemp, dataSource, dataTextField, dataValueField);
                            FillDropDowns(ddlTemp, dataSource, dataTextField, dataValueField, SelectCase, SelectType);
                            if (CheckFieldValues(tableName, fieldName, datasetDocument))
                            {
                                ddlTemp.SelectedValue = datasetDocument.Tables[tableName].Rows[0][fieldName].ToString();
                            }
                            break;
                        }

                        case "System.Web.UI.WebControls.RadioButton":
                        {
                            System.Web.UI.WebControls.RadioButton rbTemp = (System.Web.UI.WebControls.RadioButton)objCurrentControl;
                            rbTemp.Attributes.Add("OnClick", "isdirty()");
                            string fieldName  = rbTemp.Attributes["FieldName"];
                            string tableName  = rbTemp.Attributes["TableName"];
                            string value      = rbTemp.Attributes["Value"];
                            string validation = rbTemp.Attributes["Validate"];

                            if (!String.IsNullOrEmpty(validation))
                            {
                                if (HiddenFieldValidation.Value == "")
                                {
                                    HiddenFieldValidation.Value = rbTemp.ClientID;
                                }
                                else
                                {
                                    HiddenFieldValidation.Value += ";" + rbTemp.ClientID;
                                }
                            }

                            if (CheckFieldValues(tableName, fieldName, datasetDocument))
                            {
                                if (datasetDocument.Tables[tableName].Rows[0][fieldName].ToString().Trim() == value.Trim())
                                {
                                    rbTemp.Checked = true;
                                }
                            }
                            break;
                        }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Creates datarows pertaining to the controls in the panel and updates them
        /// </summary>
        /// <param name="PanelControls">Panel with contains the collection </param>
        /// <param name="objTemp">Object which contains values regarding the documentrow</param>
        /// <returns>true on successful update</returns>
        public bool UpdateData(System.Web.UI.WebControls.Panel PanelControls, ref object objTemp)
        {
            try
            {
                objCommonBase = new Streamline.DataService.CommonBase();
                System.Collections.Hashtable hashTableTemp = (System.Collections.Hashtable)objTemp;
                string dataFileTemp        = PanelControls.Attributes["DataFile"];
                string dataFileAfterUpdate = PanelControls.Attributes["DataFileAfterUpdate"];

                //This statement is used to get the collections of controls in the panel.
                //GetEnumerator is a forward only and light weight cursor.Hence it is more efficient than
                // For each control in Panel.
                System.Collections.IEnumerator eControls = PanelControls.Controls.GetEnumerator();
                datasetMain = new DataSet();


                if (!String.IsNullOrEmpty(dataFileAfterUpdate))
                {
                    datasetMain.ReadXml(PATH + System.Web.HttpContext.Current.Session.SessionID + "\\" + dataFileAfterUpdate, XmlReadMode.ReadSchema);
                    datasetMain.AcceptChanges();
                }
                else
                {
                    datasetMain.ReadXmlSchema(PATH + dataFileTemp);
                }

                newRow = true;
                //if(hashTableTemp.ContainsKey("DocumentId"))
                //   AddDataRowValues(tableName, fieldName, hdnTemp.Value, primaryKey == "True" ? true : false);
                //if(hashTableTemp.ContainsKey("Version"))
                //   AddDataRowValues(tableName, fieldName, hdnTemp.Value, primaryKey == "True" ? true : false);

                while (eControls.MoveNext())
                {
                    object objCurrentControl = eControls.Current;
                    switch (objCurrentControl.GetType().ToString())
                    {
                    case "System.Web.UI.HtmlControls.HtmlInputHidden":
                    {
                        System.Web.UI.HtmlControls.HtmlInputHidden hdnTemp = (System.Web.UI.HtmlControls.HtmlInputHidden)objCurrentControl;
                        string primaryKey = hdnTemp.Attributes["PrimaryKey"];
                        if (!String.IsNullOrEmpty(primaryKey))
                        {
                            string fieldName = hdnTemp.Attributes["FieldName"];
                            string tableName = hdnTemp.Attributes["TableName"];
                            if (primaryKey == "True")
                            {
                                if (String.IsNullOrEmpty(hdnTemp.Value))
                                {
                                    if (hashTableTemp.ContainsKey(fieldName))
                                    {
                                        hdnTemp.Value = hashTableTemp[fieldName].ToString();
                                    }
                                }
                                else
                                {
                                    newRow = false;
                                }
                                AddDataRowValues(tableName, fieldName, hdnTemp.Value, primaryKey == "True" ? true : false);
                            }
                        }
                        break;
                    }

                    case "System.Web.UI.WebControls.TextBox":
                    {
                        System.Web.UI.WebControls.TextBox txtTemp = (System.Web.UI.WebControls.TextBox)objCurrentControl;
                        string fieldName = txtTemp.Attributes["FieldName"];
                        string tableName = txtTemp.Attributes["TableName"];
                        AddDataRowValues(tableName, fieldName, txtTemp.Text, false);
                        break;
                    }

                    case "System.Web.UI.WebControls.CheckBox":
                    {
                        System.Web.UI.WebControls.CheckBox chkTemp = (System.Web.UI.WebControls.CheckBox)objCurrentControl;
                        string fieldName = chkTemp.Attributes["FieldName"];
                        string tableName = chkTemp.Attributes["TableName"];
                        AddDataRowValues(tableName, fieldName, chkTemp.Checked == true ? "Y" : "N", false);
                        break;
                    }

                    case "System.Web.UI.WebControls.DropDownList":
                    {
                        System.Web.UI.WebControls.DropDownList ddlTemp = (System.Web.UI.WebControls.DropDownList)objCurrentControl;
                        string fieldName = ddlTemp.Attributes["FieldName"];
                        string tableName = ddlTemp.Attributes["TableName"];
                        AddDataRowValues(tableName, fieldName, ddlTemp.SelectedValue, false);
                        break;
                    }

                    case "System.Web.UI.WebControls.RadioButton":
                    {
                        System.Web.UI.WebControls.RadioButton rbTemp = (System.Web.UI.WebControls.RadioButton)objCurrentControl;
                        string fieldName = rbTemp.Attributes["FieldName"];
                        string tableName = rbTemp.Attributes["TableName"];
                        string value     = rbTemp.Attributes["Value"];
                        if (rbTemp.Checked == true)
                        {
                            AddDataRowValues(tableName, fieldName, value, false);
                        }
                        break;
                    }
                    }
                }

                //Merging the documents table to the maindataset
                datasetMain.Merge(getDocumentTable(objTemp));

                DataSet dsUpdated  = objCommonBase.UpdateDocuments(datasetMain);
                string  updateFile = System.Guid.NewGuid().ToString() + ".xml";
                dsUpdated.WriteXml(PATH + System.Web.HttpContext.Current.Session.SessionID + "\\" + updateFile, XmlWriteMode.WriteSchema);
                PanelControls.Attributes["DataFileAfterUpdate"] = updateFile;

                // setting back the updated documentid and version id to the arguments passed by the parent class
                if (dsUpdated.Tables.Count > 0)
                {
                    if (dsUpdated.Tables[0].Columns.Contains("DocumentId"))
                    {
                        if (dsUpdated.Tables[0].Rows.Count > 0)
                        {
                            if (hashTableTemp.ContainsKey("DocumentId"))
                            {
                                hashTableTemp["DocumentId"] = Convert.ToInt32(dsUpdated.Tables[0].Rows[0]["DocumentId"]);
                            }
                            else
                            {
                                hashTableTemp.Add("DocumentId", Convert.ToInt32(dsUpdated.Tables[0].Rows[0]["DocumentId"]));
                            }

                            if (hashTableTemp.ContainsKey("Version"))
                            {
                                hashTableTemp["Version"] = Convert.ToInt32(dsUpdated.Tables[0].Rows[0]["Version"]);
                            }
                            else
                            {
                                hashTableTemp.Add("Version", Convert.ToInt32(dsUpdated.Tables[0].Rows[0]["Version"]));
                            }
                        }
                    }
                }


                // SetControlValues(PanelControls, dsUpdated);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Ejemplo n.º 26
0
 protected void SetDataSource(DataTable dataSource, string SelectedPageGridValue, System.Web.UI.HtmlControls.HtmlInputHidden SelectedPageGrid)
 {
     SetDataSource(dataSource.DefaultView, SelectedPageGridValue, SelectedPageGrid);
 }
Ejemplo n.º 27
0
        ///////////////////////////////
        ///

        protected void InitDataSource(DataView dataSource, string SelectedPageGridValue, System.Web.UI.HtmlControls.HtmlInputHidden SelectedPageGrid)
        {
            this.MyDataSource = dataSource;
            this.SelectedPageGridValueBase = SelectedPageGridValue;
            this.SelectedPageGridBase      = SelectedPageGrid;
        }
Ejemplo n.º 28
0
        protected System.Web.UI.Control CharCreateControls(IPage Source)
        {
            System.Web.UI.WebControls.Panel p = new System.Web.UI.WebControls.Panel();

            p.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;

            /* Name */
            System.Web.UI.WebControls.TextBox NameBox = new System.Web.UI.WebControls.TextBox()
            {
                ID          = "Avatar_Name",
                Text        = "Faerina",
                BorderStyle = System.Web.UI.WebControls.BorderStyle.None,
                Width       = System.Web.UI.WebControls.Unit.Percentage(100)
            };
            NameBox.Font.Size = System.Web.UI.WebControls.FontUnit.Larger;
            p.Controls.Add(NameBox);

            List <string> AvatarParts = new List <string>()
            {
                "skin", "wings", "hair", "pants", "shirt", "shoes"
            };

            System.Web.UI.WebControls.Panel combined = new System.Web.UI.WebControls.Panel()
            {
                CssClass = "OverlapContainer",
                Width    = System.Web.UI.WebControls.Unit.Pixel(262),
                Height   = System.Web.UI.WebControls.Unit.Pixel(332),
            };

            foreach (string part in AvatarParts)
            {
                combined.Controls.Add(new System.Web.UI.WebControls.Image()
                {
                    ImageUrl = "Images/Avatar/char_" + part + ".png",
                    CssClass = "OverlapImage img_" + part
                });
            }
            System.Web.UI.WebControls.Panel scom = new System.Web.UI.WebControls.Panel()
            {
                HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center
            };
            scom.Controls.Add(combined);
            p.Controls.Add(scom);
            Dictionary <string, int> BaseColor = new Dictionary <string, int>
            {
                { "skin", 195 },
                { "wings", 193 },
                { "hair", 61 },
                { "pants", 82 },
                { "shirt", 154 },
                { "shoes", 45 }
            };
            Dictionary <string, double> PartBrightBase = new Dictionary <string, double>
            {
                { "skin", .3 },
                { "wings", .3 },
                { "hair", .2 },
                { "pants", .4 },
                { "shirt", .3 },
                { "shoes", .2 }
            };
            Dictionary <string, double> PartBright = new Dictionary <string, double>
            {
                { "skin", .2 },
                { "wings", .2 },
                { "hair", .5 },
                { "pants", .4 },
                { "shirt", .2 },
                { "shoes", .5 }
            };

            foreach (string part in AvatarParts)
            {
                //inline block
                System.Web.UI.WebControls.Panel icom = new System.Web.UI.WebControls.Panel()
                {
                    CssClass = "TileImage"
                };
                System.Web.UI.HtmlControls.HtmlTable Tabular =
                    new System.Web.UI.HtmlControls.HtmlTable();
                int HueCount    = 5;
                int BrightCount = 5;
                int HueSpacing  = 360 / HueCount;
                int HueBase     = 45;
                if (part == "skin")
                {
                    HueBase = -HueBase;
                }
                for (int row_idx = 0; row_idx < HueCount + 1; ++row_idx)
                {
                    System.Web.UI.HtmlControls.HtmlTableRow row =
                        new System.Web.UI.HtmlControls.HtmlTableRow();
                    if (row_idx < HueCount)
                    {
                        //Hue
                        row.Cells.Add(new System.Web.UI.HtmlControls.HtmlTableCell()
                        {
                            Controls =
                            {
                                Stylize(new System.Web.UI.WebControls.Button()
                                {
                                    UseSubmitBehavior = false,
                                    Text        = " ",
                                    BorderStyle =
                                        System.Web.UI.WebControls.BorderStyle.None,
                                    OnClientClick = "changeHue('"
                                                    + part
                                                    + "',"
                                                    + ((HueSpacing * (row_idx - 2)) + HueBase)
                                                    + ");//",
                                    BackColor = System.Drawing.Color.FromArgb(
                                        BaseColor[part], BaseColor[part], BaseColor[part]
                                        )
                                },
                                        "filter_brightness_" + part,
                                        "sepia(1)"
                                        + " hue-rotate("
                                        + ((HueSpacing * (row_idx - 2)) + HueBase)
                                        + "deg)"
                                        )
                            }
                        });
                        if (row_idx == 0)
                        {
                            System.Web.UI.HtmlControls.HtmlInputHidden partHue =
                                new System.Web.UI.HtmlControls.HtmlInputHidden()
                            {
                                ID            = "val_h_" + part,
                                Value         = HueBase.ToString(),
                                ViewStateMode = System.Web.UI.ViewStateMode.Disabled
                            };
                            System.Web.UI.HtmlControls.HtmlInputHidden partBri =
                                new System.Web.UI.HtmlControls.HtmlInputHidden()
                            {
                                ID            = "val_b_" + part,
                                Value         = (PartBrightBase[part] + PartBright[part] * 2).ToString(),
                                ViewStateMode = System.Web.UI.ViewStateMode.Disabled
                            };
                            System.Web.UI.WebControls.Image img =
                                new System.Web.UI.WebControls.Image()
                            {
                                ImageUrl = "Images/Avatar/Zoom/char_" + part + ".png",
                                CssClass = "img_" + part
                            };


                            row.Cells.Add(new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                ColSpan  = HueCount,
                                RowSpan  = BrightCount,
                                Controls = { img, partHue, partBri }
                            });
                        }
                    }
                    else
                    {
                        row.Cells.Add(new System.Web.UI.HtmlControls.HtmlTableCell());
                        for (int col_idx = 0; col_idx < BrightCount; ++col_idx)
                        {
                            row.Cells.Add(new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    Stylize(
                                        new System.Web.UI.WebControls.Button()
                                    {
                                        UseSubmitBehavior = false,
                                        Text        = " ",
                                        BorderStyle =
                                            System.Web.UI.WebControls.BorderStyle.None,
                                        OnClientClick = "changeBrightness('"
                                                        + part
                                                        + "',"
                                                        + (PartBrightBase[part] + PartBright[part] * col_idx)
                                                        + ");//",
                                        BackColor = System.Drawing.Color.FromArgb(
                                            BaseColor[part], BaseColor[part], BaseColor[part]
                                            )
                                    },
                                        "filter_hue_" + part,
                                        "sepia(1) brightness("
                                        + (PartBrightBase[part] + PartBright[part] * col_idx)
                                        + ");"
                                        )
                                }
                            });
                        }
                    }
                    Tabular.Rows.Add(row);
                }
                icom.Controls.Add(Tabular);
                p.Controls.Add(icom);
            }


            return(p);
        }
Ejemplo n.º 29
0
        public System.Web.UI.Control RenderOptions(IGameOptionSet options, bool Selectable)
        {
            int OptionCount  = 0;
            int OptionColumn = 0;

            System.Web.UI.HtmlControls.HtmlTable OptTab =
                new System.Web.UI.HtmlControls.HtmlTable();
            List <IGameOption> renderList = GetOptionList(options);

            foreach (IGameOption opt in renderList)
            {
                ++OptionCount;
                System.Web.UI.WebControls.Panel optionPanel =
                    RenderOption(opt, Selectable);

                if (OptionColumn == 0)
                {
                    OptTab.Rows.Add(new System.Web.UI.HtmlControls.HtmlTableRow());
                    OptionColumn++;
                }
                else
                {
                    OptionColumn = 0;
                }

                OptTab.Rows[OptTab.Rows.Count - 1].Cells.Add(
                    new System.Web.UI.HtmlControls.HtmlTableCell()
                {
                    Controls = { optionPanel }
                }
                    );
            }

            System.Web.UI.WebControls.Panel panel = new System.Web.UI.WebControls.Panel();
            if (OptionCount > 0)
            {
                panel.Controls.Add(OptTab);
            }
            if (Selectable)
            {
                if (null != options.SelectionLimit)
                {
                    ControlLookup["SelectLimit"] = new System.Web.UI.HtmlControls.HtmlInputHidden()
                    {
                        ID            = "SelectLimit",
                        Value         = options.SelectionLimit.ToString(),
                        ViewStateMode = System.Web.UI.ViewStateMode.Disabled
                    };
                    panel.Controls.Add(ControlLookup["SelectLimit"]);
                }

                if (null != options.Finalizer)
                {
                    panel.Controls.Add(new System.Web.UI.HtmlControls.HtmlInputSubmit()
                    {
                        ID            = "Finalizer",
                        Value         = options.Finalizer.OptionName,
                        ViewStateMode = System.Web.UI.ViewStateMode.Disabled
                    });
                }
            }
            return(panel);
        }
Ejemplo n.º 30
0
        public System.Web.UI.Control RenderPage(GameState GameStatus, IPage Source, bool debugInfo)
        {
            System.Web.UI.Control Body;

            if (debugInfo)
            {
                return(RenderDebugInfo(GameStatus, Source));
            }

            System.Web.UI.HtmlControls.HtmlForm director = new System.Web.UI.HtmlControls.HtmlForm()
            {
                Action = "."
            };
            director.EnableViewState = false;
            director.ViewStateMode   = System.Web.UI.ViewStateMode.Disabled;
            director.Style["border"] = "1px solid black";
            Body = director;

            if (Source.Background != null)
            {
                Body.Controls.Add(ImageFromObject(Source.Background, "", false));
            }
            else
            {
                if (null != GameStatus &&
                    null != GameStatus.Player &&
                    null != GameStatus.Player.Avatar &&
                    null != GameStatus.Player.Avatar.Picture)
                {
                    System.Web.UI.HtmlControls.HtmlTable DisplayTable =
                        new System.Web.UI.HtmlControls.HtmlTable();
                    DisplayTable.Rows.Add(new System.Web.UI.HtmlControls.HtmlTableRow()
                    {
                        Cells =
                        {
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    ImageFromObject(
                                        GameStatus.Player.Avatar.Picture,
                                        "Player_Avatar_Picture",
                                        false
                                        )
                                }
                            },
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    RenderNutrientBlock(GameStatus.Player.Nutrients,
                                                        "Status", false
                                                        )
                                }
                            },
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    RenderNutrientBlock(GameStatus.CurrentDelta,
                                                        "Current", false
                                                        )
                                }
                            },
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    RenderNutrientBlock(GameStatus.DailyDelta,
                                                        "Change Today", true
                                                        )
                                }
                            }
                        }
                    });
                    DisplayTable.Rows.Add(new System.Web.UI.HtmlControls.HtmlTableRow()
                    {
                        Cells =
                        {
                            new System.Web.UI.HtmlControls.HtmlTableCell()
                            {
                                Controls =
                                {
                                    new System.Web.UI.WebControls.Label()
                                    {
                                        Text = "<br/>Energy: "
                                               + GameStatus.Player.Energy.ToString()
                                    },
                                    new System.Web.UI.WebControls.Label()
                                    {
                                        Text = "<br/>Focus: "
                                               + GameStatus.Player.Focus.ToString()
                                    },
                                    new System.Web.UI.WebControls.Label()
                                    {
                                        Text = "<br/>Hunger: "
                                               + GameStatus.Player.Hunger.ToString()
                                    },
                                    new System.Web.UI.WebControls.Label()
                                    {
                                        Text = "<br/>kCal/target: "
                                               + GameStatus.Player.Calories.ToString()
                                               + " / "
                                               + GameStatus.Player.TargetCalories.ToString()
                                    },
                                }
                            }
                        }
                    });
                    Body.Controls.Add(DisplayTable);
                }
            }
            if (Source.Title != null)
            {
                Body.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("h3")
                {
                    InnerHtml = Source.Title
                });
            }
            if (Source.Message != null)
            {
                System.Web.UI.WebControls.Panel MessagePanel = new System.Web.UI.WebControls.Panel();
                MessagePanel.Controls.Add(new System.Web.UI.WebControls.Label()
                {
                    Text = Source.Message
                });
                Body.Controls.Add(MessagePanel);
            }

            System.Web.UI.ControlCollection form = Body.Controls;

            ControlLookup["CurrentPage"] = new System.Web.UI.HtmlControls.HtmlInputHidden()
            {
                ID            = "stg_curpage",
                Value         = Source.MainType.ToString(),
                ViewStateMode = System.Web.UI.ViewStateMode.Disabled
            };
            form.Add(ControlLookup["CurrentPage"]);

            /* Special Handling for Character Creation */
            if (Source.MainType == GameState.PageType.Char_Creation)
            {
                form.Add(CharCreateControls(Source));
            }

            if (null != Source.PrimaryOptions)
            {
                form.Add(RenderOptions(Source.PrimaryOptions, true));
            }
            if (null != Source.AppliedOptions)
            {
                form.Add(RenderOptions(Source.AppliedOptions, false));
            }

            return(Body);
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Overrides <see cref="Control.CreateChildControls"/>
        /// </summary>
        protected override void CreateChildControls()
        {
            widthHolder = new System.Web.UI.HtmlControls.HtmlInputHidden();
            widthHolder.ID = "ResizeWidth";
            this.Controls.Add(widthHolder);
            widthHolder.ServerChange += new EventHandler( widthChanged );

            heightHolder = new System.Web.UI.HtmlControls.HtmlInputHidden();
            heightHolder.ID = "ResizeHeight";
            this.Controls.Add(heightHolder);
            heightHolder.ServerChange += new EventHandler( heightChanged );
        }
Ejemplo n.º 32
0
 private System.String searchPatternAdd( System.String key, ref bool forcecache )
 {
     System.String patternitem, Value, format, searchtype;
     Value = System.String.Empty;
     format = System.String.Empty;
     patternitem = System.String.Empty;
     searchtype = "OR";
     switch ( key ) {
         case "fromsearch":
             if ( !this.IsPostBack && Context.Handler is anmar.SharpWebMail.UI.Search ) {
                 anmar.SharpWebMail.UI.Search search = (anmar.SharpWebMail.UI.Search)Context.Handler;
                 Value = search.From;
                 format = "From like '%{0}%'";
                 if ( Value.Length>0 )
                     forcecache = true;
             }
             break;
         case "subjectsearch":
             if ( !this.IsPostBack && Context.Handler is anmar.SharpWebMail.UI.Search ) {
                 anmar.SharpWebMail.UI.Search search = (anmar.SharpWebMail.UI.Search)Context.Handler;
                 Value = search.Subject;
                 format = "Subject like '%{0}%'";
                 if ( Value.Length>0 )
                     forcecache = true;
             }
             break;
         case "SharpUI:fromsearch":
             Value = Request.Form[key];
             key = key.Remove(0, 8);
             format = "From like '%{0}%'";
             if ( Value.Length>0 )
                 forcecache = true;
             break;
         case "SharpUI:subjectsearch":
             Value = Request.Form[key];
             key = key.Remove(0, 8);
             format = "Subject like '%{0}%'";
             if ( Value.Length>0 )
                 forcecache = true;
             break;
     }
     if ( format.Length>0 && Value.Length>0 ) {
         Value = Value.Trim();
         System.String[] items = Value.Replace("\'", "\'\'").Split (' ');
         patternitem += " AND (";
         for ( int i=0; i<items.Length; i++ ) {
             if ( items[i].StartsWith("\"") && !items[i].EndsWith("\"")) {
                 items[i+1] = System.String.Format ( "{0} {1}", items[i], items[i+1]);
             }
             if ( i>0 )
                 patternitem += " " + searchtype + " ";
             patternitem += System.String.Format ( format, items[i] );
         }
         patternitem += ")";
         System.Web.UI.HtmlControls.HtmlInputHidden hidden = new System.Web.UI.HtmlControls.HtmlInputHidden();
         hidden.ID = key;
         hidden.Value = Value;
         this.inboxWindowSearchHolder.Controls.Add ( hidden );
     }
     return patternitem;
 }
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     hiddenvalue = hiddenSearchClick;
 }
Ejemplo n.º 34
0
 private void AddHiddenField(string name, string value)
 {
     System.Web.UI.HtmlControls.HtmlInputHidden htmlHidden = new System.Web.UI.HtmlControls.HtmlInputHidden();
     htmlHidden.ID = name;
     htmlHidden.Name = name;
     htmlHidden.Value = value;
     Page.Form.Controls.Add(htmlHidden);
 }