protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\git\web-application-dev\online_album\App_Data\Database1.mdf;Integrated Security=True"); //创建连接对象
            con.Open();
            SqlCommand cmd = new SqlCommand("select * from [photo]", con);
            SqlDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                Panel box = new Panel();
                box.CssClass = "box";
                Panel1.Controls.Add(box);

                Image photo = new Image();
                photo.CssClass = "photo";
                photo.ImageUrl = "~/Images/" + dr["uid"].ToString() + "/" + dr["filename"].ToString(); ;
                box.Controls.Add(photo);

                box.Controls.Add(new Literal() { Text = "<br />" });

                Label uid = new Label();
                uid.Text = dr["uid"].ToString();
                box.Controls.Add(uid);

                box.Controls.Add(new Literal() { Text = "<br />" });

                Label datetime = new Label();
                datetime.Text = dr["datetime"].ToString();
                box.Controls.Add(datetime);
            }
        }
Beispiel #2
0
        protected override void InitializeSkin(System.Web.UI.Control Skin)
        {
          //if(Context.Session["PassWord"]==null||Convert.ToString(Context.Session["PassWord"])=="")
          //{
              
          //    Context.Response.Redirect("Index.aspx?mfiid="+BlogContext.Current.MFiiD+"&afiid="+BlogContext.Current.AFiiD);

          //}
            //if (Convert.ToString(Context.Session["PassWord"]) != BWeblog_log.GetPW(Convert.ToInt32( Context.Request["logid"])))
            //{
            //    Context.Response.Redirect("Index.aspx?mfiid=" + BlogContext.Current.MFiiD + "&afiid=" + BlogContext.Current.AFiiD);
            //}
            EnReply = (Panel)Skin.FindControl("EnReply");
            ReplyAlert = (Literal)Skin.FindControl("ReplyAlert");
            View_WeblogUserLog WL = BWeblog_log.GetByIDAndFiid(blogContext.LogId,blogContext.MFiiD);
            if (WL == null)
            {
                Context.Response.Write("<script>alert('该文章不存在或已经删除!');top.window.location='/" + blogContext.Context.Request.QueryString["Domain"] + "';</script>");
                Context.Response.End();
            }
            if (Convert.ToBoolean(WL.Log_IsEnRePly))
            {
                EnReply.Visible = true;
                ReplyAlert.Visible = false;
            }
            else
            {
                EnReply.Visible = false;
                ReplyAlert.Visible = true;
            }

            Globals.UpdateLogByRssLink(blogContext.BlogUserId);
        }
 /// <summary>
 /// instantiate a dummy panel to clear preceding floats
 /// </summary>
 /// <param name="parent">parent control to instantiate in</param>
 protected static void InstantiateClearingPanel(Control parent)
 {
     Panel panel = new Panel();
     panel.Style["clear"] = "both";
     panel.Style["float"] = "none";
     parent.Controls.Add(panel);
 }
        public void AdminPanel_Ld(object sender, EventArgs e)
        {
            System.Web.UI.WebControls.Panel adminPanel = (System.Web.UI.WebControls.Panel)sender;

            adminPanel.Attributes.Add("OnMouseOver", "javascript:displayAdmin();");
            adminPanel.Attributes.Add("OnMouseOut", "javascript:undisplayAdmin();");
        }
 public bool ClearAllInputField(System.Web.UI.WebControls.Panel UiPanel)
 {
     try
     {
         foreach (System.Web.UI.Control ctrl in UiPanel.Controls)
         {
             if (ctrl is TextBox)
             {
                 ((TextBox)ctrl).Text = "";
             }
             else if (ctrl is DropDownList)
             {
                 ((DropDownList)ctrl).SelectedIndex = 0;
             }
             else if (ctrl is CheckBox)
             {
                 ((CheckBox)ctrl).Checked = false;
             }
             else if (ctrl is CheckBoxList)
             {
                 for (int i = 0; i < ((CheckBoxList)ctrl).Items.Count; i++)
                 {
                     ((CheckBoxList)ctrl).Items[i].Selected = false;
                 }
             }
         }
         return(true);
     }
     catch (Exception Ex)
     { return(false); }
 }
        private void CreateRotatorNavigationButtons(Panel panel, HtmlGenericControl div, int divIndex)
        {
            panel.Controls.Clear();

            double pages = div.Controls[0].Controls[0].Controls.Count / 6.0; //6 is the number of columns
            pages = Math.Ceiling(pages);

            div.Style["Width"] = (pages * 738) + "px";

            if (pages > 1)
            {
                LinkButton linkButton = CreatePreviousButton(divIndex);
                panel.Controls.Add(linkButton);
            }

            for (int i = 1; i <= pages; i++)
            {
                LinkButton linkButton = CreateLinkButton(i, divIndex);
                panel.Controls.Add(linkButton);
            }

            if (pages > 1)
            {
                LinkButton linkButton = CreateNextButton(divIndex);
                panel.Controls.Add(linkButton);
            }
        }
        public static bool ShowFloatingPanel(string targetControlID, object caller, System.Web.UI.WebControls.Panel panMain)
        {
            if (string.IsNullOrEmpty(targetControlID) || caller == null)
            {
                return(false);
            }

            Type callerType = caller.GetType();

            System.Reflection.MemberInfo[] mi = callerType.GetMember(targetControlID, System.Reflection.MemberTypes.Field, flags);

            if (mi.Length > 0)
            {
                System.Reflection.FieldInfo fldMbr = (System.Reflection.FieldInfo)mi[0];
                if (fldMbr.FieldType.IsSubclassOf(typeof(System.Web.UI.Control)))
                {
                    try
                    {
                        object objTarget = fldMbr.GetValue(caller);
                        ((System.Web.UI.Control)objTarget).Visible = true;
                        panMain.Enabled = false;
                        return(true);
                    }
                    catch { }
                }
            }

            return(false);
        }
Beispiel #8
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load"></see> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs"></see> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            // First time the field is loaded in Sitecore shell
            string      xml             = this.Value;
            PriceMatrix priceMatrixItem = PriceMatrix.Load(xml);
            Item        item            = Sitecore.Context.ContentDatabase.SelectSingleItem(PriceMatrixPath);

            this.priceMatrixConfigurationLevel = item.Axes.Level;

            if (!Sitecore.Context.ClientPage.IsEvent)
            {
                var panel = new System.Web.UI.WebControls.Panel();
                panel.Attributes.Add("style", string.Format("padding: 4px, 10px, 10px, 10px; border: 1px solid #CECFCE; background-color: white;"));

                this.Controls.Add(panel);

                if (priceMatrixItem != null)
                {
                    this.IterateRecursiveToLoad(priceMatrixItem.MainCategory, panel, item);
                }
                else
                {
                    this.IterateRecursiveToLoad(null, panel, item);
                }
            }

            base.OnLoad(e);
        }
Beispiel #9
0
        public void OutNew(System.Web.UI.WebControls.Panel p1, int i)
        {
            Label lb = new Label();

            lb.Text = this.GenerateHtml(i);
            p1.Controls.Add(lb);
        }
Beispiel #10
0
 private static string ConvertPanelToHTML(Panel panel)
 {
     StringWriter writer = new StringWriter();
     HtmlTextWriter writer2 = new HtmlTextWriter(writer);
     panel.RenderControl(writer2);
     return writer.ToString();
 }
Beispiel #11
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()
        {
            base.CreateChildControls();
            base.Controls.Clear();

            _dfltShowButton = new Button();
            base.Controls.Add(_dfltShowButton);
            _dfltShowButton.ID = "default";
            _dfltShowButton.Attributes.Add("style","display:none");

            _dialogPanel = new Panel();
            base.Controls.Add( _dialogPanel );
            _dialogPanel.ID = "panel";
            _dialogPanel.CssClass = "rock-modal-frame";
            _dialogPanel.Attributes.Add("style","display:none");

            _contentPanel = new Panel();
            _dialogPanel.Controls.Add( _contentPanel );
            _contentPanel.ID = "contentPanel";
            _contentPanel.CssClass = "iframe";

            _iFrame = new HtmlGenericControl( "iframe" );
            _iFrame.ID = "iframe";
            _iFrame.Attributes.Add( "scrolling", "no" );
            _contentPanel.Controls.Add( _iFrame );

            this.PopupControlID = _dialogPanel.ID;
        }
Beispiel #12
0
        //Fill page with dynamic controls showing products in database
        private void GenerateShopControls()
        {
            ArrayList coffeeList = ConnectionClass.GetCoffeeByType("%");

            foreach (Coffee coffee in coffeeList)
            {
                //Create Controls
                Panel coffeePanel = new Panel();
                Image image = new Image { ImageUrl = coffee.Image, CssClass = "ProductsImage" };
                Literal literal = new Literal { Text = "<br />" };
                Literal literal2 = new Literal { Text = "<br />" };
                Label lblName = new Label { Text = coffee.Name, CssClass = "ProductsName" };
                Label lblPrice = new Label { Text = String.Format("{0:0.00}",coffee.Price) + "<br />", CssClass = "ProductsPrice" };
                TextBox textBox = new TextBox {ID = coffee.Id.ToString(), CssClass = "ProductsTextBox", Text = "0", Width = 60};

                //Add validation so only numbers can be entered into the textfields
                var validator = new RegularExpressionValidator
                                    {
                                        ValidationExpression = "^[0-9]*",
                                        ControlToValidate = textBox.ID,
                                        ErrorMessage = "Please enter a number."
                                    };

                //Add controls to Panels
                coffeePanel.Controls.Add(image);
                coffeePanel.Controls.Add(literal);
                coffeePanel.Controls.Add(lblName);
                coffeePanel.Controls.Add(literal2);
                coffeePanel.Controls.Add(lblPrice);
                coffeePanel.Controls.Add(textBox);
                coffeePanel.Controls.Add(validator);

                pnlProducts.Controls.Add(coffeePanel);
            }
        }
Beispiel #13
0
        private void LoadGridPanel(Panel gridPanel)
        {
            gridPanel.ID = "GridPanel";
            gridPanel.ScrollBars = ScrollBars.Auto;
            gridPanel.CssClass = this.GridPanelCssClass;

            if (this.GridPanelHeight != null)
            {
                gridPanel.Height = this.GridPanelHeight;
            }

            if (this.GridPanelWidth != null)
            {
                gridPanel.Height = this.GridPanelWidth;
            }

            searchGridView = new GridView();
            searchGridView.ID = "SearchGridView";
            searchGridView.GridLines = GridLines.None;
            searchGridView.CssClass = this.GridViewCssClass;
            searchGridView.PagerStyle.CssClass = this.GridViewPagerCssClass;
            searchGridView.RowStyle.CssClass = this.GridViewRowCssClass;
            searchGridView.AlternatingRowStyle.CssClass = this.GridViewAlternateRowCssClass;
            searchGridView.AutoGenerateColumns = true;
            searchGridView.RowDataBound += this.SearchGridView_RowDataBound;
            searchGridView.Columns.Add(this.GetSelectColumnTemplateField());

            gridPanel.Controls.Add(searchGridView);
        }
Beispiel #14
0
        private void AddUpdatePanel(Panel p)
        {
            this.messageLabel = new Label();

            this.updatePanel = new UpdatePanel();
            this.updatePanel.ID = "ScrudUpdatePanel";
            this.updatePanel.ChildrenAsTriggers = true;
            this.updatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional;

            this.updatePanel.ContentTemplateContainer.Controls.Add(this.topCommandPanel.GetCommandPanel("top"));
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.messageLabel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.gridPanel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.formPanel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.bottomCommandPanel.GetCommandPanel("bottom"));

            //Bottom command panel.
            this.userIdHidden = new HiddenField();
            this.userIdHidden.ID = "UserIdHidden";
            this.userIdHidden.Value = this.UserId.ToString(CultureInfo.InvariantCulture);

            this.officeCodeHidden = new HiddenField();
            this.officeCodeHidden.ID = "OfficeCodeHidden";
            this.officeCodeHidden.Value = this.OfficeCode;

            this.updatePanel.ContentTemplateContainer.Controls.Add(this.userIdHidden);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.officeCodeHidden);
            p.Controls.Add(this.updatePanel);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     pnlAttrtype = new Panel();
     pnlAttrtype.ID = "pnl" + _ProfileAttributeType.Type;
     lblAtriTypeName = new Label();
     System.Web.UI.HtmlControls.HtmlGenericControl br = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
     lblAtriTypeName.Text = _ProfileAttributeType.Type;
     pnlAttrtype.Controls.Add(lblAtriTypeName);
     pnlAttrtype.Controls.Add(br);
     this.Controls.Add(pnlAttrtype);
     _ProfileAttribute = _Repository.GetProfileAttributesByProfileIDAndType(_profile.ProfileID, _ProfileAttributeType.ProfileAttributeTypeID);
     foreach (ProfileAttribute attribute in _ProfileAttribute)
     {
         System.Web.UI.HtmlControls.HtmlGenericControl brTab = new System.Web.UI.HtmlControls.HtmlGenericControl("br");
         Label label = new Label();
         label.Width = 200;
         label.Height = 20;
         label.ID = "lbl" + attribute.ProfileAttributeName;
         label.Text = attribute.ProfileAttributeName;
         TextBox textbox = new TextBox();
         textbox.Width = 250;
         textbox.Height = 20;
         textbox.ID = "txt" + attribute.ProfileAttributeName;
         textbox.Text = attribute.Response;
         pnlAttrtype.Controls.Add(label);
         pnlAttrtype.Controls.Add(textbox);
         pnlAttrtype.Controls.Add(brTab);
     }
 }
Beispiel #16
0
 private void AddEmailAnchor(Panel p)
 {
     emailAnchor = new HtmlAnchor();
     emailAnchor.ID = "SendEmailAnchor";
     emailAnchor.InnerHtml = "<img src='" + this.Page.ResolveUrl(MixERP.Net.Common.Helpers.ConfigurationHelper.GetReportParameter("EmailIcon")) + "' />";
     p.Controls.Add(emailAnchor);
 }
        private Panel renderSimilarProduct(Item item)
        {
            Panel similarProductsItemContainer = new Panel();
            similarProductsItemContainer.CssClass = "SimilarProductsItemContainer";
            Table table = new Table();
            TableRow tableRow = new TableRow();

            TableCell tableCell = new TableCell();
            Panel itemImageBg = new Panel();
            itemImageBg.CssClass = "itemImageBg";
            Image image = new Image();
            image.ImageUrl = item.ImageUrl;

            itemImageBg.Controls.Add(image);
            tableCell.Controls.Add(itemImageBg);
            tableRow.Controls.Add(tableCell);

            tableCell = new TableCell();
            Panel itemImageTitle = new Panel();
            itemImageTitle.CssClass = "itemImageTitle";
            Label label = new Label();
            label.Text = item.Title;
            itemImageTitle.Controls.Add(label);
            tableCell.Controls.Add(itemImageTitle);
            tableRow.Controls.Add(tableCell);

            table.Controls.Add(tableRow);
            similarProductsItemContainer.Controls.Add(table);

            return similarProductsItemContainer;
        }
Beispiel #18
0
 public PytanieCheckBox()
     : base()
 {
     typ = "CheckBox";
     head = (this as PytanieControlka).dajNaglowek();
     cialko = dajNaglowek();
 }
Beispiel #19
0
        private void PopulateCarousel()
        {
            List<BLCategory> categories = BLCategory.RetrieveListFromDB(connectionString);
            foreach (BLCategory category in categories)
            {
                Image image = new Image
                {
                    CssClass = "carousel-image",
                    ImageUrl = $"ImgHandler.ashx?categoryId={category.Id}"
                };
                HyperLink link = new HyperLink
                {
                    NavigateUrl = $"/Result.aspx?categoryId={category.Id}"
                };
                link.Controls.Add(image);

                Label captionLabel = new Label
                {
                    Text = $"<h3 style = 'color: #FFFFFF' > {category.Name} </ h3 >"
                };
                Panel captionPanel = new Panel { CssClass = "carousel-caption" };
                captionPanel.Controls.Add(captionLabel);

                Panel itemPanel = new Panel { CssClass = "item" };
                itemPanel.Controls.Add(link);
                itemPanel.Controls.Add(captionPanel);

                categoryCarousel.Controls.Add(itemPanel);
            }
        }
        protected override WebControl CreateControlInternal(Control container)
        {
            var panel = new Panel();

            container.Controls.Add(panel);

            var skinLabel = new Label { Text = LocalizeString("Skin") };
            skinLabel.CssClass += "dnnFormSkinLabel";
            panel.Controls.Add(skinLabel);

            //_skinCombo = new DropDownList { ID = ID + "_SkinComboBox" };
            _skinCombo = new DnnComboBox { ID = ID + "_SkinComboBox" };
            _skinCombo.CssClass += "dnnFormSkinInput"; 
            _skinCombo.SelectedIndexChanged += SkinIndexChanged;
            panel.Controls.Add(_skinCombo);

            DnnFormComboBoxItem.BindListInternal(_skinCombo, _skinValue, GetSkins(SkinController.RootSkin), "Key", "Value");

            var containerLabel = new Label { Text = LocalizeString("Container") };
            containerLabel.CssClass += "dnnFormSkinLabel";
            panel.Controls.Add(containerLabel);

            //_containerCombo = new DropDownList { ID = ID + "_ContainerComboBox" };
            _containerCombo = new DnnComboBox { ID = ID + "_ContainerComboBox" };
            _containerCombo.CssClass += "dnnFormSkinInput";
            _containerCombo.SelectedIndexChanged += ContainerIndexChanged;
            panel.Controls.Add(_containerCombo);

            DnnFormComboBoxItem.BindListInternal(_containerCombo, _containerValue, GetSkins(SkinController.RootContainer), "Key", "Value");

            return panel;
        }
        protected void initPage()
        {
            RegistedUser MySelf = new RegistedUser();
            MySelf = (RegistedUser)Session["User"];
            MySelf.Userservice = new UserServiceClasses.RegisterUserService();
            List<Message> PublishMessageList =  MySelf.Userservice.GetUserUreadPublicMessages(MySelf.UserName);
            Panel single = new Panel();
            foreach (Message singleMessage in PublishMessageList)
            {

                HyperLink MessageFrom = new HyperLink();
                MessageFrom.Text = singleMessage.userFrom.NickName;
                MessageFrom.NavigateUrl = "~/WebPage/UserOwnZonePage/UserOwnZonePage/UserOwnZonePage.aspx?VisitedUserID=" + singleMessage.userFrom.UserName; ;
                single.Controls.Add(MessageFrom);
                Label MessageCon = new Label();
                MessageCon.Text = singleMessage.content;
                single.Controls.Add(MessageCon);

                ImageButton deleteButton = new ImageButton();
                deleteButton.ImageUrl = "~/newpng/Trash.png";
                deleteButton.Height = new Unit(48);
                deleteButton.ID = singleMessage.ID.ToString();
                deleteButton.OnClientClick += "DeleteItem";
                deleteButton.Click += new ImageClickEventHandler(deleteButton_Click);
                single.Controls.Add(deleteButton);

            }
            this.ALLPublicMessage.Controls.Add(single);
        }
 private void renderProductImageShow()
 {
     Panel productImageShowBg = new Panel();
     productImageShowBg.CssClass = "productImageShowBg";
     Panel productImageShowContainer = new Panel();
     productImageShowContainer.CssClass = "productImageShowContainer";
     Panel productImageShowWrapper = new Panel();
     productImageShowWrapper.CssClass = "productImageShowWrapper";
     Panel sliderWrapper = new Panel();
     sliderWrapper.CssClass = "slider-wrapper theme-default";
     Panel slider = new Panel();
     slider.CssClass = "nivoSlider";
     slider.ID = "slider";
     slider.ClientIDMode = System.Web.UI.ClientIDMode.Static;
     List<CoverFlowItem> coverFlowList = CoverFlowService.GetAll();
     foreach (CoverFlowItem item in coverFlowList)
     {
         slider.Controls.Add(renderProductImage(item));
     }
     sliderWrapper.Controls.Add(slider);
     productImageShowWrapper.Controls.Add(sliderWrapper);
     productImageShowContainer.Controls.Add(productImageShowWrapper);
     productImageShowBg.Controls.Add(productImageShowContainer);
     Panel productImageShowDivider = new Panel();
     productImageShowDivider.CssClass = "productImageShowDivider";
     productImageShowPanel.Controls.Add(productImageShowBg);
     productImageShowPanel.Controls.Add(productImageShowDivider);
 }
        public static bool HideFloatingPanel(System.Web.UI.Control sender, System.Web.UI.WebControls.Panel panMain)
        {
            if (sender == null)
            {
                return(false);
            }

            Control p     = sender.Parent;
            bool    found = false;

            while (p != null)
            {
                if (p.GetType().Name == "Panel" && ((Panel)p).CssClass.ToLower() == "floatingpanel")
                {
                    p.Visible = false;
                    found     = true;
                    break;
                }
                p = p.Parent;
            }
            if (panMain != null)
            {
                panMain.Enabled = true;
            }
            return(found);
        }
        public void ShowPanelPage(Panel _panel)
        {
            try
            {
                if (Request.QueryString["page"] != null)
                {
                    if (Session["page"] != null)
                    {
                        if (!Session["page"].Equals(Request.QueryString["page"]))
                        {
                            _panel.Visible = true;
                        }
                        else
                        {
                            _panel.Visible = false;
                        }
                    }

                    Session["page"] = Request.QueryString["page"];
                }
                else
                {
                    Session["page"] = 1;
                }
            }
            catch (Exception)
            {

            }
        }
        private void CreateControls()
        {
            _panel = new Panel();
            _panel.CssClass = "panVolume";

            _image = new Image();
            _image.ImageUrl = "~/Images/sound_low.png";
            _image.CssClass = "imgBt";
            _panel.Controls.Add(_image);

            _imBtAdd = new ImageButton();
            _imBtAdd.ImageUrl = "~/Images/up_plus.png";
            _imBtAdd.CssClass = "imgBtV";
            _imBtAdd.Click += _imBtAdd_Click;
            _panel.Controls.Add(_imBtAdd);

            _volumeLabel = new Label();
            _volumeLabel.Text = ((IVolume)_data.Device).Volume.ToString();
            _volumeLabel.CssClass = "labelVolume";
            _panel.Controls.Add(_volumeLabel);

            _imBtDel = new ImageButton();
            _imBtDel.ImageUrl = "~/Images/down_minus.png";
            _imBtDel.CssClass = "imgBt imgBtV";
            _imBtDel.Click += _imBtDel_Click;
            _panel.Controls.Add(_imBtDel);

            Controls.Add(_panel);
        }
        protected override void OnInit(EventArgs e)
        {
            _Panel = new Panel();
            _Panel.ID = this.ID + "_Container";
            _Panel.CssClass = "RibbonItems RibbonItems_SmallItem RibbonItemWithMenu";
            _Panel.Attributes.Add("ItemID", this.ID);
            if (this._width != null) _Panel.Style.Add("width", _width.ToString());
            this.Controls.Add(_Panel);

            _EnableState(this._enabled);

            if (!String.IsNullOrEmpty(this._tooltip))
            {
                _Panel.CssClass += " RibbonItemWithTooltip";
                _Panel.Attributes.Add("tooltip", this._tooltip);
            }

            Table lTable = new Table();
            lTable.Attributes.Add("align", "center");
            _Panel.Controls.Add(lTable);

            TableRow lTableRow = new TableRow();
            lTable.Controls.Add(lTableRow);

            TableCell lTableCell = new TableCell();
            lTableRow.Controls.Add(lTableCell);

            Image lImage = new Image();
            lImage.ImageUrl = (!String.IsNullOrEmpty(this._imageurl)) ? this._imageurl : Page.ClientScript.GetWebResourceUrl(this.GetType(), "OfficeWebUI.Resources.Common.Image.blank.gif");
            lImage.Width = 16;
            lImage.Height = 16;
            lTableCell.Controls.Add(lImage);

            TableCell lTableCellArrow = new TableCell();
            lTableRow.Controls.Add(lTableCellArrow);

            Image lArrow = new Image();
            lArrow.ImageUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), "OfficeWebUI.Resources.Common.Image.arrow_dr2.gif");
            lTableCellArrow.Controls.Add(lArrow);

            _DropDownMenu = new Panel();
            _DropDownMenu.ID = this.ID + "_Menu";
            _DropDownMenu.CssClass = "RibbonDropDownMenu";
            _DropDownMenu.Style.Add("display", "none");
            _Panel.Controls.Add(_DropDownMenu);

            foreach (Control lCtrl in this._items)
            {
                _DropDownMenu.Controls.Add(lCtrl);
            }

            /*
            lPanel.Attributes.Add("onclick", "OfficeWebUI.Ribbon.ShowMenu(this, '" + lDropDownMenu.ClientID + "')");
            lDropDownMenu.Attributes.Add("onmouseover", "OfficeWebUI.Ribbon.KeepMenu('" + lDropDownMenu.ClientID + "')");
            lDropDownMenu.Attributes.Add("onmouseout", "OfficeWebUI.Ribbon.HideMenu('" + lDropDownMenu.ClientID + "')");
            lDropDownMenu.Attributes.Add("MenuOpener", lPanel.ClientID);
            */

            base.OnInit(e);
        }
        protected override void CreateChildControls()
        {
            if (EditMode == PropertyEditorMode.Edit)
            {
                var pnlEditor = new Panel();
                if(string.IsNullOrEmpty(CssClass))
                {
                    pnlEditor.CssClass ="dnnLeft";
                }
                else
                {
                    pnlEditor.CssClass = string.Format("{0} dnnLeft", CssClass);
                }
                

                RichTextEditor = HtmlEditorProvider.Instance();
                RichTextEditor.ControlID = ID + "edit";
                RichTextEditor.Initialize();
                RichTextEditor.Height = ControlStyle.Height;
                RichTextEditor.Width = ControlStyle.Width;
                if (RichTextEditor.Height.IsEmpty)
                {
                    RichTextEditor.Height = new Unit(250);
                }

                RichTextEditor.Width = new Unit(400);

                Controls.Clear();
                pnlEditor.Controls.Add(RichTextEditor.HtmlEditorControl);
                Controls.Add(pnlEditor);
            }
            base.CreateChildControls();
        }
Beispiel #28
0
        private void LoadGridPanel(Panel gridPanel)
        {
            gridPanel.ID = "GridPanel";
            gridPanel.CssClass = this.GridPanelCssClass;
            gridPanel.Attributes.Add("style", "overflow:auto");
            gridPanel.Attributes.Add("padding", "4px");

            if (this.GridPanelHeight.Value > 0)
            {
                gridPanel.Height = this.GridPanelHeight;
            }

            if (this.GridPanelWidth.Value > 0)
            {
                gridPanel.Height = this.GridPanelWidth;
            }

            this.searchGridView = new MixERPGridView();
            this.searchGridView.ID = "SearchGridView";

            this.searchGridView.Attributes.Add("style", "white-space: nowrap;");
            this.searchGridView.GridLines = GridLines.None;
            this.searchGridView.CssClass = this.GridViewCssClass;
            this.searchGridView.PagerStyle.CssClass = this.GridViewPagerCssClass;
            this.searchGridView.RowStyle.CssClass = this.GridViewRowCssClass;
            this.searchGridView.AlternatingRowStyle.CssClass = this.GridViewAlternateRowCssClass;
            this.searchGridView.AutoGenerateColumns = true;
            this.searchGridView.RowDataBound += this.SearchGridView_RowDataBound;
            this.searchGridView.Columns.Add(GetSelectColumnTemplateField());

            gridPanel.Controls.Add(this.searchGridView);
        }
        public override Control DataEditorControls(XmlNode xml, Dictionary<string, object> properties)
        {
            //properties should be multiType properties ie. Name, Description, Mandatory, Validation
            Panel pnlDataEditor = new Panel();

            Label lblDataEditor = new Label() { Text = properties["Name"].ToString() };
            Literal litDescription = new Literal() { Text = properties["Description"].ToString() };

            dtpDataEditor = new umbraco.uicontrols.DatePicker.DateTimePicker();

            if (properties.ContainsKey("ShowTime"))
            {
                boolShowTime = bool.Parse(properties["ShowTime"].ToString());
                dtpDataEditor.ShowTime = boolShowTime;
            }

            if (xml != null)
            {
                //Anything special about the xml? no - just do innertext
                dtpDataEditor.DateTime = Convert.ToDateTime(xml.InnerText);
            }
            
            pnlDataEditor.Controls.Add(lblDataEditor);
            pnlDataEditor.Controls.Add(litDescription);
            pnlDataEditor.Controls.Add(dtpDataEditor);

            if (xml != null)
            {
                //Anything special about the xml? no - just do innertext
                dtpDataEditor.DateTime = Convert.ToDateTime(xml.InnerText);
            }

            return pnlDataEditor;
        }
Beispiel #30
0
 private void AddLastValueHiddenField(Panel p)
 {
     this.lastValueHiddenTextBox = new TextBox();
     this.lastValueHiddenTextBox.ID = "LastValueHidden";
     this.lastValueHiddenTextBox.Style.Add("display", "none;");
     p.Controls.Add(this.lastValueHiddenTextBox);
 }
Beispiel #31
0
        /// <summary>
        /// Custom Page_Init function for inherited class
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        protected override bool OnInit(object sender, EventArgs e)
        {
            sdsProductionLineLookup.SelectParameters["AssemblyTypeId"].DefaultValue = assemblyTypeId.ToString();
            cmbProductionLines.DataSource = sdsProductionLineLookup;

            sdsAssemblySectionLookup.SelectParameters["AssemblyTypeId"].DefaultValue = assemblyTypeId.ToString();
            cmbAssemblySections.DataSource = sdsAssemblySectionLookup;
            cmbStations.DataSource         = sdsStationLookup;

            cmbAssemblyTypes.DataSource = sdsAssemblyTypeLookup;

            //sdsTypeLookup.SelectParameters["AssemblyTypeId"].DefaultValue = assemblyTypeId.ToString();

            //sdsToolRackLookup.SelectParameters["AssemblyTypeId"].DefaultValue = assemblyTypeId.ToString();

            //get TableMeta from Schema. Schema is loaded during login
            var schemaInfo = Application["SchemaInfo"] as SchemaInfo;

            tableMeta = schemaInfo.Tables.Where(s => s.Name.Equals(tableName, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();

            if (tableMeta == null)
            {
                masterPage.MainContent.Controls.Add(new LiteralControl(string.Format("<h2>{0}</h2>", "Invalid Page")));
                return(false);
            }

            var panel = new System.Web.UI.WebControls.Panel();

            panel.CssClass = "mainContent";
            panel.Controls.Add(new LiteralControl(string.Format("<h2 class='grid-header'>{0}</h2>", tableMeta.Caption)));
            masterPage.MainContent.Controls.Add(panel);

            return(true);
        }
Beispiel #32
0
        private static WebControl BuildContentsControl(BlogEntry entry)
        {
            Panel contentsControl = new Panel();
            WebControl textControl = new WebControl(HtmlTextWriterTag.P);
            textControl.Controls.Add(new LiteralControl(entry.Content));
            contentsControl.Controls.Add(textControl);

            if (entry.Enclosure != null && entry.Enclosure.Uri != null)
            {
                HtmlGenericControl audio = new HtmlGenericControl("audio");
                audio.Attributes.Add("controls", "controls");
                audio.Attributes.Add("src", entry.Enclosure.Uri);
                audio.Attributes.Add("type", "audio/mp3");

                WebControl musicPlayer = new WebControl(HtmlTextWriterTag.Embed);
                musicPlayer.ID = "musicPlayer_" + entry.id;
                musicPlayer.Style.Add(HtmlTextWriterStyle.Width, "400px");
                musicPlayer.Style.Add(HtmlTextWriterStyle.Height, "27px");
                musicPlayer.Style.Add("border", "1px solid rgb(170, 170, 170)");
                musicPlayer.Attributes.Add("src", "http://www.google.com/reader/ui/3523697345-audio-player.swf");
                musicPlayer.Attributes.Add("flashvars", "audioUrl=" + entry.Enclosure.Uri);
                musicPlayer.Attributes.Add("pluginspage", "http://www.macromedia.com/go/getflashplayer");

                audio.Controls.Add(musicPlayer);

                contentsControl.Controls.Add(audio);
            }

            return contentsControl;
        }
Beispiel #33
0
 public override void Ini()
 {
     CssClass = "_devices";
     burnerList = new Dictionary<string, Devices>();
     burnerList = ((Bake)deviceList[name]).GetBurnerList();
     bakeOvenList = ((Bake)deviceList[name]).GetBakeOvenList();
     panelName = new Panel();
     panelName.CssClass = "_bakePanelName";
     labelName = new Label();
     labelName.Text = name;
     panelName.Controls.Add(labelName);
     buttonDelete = new Button();
     buttonDelete.Text = "X";
     buttonDelete.CssClass = "_buttonDelete";
     buttonDelete.Click += Delete_Click;
     Controls.Add(panelName);
     Controls.Add(buttonDelete);
     foreach (var burner in burnerList)
     {
         Controls.Add(((IDraw)burner.Value).Draw(burner.Key, burnerList));
     }
     foreach (var oven in bakeOvenList)
     {
         Controls.Add(((IDraw)oven.Value).Draw(oven.Key, bakeOvenList));
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            PrintSettingBLL.Reload();
            DonationBLL bll = new DonationBLL();

            int campID = Request["CampaignID"].ToInt();
            string rptType = Request["RptType"];
            string DINList = Request["DINList"];
            string count = Request["Count"];

            List<Donation> pL = new List<Donation>();

            if (campID != 0
                && !string.IsNullOrEmpty(rptType))
            {
                ReportType type = (ReportType)rptType.ToInt();
                pL = DonationBLL.Get(campID, type, count.Split(',').ToList().Select(r => r.ToInt()).ToArray());
            }
            else if (!string.IsNullOrEmpty(DINList))
            {
                pL = bll.Get(DINList.Split(','));
            }

            foreach (Donation item in pL)
            {
                Panel p = new Panel();
                p.Style.Add("position", "relative");
                p.Style.Add("page-break-after", "always");
                p.Style.Apply(PrintSettingBLL.Card.PaperSize);
                p.Style.Add("border", "1px solid white");
                divCon.Controls.Add(p);

                AddDINLabelControl(item, p);
            }
        }
Beispiel #35
0
        public static Panel BuildCategoryPanel(BlogEntry entry)
        {
            Panel categoriesPanel = new Panel();
            categoriesPanel.CssClass = "blogPostLabel";
            categoriesPanel.Style.Add(HtmlTextWriterStyle.TextAlign, "right");

            if (entry.Categories.Count > 0)
            {
                String category = entry.Categories[0];
                HyperLink hyperLink = new HyperLink();
                hyperLink.NavigateUrl = "blog.aspx?label=" + category;
                hyperLink.Text = category;
                categoriesPanel.Controls.Add(hyperLink);
            }

            for (int i = 1; i < entry.Categories.Count; i++)
            {
                String category = entry.Categories[i];
                Literal labelSeparator = new Literal();
                labelSeparator.Text = ", ";
                categoriesPanel.Controls.Add(labelSeparator);

                HyperLink hyperLink = new HyperLink();
                hyperLink.NavigateUrl = "blog.aspx?label=" + category;
                hyperLink.Text = category;
                categoriesPanel.Controls.Add(hyperLink);
            }

            return categoriesPanel;
        }
 protected override void AttachChildControls()
 {
     this.listOrders  = (System.Web.UI.WebControls.Repeater) this.FindControl("listOrders");
     this.panl_nodata = (System.Web.UI.WebControls.Panel) this.FindControl("panl_nodata");
     this.listOrders.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.listOrders_ItemDataBound);
     this.listOrders.ItemCommand   += new System.Web.UI.WebControls.RepeaterCommandEventHandler(this.listOrders_RowCommand);
 }
Beispiel #37
0
        public void QuestaoManual(System.Web.UI.WebControls.Panel novoPanel, string questao)
        {
            DropDownList novaDrop = new DropDownList();

            novaDrop.ID = questao;
            novoPanel.Controls.Add(novaDrop);
        }
        public void EditorPanel_Ld(object sender, EventArgs e)
        {
            System.Web.UI.WebControls.Panel editorPanel = (System.Web.UI.WebControls.Panel)sender;

            editorPanel.Attributes.Add("OnMouseOver", "javascript:displayEditor();");
            editorPanel.Attributes.Add("OnMouseOut", "javascript:undisplayEditor();");
        }
Beispiel #39
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                if (OnSelectUserRoleID == 1)
                {
                    System.Web.UI.WebControls.Panel pnlForAdminUser = ((System.Web.UI.WebControls.Panel)Master.FindControl("PanelAdminUser"));
                    System.Web.UI.WebControls.Panel pnlForAlluser   = ((System.Web.UI.WebControls.Panel)Master.FindControl("PanelForAlluser"));

                    pnlForAdminUser.Visible = true;
                    pnlForAlluser.Visible   = false;

                    //System.Web.UI.WebControls.LinkButton  lnklogin = ((System.Web.UI.WebControls.LinkButton)Master.FindControl("loginLink"));
                    //lnklogin.Text = "Logout";

                    System.Web.UI.WebControls.HyperLink NyHyperLinkLogin = ((System.Web.UI.WebControls.HyperLink)Master.FindControl("HyperLinkLogin"));
                    NyHyperLinkLogin.Text = "Log off";

                    System.Web.UI.WebControls.Label Lbl_loginStatus = ((System.Web.UI.WebControls.Label)Master.FindControl("Label_loginStatus"));
                    Lbl_loginStatus.Visible = true;
                    Lbl_loginStatus.Text    = Session["UserName"].ToString();

                    System.Web.UI.WebControls.Label Lbl_RoleName = ((System.Web.UI.WebControls.Label)Master.FindControl("Label_RoleName"));
                    Lbl_RoleName.Visible = true;
                    Lbl_RoleName.Text    = Session["RoleName"].ToString();


                    //PanelAdminUser.Visible = true;
                }
            }
        }
Beispiel #40
0
        private void AddReportBody(Panel container)
        {
            this.reportBody = new Panel();
            this.reportBody.ID = "report";

            if (!this.NoHeader)
            {
                this.header = new ReportHeader();
                this.header.Path = ConfigurationHelper.GetReportParameter("HeaderPath");
                this.reportBody.Controls.Add(this.header);
            }

            this.reportTitleLiteral = new Literal();
            this.reportBody.Controls.Add(this.reportTitleLiteral);

            this.topSectionLiteral = new Literal();
            this.reportBody.Controls.Add(this.topSectionLiteral);

            this.bodyContentsLiteral = new Literal();
            this.reportBody.Controls.Add(this.bodyContentsLiteral);

            this.gridPlaceHolder = new PlaceHolder();
            this.reportBody.Controls.Add(this.gridPlaceHolder);

            this.bottomSectionLiteral = new Literal();
            this.reportBody.Controls.Add(this.bottomSectionLiteral);

            container.Controls.Add(this.reportBody);
        }
        public void LoadResults(
            DataTable dataSource,
            Panel panel,
            HtmlGenericControl div,
            Panel tileResultsPanel,
            Panel gridResultsPanel,
            RadGrid grid,
            string resultType,
            string contentTemplate)
        {
            if (resultType == "Grid")
            {
                grid.DataSource = dataSource;
                grid.DataBind();

                tileResultsPanel.Visible = false;
                gridResultsPanel.Visible = true;
            }
            else
            {
                var resultsControl = new Controls.DynamicTileContainer(4, 113, 525, false);
                resultsControl.DataSource = null;
                resultsControl.ContentTileTemplate = contentTemplate;
                resultsControl.DataSource = dataSource;
                resultsControl.DataBind();

                tileResultsPanel.Visible = true;
                gridResultsPanel.Visible = false;

                div.Controls.Clear();
                div.Controls.Add(resultsControl);

                AddNavigationButtons(panel, div);
            }
        }
Beispiel #42
0
        public void QuestaoTextBox(System.Web.UI.WebControls.Panel novoPanel, string questao)
        {
            TextBox novaTextBox = new TextBox();

            novaTextBox.ID   = questao;
            novaTextBox.Text = "";
            novoPanel.Controls.Add(novaTextBox);
        }
Beispiel #43
0
 protected void EntityBind(System.Web.UI.WebControls.Panel panel, WeiSha.Data.Entity entity)
 {
     if (entity == null)
     {
         return;
     }
     _entityBind(panel, entity);
 }
Beispiel #44
0
        /// <summary>
        /// Creates the checked list.
        /// </summary>
        /// <param name="thePannel">The pannel.</param>
        /// <param name="theDT">The dt.</param>
        /// <param name="Attribute">The attribute.</param>
        /// <param name="Event">The event.</param>
        public void CreateCheckedList(System.Web.UI.WebControls.Panel thePannel, DataTable theDT, string Attribute, String Event)
        {
            try
            {
                int  i        = 0;
                bool FlgOther = false;
                System.Web.UI.WebControls.TextBox theTxtBox = new System.Web.UI.WebControls.TextBox();
                for (i = 0; i < theDT.Rows.Count; i++)
                {
                    System.Web.UI.WebControls.CheckBox theChkBox = new System.Web.UI.WebControls.CheckBox();
                    theChkBox.ID   = thePannel.ID + '-' + theDT.Rows[i][0].ToString();
                    theChkBox.Text = theDT.Rows[i][1].ToString();

                    if (Attribute != "")
                    {
                        string   Attr    = "";
                        string[] theAttr = Attribute.Split('%');
                        if (theAttr.Length > 0)
                        {
                            Attr = theAttr[0] + "%" + theChkBox.ClientID + theAttr[1];
                        }
                        else
                        {
                            Attr = theAttr[0];
                        }
                        theChkBox.Attributes.Add(Event, Attr);
                    }
                    if (theChkBox.Text == "Other")
                    {
                        theTxtBox = new System.Web.UI.WebControls.TextBox();
                        string[] theId = thePannel.ID.Split('-');
                        theTxtBox.ID    = "OtherTXT-" + theId.GetValue(1).ToString() + "-" + theId.GetValue(2).ToString() + "-" + theId.GetValue(3) + "-" + theDT.Rows[i][0].ToString();
                        theTxtBox.Width = 75;
                        theChkBox.Attributes.Add("onclick", "toggle('txtother')");
                        FlgOther = true;
                    }
                    theChkBox.Width = 300;
                    if (FlgOther == false)
                    {
                        thePannel.Controls.AddAt(i, theChkBox);
                    }
                    else
                    {
                        System.Web.UI.WebControls.Panel theOtPnl = new System.Web.UI.WebControls.Panel();
                        theOtPnl.Controls.Add(new LiteralControl("<span>"));
                        theOtPnl.Controls.Add(theChkBox);
                        theOtPnl.Controls.Add(new LiteralControl("<span id='txtother' style='display:none'>"));
                        theOtPnl.Controls.Add(theTxtBox);
                        theOtPnl.Controls.Add(new LiteralControl("</span>"));
                        theOtPnl.Controls.Add(new LiteralControl("</span>"));
                        thePannel.Controls.AddAt(i, theOtPnl);

                        FlgOther = false;
                    }
                }
            }
            catch { }
        }
        public virtual void SaveData()
        {
            // Saves the associated record in the database.
            // SaveData calls Validate and Get methods - so it may be more appropriate to
            // customize those methods.

            // 1. Load the existing record from the database. Since we save the entire record, this ensures
            // that fields that are not displayed are also properly initialized.
            this.LoadData();

            // The checksum is used to ensure the record was not changed by another user.
            if (this.DataSource != null && this.DataSource.GetCheckSumValue() != null)
            {
                if (this.CheckSum != null && this.CheckSum != this.DataSource.GetCheckSumValue().Value)
                {
                    throw new Exception(Page.GetResourceValue("Err:RecChangedByOtherUser", "OLR"));
                }
            }

            System.Web.UI.WebControls.Panel Panel = (System.Web.UI.WebControls.Panel)MiscUtils.FindControlRecursively(this, "FieldTripOptionsRecordControlPanel");
            if ((Panel != null && !Panel.Visible) || this.DataSource == null)
            {
                return;
            }


            // 2. Perform any custom validation.
            this.Validate();

            // 3. Set the values in the record with data from UI controls.
            // This calls the Get() method for each of the user interface controls.
            this.GetUIData();

            // 4. Save in the database.
            // We should not save the record if the data did not change. This
            // will save a database hit and avoid triggering any database triggers.

            if (this.DataSource.IsAnyValueChanged)
            {
                // Save record to database but do not commit yet.
                // Auto generated ids are available after saving for use by child (dependent) records.
                this.DataSource.Save();
            }


            // update session or cookie by formula


            // Setting the DataChanged to True results in the page being refreshed with
            // the most recent data from the database.  This happens in PreRender event
            // based on the current sort, search and filter criteria.
            this.DataChanged = true;
            this.ResetData   = true;

            this.CheckSum = "";
            // For Master-Detail relationships, save data on the Detail table(s)
        }
Beispiel #46
0
        public void QuestaoMultiplaSimNao(System.Web.UI.WebControls.Panel novoPanel, string questao)
        {
            DropDownList novaDrop = new DropDownList();

            novaDrop.ID = questao;
            novaDrop.Items.Add("Sim");
            novaDrop.Items.Add("Não");
            novoPanel.Controls.Add(novaDrop);
        }
Beispiel #47
0
        int getPanelStyleAttribute(string ctrlName, string attribute)
        {
            Control ctrl = FindControl(ctrlName);

            System.Web.UI.WebControls.Panel panel = (System.Web.UI.WebControls.Panel)((Button)ctrl).Parent;
            string styleAttribute = panel.Attributes["style"];
            string leftSubstring  = styleAttribute.Substring(styleAttribute.IndexOf(attribute), 11); // 11 is a safe length

            return(int.Parse(Regex.Match(leftSubstring, @"\d+").Value));
        }
        public void SetMenuStyle(int activeIndex)
        {
            foreach (DataListItem item in this.DataListNavigationMenu.Items)
            {
                System.Web.UI.WebControls.Panel tabPanel = (System.Web.UI.WebControls.Panel)item.FindControl("PanelNavigationMenu");
                HiddenField indexHiddenField             = (HiddenField)item.FindControl("HiddenFieldIndex");

                tabPanel.CssClass = (activeIndex == Convert.ToInt32(indexHiddenField.Value)) ? "panel-PanelMenuItem-Selected" : "panel-PanelMenuItem";
            }
        }
Beispiel #49
0
 /// <exclude />
 protected override void CreateChildControls()
 {
     this.Controls.Clear();
     contentPanel = new System.Web.UI.WebControls.Panel();
     this.Controls.Add(contentPanel);
     if (this.contentTemplate != null)
     {
         contentTemplate.InstantiateIn(contentPanel);
     }
 }
Beispiel #50
0
 public SearchQuery(System.Web.UI.WebControls.Panel panel)
 {
     if (panel is System.Web.UI.Control)
     {
         _control = panel as System.Web.UI.Control;
     }
     if (_control != null)
     {
         query = _control.Page.ClientQueryString;
     }
 }
Beispiel #51
0
        public void QuestaoMultiplaSatisfacao(System.Web.UI.WebControls.Panel novoPanel, string questao)
        {
            DropDownList novaDrop = new DropDownList();

            novaDrop.ID = questao;
            novaDrop.Items.Add("Nada Satisfeito");
            novaDrop.Items.Add("Pouco Satisfeito");
            novaDrop.Items.Add("Satisfeito");
            novaDrop.Items.Add("Muito Satisfeito");
            novaDrop.Items.Add("Completamente Satisfeito");
            novoPanel.Controls.Add(novaDrop);
        }
Beispiel #52
0
        public void QuestaoMultiplaFrequencia(System.Web.UI.WebControls.Panel novoPanel, string questao)
        {
            DropDownList novaDrop = new DropDownList();

            novaDrop.ID = questao;
            novaDrop.Items.Add("Nunca");
            novaDrop.Items.Add("Raramente");
            novaDrop.Items.Add("Algumas vezes");
            novaDrop.Items.Add("Quase sempre");
            novaDrop.Items.Add("Sempre");
            novoPanel.Controls.Add(novaDrop);
        }
        /*
         * No need in the new version.
         * Change to GenerateNavigation.
         * /// <summary>
         * /// Create a tree view via the string id.
         * /// </summary>
         * /// <param name="Container"></param>
         * /// <param name="ID"></param>
         * static public void GenerateTreeView(ref System.Web.UI.Control Container, String ID)
         * {
         *  for (int i = 0; i < gDepartments.Count; ++i)
         *  {
         *      // Check if the Account is Teacher or Student
         *      DataStructure.Tree<AuthItem> tmpDp = gDepartments[i].GetTeacherAuthorityList(ID);
         *      if (tmpDp != null)
         *      {
         *          TreeView tmpTree = new TreeView();
         *          TreeNode root = new TreeNode(tmpDp.CurrentNode.AuthString);
         *          tmpTree.Nodes.Add(root);
         *          generate(tmpDp, ref root);
         *          Container.Controls.Add(tmpTree);
         *      }
         *  }
         * }
         */

        /// <summary>
        /// Generate the navigation of the current user's authoriztion.
        /// On null continue.
        /// </summary>
        /// <param name="Container">The container to add the navigation to.</param>
        /// <param name="ID">The User's ID.</param>
        /// <param name="SubTitleCssClass">The title's CssClass.</param>
        /// <param name="TreeCssClass">The tree's CssClass.</param>
        static public void GenerateNavigation(ref System.Web.UI.WebControls.Panel Container, String ID,
                                              String SubTitleCssClass, String TreeCssClass, String TargetWindow)
        {
            Boolean isStudent = true;  // Shoude be change to get the correct state.

            if (StundentInfoManagement.StudentBasicInfoEx.CheckAdmin(ID))
            {
                isStudent = false;
            }
            else
            {
                isStudent = true;
            }

            for (int i = 0; i < gDepartments.Count; ++i)
            {
                TreeView tmpTree = (isStudent) ?
                                   gDepartments[i].Value.GetStudentAuthorityList(ID) :
                                   gDepartments[i].Value.GetTeacherAuthorityList(ID);
                // No Authorization for current user.
                if (tmpTree == null || tmpTree.Nodes.Count == 0)
                {
                    continue;
                }

                tmpTree.Target   = TargetWindow;
                tmpTree.CssClass = TreeCssClass;

                tmpTree.ExpandDepth = 1;

                //                 Label lbDpName = new Label();
                //                 lbDpName.Text = gDepartments[i].Key;
                //                lbDpName.CssClass = SubTitleCssClass;

                // Add to the container.
                //                 HtmlGenericControl divTitle = new HtmlGenericControl("div");
                //                 divTitle.Controls.Add(lbDpName);
                HtmlGenericControl divTree = new HtmlGenericControl("div");
                divTree.Controls.Add(tmpTree);

                //                Container.Controls.Add(divTitle);
                Container.Controls.Add(divTree);
            }
            if (isStudent)
            {
                AndStudentAction(ref Container, ID, SubTitleCssClass, TreeCssClass, TargetWindow);
            }
            else
            {
                AndTeacherAction(ref Container, ID, SubTitleCssClass, TreeCssClass, TargetWindow);
            }
        }
        /* redirect user to respective page after password change*/
        public void passwordChange(Object sender, EventArgs e)
        {
            //making default panel of Faculty of Site.Master visible
            System.Web.UI.WebControls.Panel p = (System.Web.UI.WebControls.Panel)Master.FindControl("menubar");
            p.Visible = true;

            //making default ContentPlaceholder of Site.Master  visible
            ContentPlaceHolder cpuser = (ContentPlaceHolder)Master.FindControl("menuuser");

            cpuser.Visible = true;

            //redirecting user to Timeentry page
            Response.Redirect("TimeEntry.aspx");
        }
Beispiel #55
0
    }// end GetNextChunk

    #region Pager

    /// <summary>
    ///
    /// NB. EntryPoint : every paging operation enters here.
    /// Request.Params["parPage"] e' il parametro che governa la selezione di pagina.
    /// E' un parametro http-get, contenuto nella url.
    /// Se il Ctor() ha fallito, il metodo abortisce. La verifica di successo del Ctor() e':
    /// null != Session["CacherDbView"]
    ///
    /// </summary>
    public void Pager_EntryPoint(
        System.Web.SessionState.HttpSessionState Session
        , System.Web.HttpRequest Request
        , System.Web.UI.WebControls.GridView grdDatiPaginati
        , System.Web.UI.WebControls.Panel pnlPageNumber
        )
    {
        object objCacherDbView = Session["CacherDbView"];

        if (null == objCacherDbView)
        {
            return;// component called when the cache is not yet ready -> return on empty page.
        }// else bring to DataBind().
        //
        string parPage          = Request.Params["parPage"];
        int    paginaDesiderata = 1;// default

        try
        {
            paginaDesiderata = int.Parse(parPage);
            if (
                this.rowCardinality < this.RowsInChunk || // caso di una sola pagina ed incompleta
                System.Math.Ceiling((double)this.rowCardinality / (double)this.RowsInChunk) < (double)paginaDesiderata    // pagine disponibili non arrivano al numero di pagina richiesto: NB. double needed to do not loose the last page_fraction.
                )
            {
                paginaDesiderata = 1;// back to default.
            }// else paginaDesiderata is possible.
        }
        catch
        {
            paginaDesiderata = 1;// default on missing or wrong get-parameter "parPage".
        }
        System.Data.DataTable dt = null;
        this.PageIndexManager(//----NB. internal call, for querying required-page data-----------------------------------------------------------
            Session
            , Request
            , paginaDesiderata
            , pnlPageNumber
            , out dt // the chunk-data, to be filled.
            );
        grdDatiPaginati.DataSource = dt;
        grdDatiPaginati.DataBind();
        //
        if (null != Session["DynamicPortionPtr"])// NB. tested: indispensable to renew it in Session, at every round-trip.
        {
            CacherDbView.DynamicPortionPtr dynamicPortionPtr =
                (CacherDbView.DynamicPortionPtr)(Session["DynamicPortionPtr"]);
            dynamicPortionPtr();// finally, call it.
        }// else nothing to be executed post-binding.
    }//
Beispiel #56
0
 public DBWebAggregateControl() : base()
 {
     FTextBox          = new TextBox();
     FTextBox.ReadOnly = true;
     FLabel            = new Label();
     FPanel            = new System.Web.UI.WebControls.Panel();
     FTextBoxPortion   = defaultTextBoxPortion;
     FLabelPosition    = LabelPosition.LabelToLeft;
     FColumnLink       = new DBWebColumnLink(this);
     IColumnLink       = (FColumnLink as IDBWebColumnLink);
     base.Width        = new Unit(minWidth);
     // TODO: remove from object inspector
     FAggregateType = AggType.aggAvg;
 }
Beispiel #57
0
 protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
 {
     if (e.Appointment.RecurrenceState == RecurrenceState.Master || e.Appointment.RecurrenceState == RecurrenceState.Occurrence)
     {
         System.Web.UI.WebControls.Panel recurrenceStateDiv = new System.Web.UI.WebControls.Panel();
         recurrenceStateDiv.CssClass = "rsAptRecurrence";
         e.Container.Controls.AddAt(0, recurrenceStateDiv);
     }
     if (e.Appointment.RecurrenceState == RecurrenceState.Exception)
     {
         System.Web.UI.WebControls.Panel recurrenceStateDiv = new System.Web.UI.WebControls.Panel();
         recurrenceStateDiv.CssClass = "rsAptRecurrenceException";
         e.Container.Controls.AddAt(0, recurrenceStateDiv);
     }
     Label1.Text = "";
 }
    static void Bind_Control(Control control, string type, string IsHid)
    {
        if (IsHid.Equals("0"))
        {
            control.Visible = true;
        }
        else
        {
            if (IsHid.Equals("1"))
            {
                control.Visible = false;
            }
            else
            {
                switch (type)
                {
                case "ASPxButton":
                    DevExpress.Web.ASPxEditors.ASPxButton ASPxButton_c = control as DevExpress.Web.ASPxEditors.ASPxButton;
                    if (IsHid.Equals("2") && ASPxButton_c != null)
                    {
                        ASPxButton_c.Enabled = false;
                    }
                    break;

                case "ASPxPageControl":
                    DevExpress.Web.ASPxTabControl.ASPxPageControl ASPxPageControl_c = control as DevExpress.Web.ASPxTabControl.ASPxPageControl;
                    if (IsHid.Equals("2") && ASPxPageControl_c != null)
                    {
                        ASPxPageControl_c.Enabled = false;
                    }
                    break;

                case "TabPage":
                    System.Web.UI.WebControls.Panel TabPage_c = control as System.Web.UI.WebControls.Panel;
                    if (IsHid.Equals("2") && TabPage_c != null)
                    {
                        TabPage_c.Enabled = false;
                    }
                    break;

                default:
                    break;
                }
            }
        }
    }
        public static void MostrarMensaje(string message, TipoMensaje tipoMensaje, System.Web.UI.WebControls.Panel panel)
        {
            string function = "";

            if (panel == null)
            {
                function = string.Format("message('{0}', '{1}');", HttpUtility.HtmlEncode(message).
                                         Replace("\r\n", "<br />").Replace("\n", "<br />"), tipoMensaje.ToString());
            }
            else
            {
                function = string.Format("message('{0}', '{1}', '{2}');", HttpUtility.HtmlEncode(message.
                                                                                                 Replace("\r\n", "<br />").Replace("\n", "<br />")), tipoMensaje.ToString(), panel.ClientID);
            }

            SitioScriptManager.RegistrarScript(function);
        }
Beispiel #60
0
        /// <summary>
        /// 界面的初始绑定
        /// </summary>
        private void InitBind(int type)
        {
            type = type <= 1 ? 1 : type;
            //内容页代码
            ContentPlaceHolder cpl1 = (ContentPlaceHolder)Master.FindControl("cphMain");

            for (int i = 1; i <= 4; i++)
            {
                //System.Web.UI.WebControls.contr
                System.Web.UI.WebControls.Panel p = (System.Web.UI.WebControls.Panel)cpl1.FindControl("Panel" + i);
                if (p == null)
                {
                    continue;
                }
                p.Visible = i == type;
            }
        }