Exemplo n.º 1
0
        protected override void OnInit(EventArgs e)
        {
            //初始化控件
            plhTopHolder    = new PlaceHolder();
            plhBottomHolder = new PlaceHolder();

            //添加顶端PlaceHolder
            Control form1 = this.FindControl("Form1");

            if (form1 != null)
            {
                form1.Controls.AddAt(0, plhTopHolder);
            }

            //添加页眉的用户自定义控件
            ITemplate Header = Page.LoadTemplate("~/Controls/Header.ascx");

            //this.plhTopHolder.Controls.Add(Header);

            //event
            this.Load      += new EventHandler(PageBase_Load);
            this.Error     += new EventHandler(PageBase_Error);
            this.PreRender += new EventHandler(PageBase_PreRender);

            base.OnInit(e);
        }
        /// <exclude />
        public static Control AsAspNetControl(this XhtmlDocument xhtmlDocument, IXElementToControlMapper controlMapper)
        {
            using (TimerProfilerFacade.CreateTimerProfiler())
            {
                HtmlGenericControl htmlControl = new HtmlGenericControl("html");
                CopyAttributes(xhtmlDocument.Root, htmlControl);

                HtmlHead headControl = xhtmlDocument.BuildHtmlHeadControl(controlMapper);

                Control bodyControl = xhtmlDocument.Body.AsAspNetControl(controlMapper);

                htmlControl.Controls.Add(headControl);
                htmlControl.Controls.Add(bodyControl);

                PlaceHolder pageHolder = new PlaceHolder();
                if (xhtmlDocument.DocumentType != null)
                {
                    string docType = xhtmlDocument.DocumentType.ToString();
                    if (docType.Contains("[]"))
                    {
                        docType = docType.Remove(docType.IndexOf("[]"), 2);
                    }

                    pageHolder.Controls.Add(new LiteralControl(docType));
                }
                pageHolder.Controls.Add(htmlControl);

                return pageHolder;
            }
        }
        /// <summary> Adds the main view section to the page turner </summary>
        /// <param name="placeHolder"> Main place holder ( &quot;mainPlaceHolder&quot; ) in the itemNavForm form into which the the bulk of the item viewer's output is displayed</param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        public override void Add_Main_Viewer_Section(PlaceHolder placeHolder, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("Feature_ItemViewer.Add_Main_Viewer_Section", "Adds one literal with all the html");
            }

            // Build the value
            StringBuilder builder = new StringBuilder(5000);

            // Save the current viewer code
            string current_view_code = CurrentMode.ViewerCode;

            // Start the citation table
            builder.AppendLine("\t\t<!-- FEATURE VIEWER OUTPUT -->" );
            builder.AppendLine("\t\t<td align=\"left\" height=\"40px\" ><span class=\"SobekViewerTitle\"><b>Index of Features</b></span></td></tr>" );
            builder.AppendLine("\t\t<tr><td class=\"SobekDocumentDisplay\">");
            builder.AppendLine("\t\t\t<div class=\"SobekCitation\">");

            // Get the list of streets from the database
            Map_Features_DataSet features = SobekCM_Database.Get_All_Features_By_Item( CurrentItem.Web.ItemID, Tracer );
            Create_Feature_Index( builder, features );

            // Finish the citation table
            builder.AppendLine( "\t\t\t</div>"  );
            builder.AppendLine("\t\t</td>" );
            builder.AppendLine("\t\t<!-- END FEATURE VIEWER OUTPUT -->" );

            // Restore the mode
            CurrentMode.ViewerCode = current_view_code;

            // Add the HTML for the image
            Literal mainLiteral = new Literal {Text = builder.ToString()};
            placeHolder.Controls.Add( mainLiteral );
        }
        public void loadUserControlToPlaceHolder(PlaceHolder myPlaceHolder, string controlPath)
        {
            try
            {
                if (!string.IsNullOrEmpty(controlPath))
                {
                    myPlaceHolder.Controls.Clear();
                    string control_path = System.Text.RegularExpressions.Regex.Replace(controlPath, @"<[^>]*>", string.Empty, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                    //UserControl userControl = (System.Web.UI.UserControl)this.LoadControl(controlPath);
                    //userControl.EnableViewState = false;
                    //myPlaceHolder.Controls.Add(userControl);

                    //Add div 
                    HtmlGenericControl gel = new HtmlGenericControl("div");
                    //Assign usercontrol on web page
                    Control ct = Page.LoadControl(control_path);
                    //add user control to div
                    gel.Controls.Add(ct);
                    //add div to placeholder                  
                    myPlaceHolder.Controls.Add(gel);
                }

            }
            catch (HttpException ex) { ex.ToString(); }
        }
Exemplo n.º 5
0
        private void displayShow(PlaceHolder placeholder, int shid)
        {
            placeholder.Controls.Clear();
            Show show = new Show();
            show.id = Convert.ToInt32(Request["shid"]);
            show.get();

            TextBox tickets = new TextBox();
            tickets.ID = "numOfTickets";

            Button order = new Button();
            order.Text = "Order!";
            order.Click += new System.EventHandler(this.orderClick);

            HiddenField hiddenShid = new HiddenField();
            hiddenShid.Value = shid.ToString();
            hiddenShid.ID = "hiddenShid";

            placeholder.Controls.Add(new LiteralControl("<h1>"+show.read("moid", true)+" @ "+show.read("show_start")+"</h1>"));
            placeholder.Controls.Add(new LiteralControl("<p>### tickets left</p>"));
            placeholder.Controls.Add(new LiteralControl("<p>Please input # of tickets you want to order</p>"));
            placeholder.Controls.Add(tickets);
            placeholder.Controls.Add(order);
            placeholder.Controls.Add(new LiteralControl("<br /><br /><a href=\"order_ticket.aspx\">Back to show list</a>"));
            placeholder.Controls.Add(hiddenShid);
        }
Exemplo n.º 6
0
        private void AddReportBody(Panel reportContainer)
        {
            reportBody = new Panel();
            reportBody.ID = "report";

            header = new ReportHeader();
            header.Path = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPReportParameters", "HeaderPath");
            reportBody.Controls.Add(header);

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

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

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

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

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

            reportContainer.Controls.Add(reportBody);
        }
        /// <summary> Add the main HTML for the main viewer, which is the bulk of the share fragment </summary>
        /// <param name="MainPlaceHolder">Main place holder ( "mainPlaceHolder" ) in the itemNavForm form into which the bulk of the item viewer's output is displayed</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        public override void Add_Main_Viewer_Section(PlaceHolder MainPlaceHolder, Custom_Tracer Tracer)
        {
            StringBuilder responseBuilder = new StringBuilder();

            // Calculate the title and url
            string title = HttpUtility.HtmlEncode(CurrentItem.Bib_Info.Main_Title.Title);
            string share_url = CurrentMode.Base_URL + "/" + CurrentItem.BibID + "/" + CurrentItem.VID;
            if (HttpContext.Current != null)
                share_url = HttpContext.Current.Items["Original_URL"].ToString().Replace("&", "%26").Replace("?", "%3F").Replace("http://", "").Replace("=", "%3D").Replace("\"", "&quot;");

            responseBuilder.AppendLine("<!-- Share form -->");
            responseBuilder.AppendLine("<div id=\"shareform_content\">");

            responseBuilder.AppendLine("<a href=\"http://www.facebook.com/share.php?u=" + share_url + "&amp;t=" + title + "\" target=\"FACEBOOK_WINDOW\" onmouseover=\"facebook_share.src='" + Static_Resources.Facebook_Share_H_Gif + "'\" onfocus=\"facebook_share.src='" + Static_Resources.Facebook_Share_H_Gif + "'\" onmouseout=\"facebook_share.src='" + Static_Resources.Facebook_Share_Gif + "'\" onblur=\"facebook_share.src='" + Static_Resources.Facebook_Share_Gif + "'\" onclick=\"\"><img class=\"ResultSavePrintButtons\" border=\"0px\" id=\"facebook_share\" name=\"facebook_share\" src=\"" + Static_Resources.Facebook_Share_Gif + "\" alt=\"FACEBOOK\" /></a>");
            responseBuilder.AppendLine("<a href=\"http://buzz.yahoo.com/buzz?targetUrl=" + share_url + "&amp;headline=" + title + "\" target=\"YAHOOBUZZ_WINDOW\" onmouseover=\"yahoobuzz_share.src='" + Static_Resources.Yahoobuzz_Share_H_Gif + "'\" onfocus=\"yahoobuzz_share.src='" + Static_Resources.Yahoobuzz_Share_H_Gif + "'\" onmouseout=\"yahoobuzz_share.src='" + Static_Resources.Yahoobuzz_Share_Gif + "'\" onblur=\"yahoobuzz_share.src='" + Static_Resources.Yahoobuzz_Share_Gif + "'\" onclick=\"\"><img class=\"ResultSavePrintButtons\" border=\"0px\" id=\"yahoobuzz_share\" name=\"yahoobuzz_share\" src=\"" + Static_Resources.Yahoobuzz_Share_Gif + "\" alt=\"YAHOO BUZZ\" /></a>");
            responseBuilder.AppendLine("<br />");

            responseBuilder.AppendLine("<a href=\"http://twitter.com/home?status=Currently reading " + share_url + "\" target=\"TWITTER_WINDOW\" onmouseover=\"twitter_share.src='" + Static_Resources.Twitter_Share_H_Gif + "'\" onfocus=\"twitter_share.src='" + Static_Resources.Twitter_Share_H_Gif + "'\" onmouseout=\"twitter_share.src='" + Static_Resources.Twitter_Share_Gif + "'\" onblur=\"twitter_share.src='" + Static_Resources.Twitter_Share_Gif + "'\" onclick=\"\"><img class=\"ResultSavePrintButtons\" border=\"0px\" id=\"twitter_share\" name=\"twitter_share\" src=\"" + Static_Resources.Twitter_Share_Gif + "\" alt=\"TWITTER\" /></a>");
            responseBuilder.AppendLine("<a href=\"http://www.google.com/bookmarks/mark?op=add&amp;bkmk=" + share_url + "&amp;title=" + title + "\" target=\"GOOGLE_WINDOW\" onmouseover=\"google_share.src='" + Static_Resources.Google_Share_H_Gif + "'\" onfocus=\"google_share.src='" + Static_Resources.Google_Share_H_Gif + "'\" onmouseout=\"google_share.src='" + Static_Resources.Google_Share_Gif + "'\" onblur=\"google_share.src='" + Static_Resources.Google_Share_Gif + "'\" onclick=\"\"><img class=\"ResultSavePrintButtons\" border=\"0px\" id=\"google_share\" name=\"google_share\" src=\"" + Static_Resources.Google_Share_Gif + "\" alt=\"GOOGLE SHARE\" /></a>");
            responseBuilder.AppendLine("<br />");

            responseBuilder.AppendLine("<a href=\"http://www.stumbleupon.com/submit?url=" + share_url + "&amp;title=" + title + "\" target=\"STUMBLEUPON_WINDOW\" onmouseover=\"stumbleupon_share.src='" + Static_Resources.Stumbleupon_Share_H_Gif + "'\" onfocus=\"stumbleupon_share.src='" + Static_Resources.Stumbleupon_Share_H_Gif + "'\" onmouseout=\"stumbleupon_share.src='" + Static_Resources.Stumbleupon_Share_Gif + "'\" onblur=\"stumbleupon_share.src='" + Static_Resources.Stumbleupon_Share_Gif + "'\" onclick=\"\"><img class=\"ResultSavePrintButtons\" border=\"0px\" id=\"stumbleupon_share\" name=\"stumbleupon_share\" src=\"" + Static_Resources.Stumbleupon_Share_Gif + "\" alt=\"STUMBLEUPON\" /></a>");
            responseBuilder.AppendLine("<a href=\"http://myweb.yahoo.com/myresults/bookmarklet?t=" + title + "&amp;u=" + share_url + "\" target=\"YAHOO_WINDOW\" onmouseover=\"yahoo_share.src='" + Static_Resources.Yahoo_Share_H_Gif + "'\" onfocus=\"yahoo_share.src='" + Static_Resources.Yahoo_Share_H_Gif + "'\" onmouseout=\"yahoo_share.src='" + Static_Resources.Yahoo_Share_Gif + "'\" onblur=\"yahoo_share.src='" + Static_Resources.Yahoo_Share_Gif + "'\" onclick=\"\"><img class=\"ResultSavePrintButtons\" border=\"0px\" id=\"yahoo_share\" name=\"yahoo_share\" src=\"" + Static_Resources.Yahoo_Share_Gif + "\" alt=\"YAHOO SHARE\" /></a>");
            responseBuilder.AppendLine("<br />");

            responseBuilder.AppendLine("<a href=\"http://digg.com/submit?phase=2&amp;url=" + share_url + "&amp;title=" + title + "\" target=\"DIGG_WINDOW\" onmouseover=\"digg_share.src='" + Static_Resources.Digg_Share_H_Gif + "'\" onfocus=\"digg_share.src='" + Static_Resources.Digg_Share_H_Gif + "'\" onmouseout=\"digg_share.src='" + Static_Resources.Digg_Share_Gif + "'\" onblur=\"digg_share.src='" + Static_Resources.Digg_Share_Gif + "'\"  nclick=\"\"><img class=\"ResultSavePrintButtons\" border=\"0px\" id=\"digg_share\" name=\"digg_share\" src=\"" + Static_Resources.Digg_Share_Gif + "\" alt=\"DIGG\" /></a>");
            responseBuilder.AppendLine("<a onmouseover=\"favorites_share.src='" + Static_Resources.Facebook_Share_H_Gif + "'\" onfocus=\"favorites_share.src='" + Static_Resources.Facebook_Share_H_Gif + "'\" onmouseout=\"favorites_share.src='" + Static_Resources.Facebook_Share_Gif + "'\" onblur=\"favorites_share.src='" + Static_Resources.Facebook_Share_Gif + "'\" onclick=\"javascript:add_to_favorites();\"><img class=\"ResultSavePrintButtons\" border=\"0px\" id=\"favorites_share\" name=\"favorites_share\" src=\"" + Static_Resources.Facebook_Share_Gif + "\" alt=\"MY FAVORITES\" /></a>");
            responseBuilder.AppendLine("<br />");

            responseBuilder.AppendLine("</div>");
            responseBuilder.AppendLine();

            MainPlaceHolder.Controls.Add(new Literal() { Text = responseBuilder.ToString() });
        }
Exemplo n.º 8
0
        protected override void CreateChildControls()
        {
            Controls.Clear();

            Control articleMarkup = Page.LoadControl("~/Design/Article.ascx");

            _headerPlaceholder = articleMarkup.FindControl("HeaderPlaceholder") as PlaceHolder;
            _contentPlaceholder = articleMarkup.FindControl("ContentPlaceholder") as PlaceHolder;

            _headerPlaceholder.Visible = ! String.IsNullOrEmpty(_caption);

            if (_headerPlaceholder.Visible)
            {
                Literal caption = new Literal();
                caption.Text = _caption;
                _headerPlaceholder.Controls.Add(caption);
            }

            if (_contentTemplate != null)
            {
                TemplateContainer container = new TemplateContainer();
                _contentTemplate.InstantiateIn(container);
                _contentPlaceholder.Controls.Add(container);
            }

            Controls.Add(articleMarkup);
        }
Exemplo n.º 9
0
 protected void ShowSaveMessage( PlaceHolder plhSaveMessage )
 {
     if( IsPostBack ) {
         return;
     }
     if( plhSaveMessage == null || plhSaveMessage == null ) {
         return;
     }
     string msg = Session[ "SaveMessage" ] as string;
     if( msg == null ) {
         return;
     }
     plhSaveMessage.Controls.Add( string.Format( "<div id=\"savemessage\">{0}</div>", msg ) );
     plhSaveMessage.Visible = true;
     plhSaveMessage.Controls.Add( @"
     <script type=""text/javascript"">
     function hideSaveMessage() {
     if( !document.getElementById(""savemessage"") ) {
     return;
     }
     $( ""#savemessage"" ).slideUp( 300 );
     }
     $( ""document"" ).ready( function() { setTimeout( ""hideSaveMessage()"", 2000 ); } );
     </script>
     " );
     try {
         Session.Remove( "SaveMessage" );
     } catch {
     }
 }
        /// <summary> Adds the main view section to the page turner </summary>
        /// <param name="placeHolder"> Main place holder ( &quot;mainPlaceHolder&quot; ) in the itemNavForm form into which the the bulk of the item viewer's output is displayed</param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        public override void Add_Main_Viewer_Section(PlaceHolder placeHolder, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("Download_Only_ItemViewer.Add_Main_Viewer_Section", "Adds one literal with all the html");
            }

            // Build the value
            StringBuilder builder = new StringBuilder(1500);

            // Save the current viewer code
            string current_view_code = CurrentMode.ViewerCode;

            // Start the citation table
            builder.AppendLine("\t\t<!-- DOWNLOAD ONLY VIEWER OUTPUT -->" );
            builder.AppendLine("\t\t<td class=\"SobekDocumentDisplay\">" );
            builder.AppendLine("\t\t\t<div class=\"SobekCitation\">" );

            builder.AppendLine("\t\t\t</div>" );

            // Finish the table
            builder.AppendLine( "\t\t</td>" );
            builder.AppendLine("\t\t<!-- END DOWNLOAD ONLY VIEWER OUTPUT -->"  );

            // Restore the mode
            CurrentMode.ViewerCode = current_view_code;

            // Add the HTML for the image
            Literal mainLiteral = new Literal {Text = builder.ToString()};
            placeHolder.Controls.Add( mainLiteral );
        }
Exemplo n.º 11
0
		protected override void CreateChildControls()
		{
			Controls.Add(this.ok   = new PlaceHolder());
			Controls.Add(this.fail = new PlaceHolder());
			
			base.CreateChildControls();
		}
Exemplo n.º 12
0
		void gen(PlaceHolder Stats, Log.Items item)
		{
			Query q = new Query();
			q.ExtraSelectElements.Add("Count", "SUM([Log].[Count])");
			q.ExtraSelectElements.Add("Day", "DATENAME(DW,[Log].[Date])");
			q.QueryCondition = new Q(Log.Columns.Item, item);
			q.GroupBy = new GroupBy("DATENAME(DW,[Log].[Date])");
			q.Columns = new ColumnSet();
			LogSet ls = new LogSet(q);
			Dictionary<DayOfWeek, double> weight = new Dictionary<DayOfWeek, double>();
			int total = 0;
			foreach (Log l in ls)
			{
				total += (int)l.ExtraSelectElements["Count"];
			}
			foreach (Log l in ls)
			{
				double fraction = (double)(int)l.ExtraSelectElements["Count"] / (double)total;
				switch ((string)l.ExtraSelectElements["Day"])
				{
					case "Monday": weight[DayOfWeek.Monday] = fraction; break;
					case "Tuesday": weight[DayOfWeek.Tuesday] = fraction; break;
					case "Wednesday": weight[DayOfWeek.Wednesday] = fraction; break;
					case "Thursday": weight[DayOfWeek.Thursday] = fraction; break;
					case "Friday": weight[DayOfWeek.Friday] = fraction; break;
					case "Saturday": weight[DayOfWeek.Saturday] = fraction; break;
					case "Sunday": weight[DayOfWeek.Sunday] = fraction; break;
					default: break;
				}
			}
			Stats.Controls.Add(new LiteralControl("<table><tr><td>Month</td><td>Year</td><td>Weight</td><td>Actual pages</td><td>Weighted pages</td></tr>"));
			for (DateTime dtMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(-12); dtMonth <= new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); dtMonth = dtMonth.AddMonths(1))
			{
				try
				{
					double monthWeight = 0.0;
					for (DateTime dtDay = dtMonth; dtDay < dtMonth.AddMonths(1) && dtDay < DateTime.Today; dtDay = dtDay.AddDays(1))
					{
						monthWeight += weight[dtDay.DayOfWeek];
					}
					Query qMonth = new Query();
					qMonth.ExtraSelectElements.Add("Count", "SUM([Log].[Count])");
					qMonth.QueryCondition = new And(
						new Q(Log.Columns.Item, item),
						new Q(Log.Columns.Date, QueryOperator.GreaterThanOrEqualTo, dtMonth),
						new Q(Log.Columns.Date, QueryOperator.LessThan, dtMonth.AddMonths(1)),
						new Q(Log.Columns.Date, QueryOperator.LessThan, DateTime.Today));
					qMonth.Columns = new ColumnSet();
					LogSet lsMonth = new LogSet(qMonth);
					int actualPages = (int)lsMonth[0].ExtraSelectElements["Count"];
					double pagesPerWeek = (double)actualPages / monthWeight;
					double pagesPerMonth = pagesPerWeek * 4.345238095;

					Stats.Controls.Add(new LiteralControl("<tr><td>" + dtMonth.ToString("MMM") + "</td><td>" + dtMonth.Year + "</td><td>" + monthWeight.ToString("0.00") + "</td><td>" + actualPages.ToString("0") + "</td><td>" + pagesPerMonth.ToString("0") + "</td></tr>"));
					//				Stats.Controls.Add(new LiteralControl( + " " +  + " is " +  + " weeks. " +  + " pages per week.<br>"));
				}
				catch { }
			}
			Stats.Controls.Add(new LiteralControl("</table>"));
		}
        public static void loadBlog(DataSet UserDataSet, PlaceHolder BlogHolder, string sort)
        {
            if (UserDataSet.Tables["Articles"].Rows.Count == 0)
            {
                BlogHolder.Controls.Add(new LiteralControl("<p>暂无文章</p>"));
            }
            else
            {
                DataRow[] dr = UserDataSet.Tables["Articles"].Select("", sort);
                for (int i = 0; i < dr.Length; i++)
                {
                    HyperLink articleTitle = new HyperLink();

                    articleTitle.ID = (i + 1).ToString() + "_Link";
                    articleTitle.Text = (i + 1).ToString() + "." + dr[i]["title"].ToString();
                    articleTitle.NavigateUrl = "UserBlog_ArticlesDetails.aspx?par_ArticleID=" + dr[i]["ID"].ToString();
                    articleTitle.Font.Size = 6;
                    articleTitle.Font.Bold = true;

                    BlogHolder.Controls.Add(new LiteralControl("<div style=\"margin-left:10px;margin-top:20px;margin-right:10px;border-bottom:1px dashed;\">"));
                    BlogHolder.Controls.Add(articleTitle);
                    BlogHolder.Controls.Add(new LiteralControl("</div>"));
                }
            }
        }
		protected void LoadFooterCtrl(PlaceHolder plcHolder, ControlLocation CtrlKey) {
			string sControlPath = String.Empty;
			CarrotCakeConfig config = CarrotCakeConfig.GetConfig();

			switch (CtrlKey) {
				case ControlLocation.PublicFooter:
					sControlPath = config.AdminFooterControls.ControlPathPublic;
					break;

				case ControlLocation.PopupFooter:
					sControlPath = config.AdminFooterControls.ControlPathPopup;
					break;

				case ControlLocation.MainFooter:
					sControlPath = config.AdminFooterControls.ControlPathMain;
					break;
			}

			if (!String.IsNullOrEmpty(sControlPath)) {
				if (File.Exists(Server.MapPath(sControlPath))) {
					Control ctrl = new Control();
					ctrl = Page.LoadControl(sControlPath);
					plcHolder.Controls.Add(ctrl);
				}
			}
		}
        /// <summary>
        /// Create the control contains all components for the dynamic page configuration.
        /// </summary>
        /// <param name="dynamicPageConfiguration"></param>
        /// <returns></returns>
        public Control Create(DynamicPageConfiguration dynamicPageConfiguration)
        {
            PlaceHolder placeHolder = new PlaceHolder();

            bool isTopPanel = true;
            foreach (BasePanelConfiguration basePanelConfiguration in dynamicPageConfiguration.Panels)
            {
                WebControl createdControl = null;
                switch (basePanelConfiguration.PanelType)
                {
                    case DynamicPagePanelTypes.ButtonPanel:
                        createdControl = CreateButtonPanel(basePanelConfiguration);
                        break;

                    case DynamicPagePanelTypes.GridViewPanel:
                        createdControl = CreateGridViewPanel(basePanelConfiguration, dynamicPageConfiguration);
                        createdControl.Style["margin-top"] = isTopPanel ? "2px" : "4px";
                        break;

                    case DynamicPagePanelTypes.QueryPanel:
                        createdControl = CreateQueryPanel(basePanelConfiguration);
                        createdControl.Style["margin-top"] = isTopPanel ? "2px" : "4px";
                        break;
                }

                if (createdControl != null)
                {
                    isTopPanel = false;
                    placeHolder.Controls.Add(createdControl);
                }
            }

            return placeHolder;
        }
Exemplo n.º 16
0
 /// <summary>
 /// Constructor
 /// </summary>
 public pagerlinks(int Index, int PageSize, int RecordCount, PlaceHolder ph)
 {
     this._Index = Index;
     this._PageSize = PageSize;
     this._RcdCount = RecordCount;
     this._placeholder = ph;
 }
        public PlaceHolder BuildNotifications(string userId)
        {
            DataHandler handler = new DataHandler();

            string query;
            PlaceHolder ph = new PlaceHolder();
            DataTable[] tables = new DataTable[2];
            ArrayList messages = new ArrayList();

            GroupService groupService = new GroupService();

            //http://stackoverflow.com/questions/5672862/check-if-datetime-instance-falls-in-between-other-two-datetime-objects
            //notification: you added a teacher
            query =
                "SELECT * FROM user_UserHasTeachers " +
                "WHERE TeacherId = ''" +
                "ORDER BY Timestamp";
            tables[0] = handler.GetDataTable(query);

            foreach (DataRow row in tables[0].Rows)
            {

            }

            //make sense of the data tables
            //for each table
            foreach (DataTable dt in tables)
            {
                //check timestamp
                //insert into position
            }

            return ph;
        }
Exemplo n.º 18
0
		public void SetData (System.Web.UI.WebControls.PlaceHolder Anchor,
								DataHandling DhExisting, int NumberOfDisplayableEntries)
			{
			m_Anchor = Anchor;
			m_Dh = DhExisting;
			m_NumberOfDisplayableEntries = NumberOfDisplayableEntries;
			}
Exemplo n.º 19
0
        public void LoadControl(string UpdatePanelIDPrefix, bool IsPartialRendring, PlaceHolder ContainerControl, string ControlSrc)
        {
            SageUserControl ctl;
            if (ControlSrc.ToLower().EndsWith(".ascx"))
            {
                if (IsPartialRendring)
                {
                    UpdatePanel udp = CreateUpdatePanel(UpdatePanelIDPrefix, UpdatePanelUpdateMode.Always, ContainerControl.Controls.Count);
                    ctl = this.Page.LoadControl("~" + ControlSrc) as SageUserControl;
                    //ctl.EnableViewState = true;
                    udp.ContentTemplateContainer.Controls.Add(ctl);
                    //ContainerControl.Controls.Clear();
                    ContainerControl.Controls.Add(udp);
                }
                else
                {
                    ctl = this.Page.LoadControl("~" + ControlSrc) as SageUserControl;
                    ContainerControl.Controls.Clear();
                    ContainerControl.Controls.Add(ctl);
                }
            }
            else
            {
            }

        }
Exemplo n.º 20
0
        public void LoadProviderControl(int packageId, string groupName, PlaceHolder container, string controlName)
        {
            string ctrlPath = null;
            //try
            //{
            // load provider
            ProviderInfo provider = ES.Services.Servers.GetPackageServiceProvider(packageId, groupName);

            // try to locate suitable control
            string currPath = this.AppRelativeVirtualPath;
            currPath = currPath.Substring(0, currPath.LastIndexOf("/"));

            ctrlPath = currPath + "/ProviderControls/" + provider.EditorControl + "_" + controlName;

            Control ctrl = Page.LoadControl(ctrlPath);

            // add control to the placeholder
            container.Controls.Add(ctrl);
            //}
            //catch (Exception ex)
            //{
            /*container.Controls.Add(new LiteralControl(
                String.Format("'{0}' control is not found or provided control class doesn't implement required interface: {1}",
                ctrlPath, ex.ToString())));
             * */
            //}
        }
        /// <summary> Adds the main view section to the page turner </summary>
        /// <param name="placeHolder"> Main place holder ( &quot;mainPlaceHolder&quot; ) in the itemNavForm form into which the the bulk of the item viewer's output is displayed</param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        public override void Add_Main_Viewer_Section(PlaceHolder placeHolder, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("EmbeddedVideo_ItemViewer.Add_Main_Viewer_Section", "Adds one literal with all the html");
            }

            //Determine the name of the FLASH file
            string youtube_url = CurrentItem.Bib_Info.Location.Other_URL;
            if (youtube_url.IndexOf("watch") > 0)
                youtube_url = youtube_url.Replace("watch?v=", "v/") + "?fs=1&amp;hl=en_US";
            const int width = 600;
            const int height = 480;

            // Add the HTML for the image
            StringBuilder result = new StringBuilder(500);
            result.AppendLine("        <!-- EMBEDDED VIDEO VIEWER OUTPUT -->");
            result.AppendLine("          <td align=\"left\"><span class=\"SobekViewerTitle\"><b>Streaming Video</b></span></td>");
            result.AppendLine("        </tr>");
            result.AppendLine("        <tr>");
            result.AppendLine("          <td class=\"SobekCitationDisplay\">");

            result.AppendLine(CurrentItem.Behaviors.Embedded_Video);

            result.AppendLine("          </td>");
            result.AppendLine("        <!-- END EMBEDDED VIDEO VIEWER OUTPUT -->");

            Literal mainLiteral = new Literal { Text = result.ToString() };
            placeHolder.Controls.Add(mainLiteral);
        }
Exemplo n.º 22
0
        private void AddReportBody(Panel container)
        {
            this.reportBody = new Panel();
            this.reportBody.ID = "report";

            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 override void Add_Main_Viewer_Section(PlaceHolder placeHolder, Custom_Tracer Tracer)
        {
            if ((CurrentItem.Behaviors.Can_Be_Described) && (CurrentUser != null))
            {
                // Determine the number of columns for text areas, depending on browser
                int actual_cols = 50;
                if (CurrentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0)
                    actual_cols = 45;

                StringBuilder responseBuilder = new StringBuilder();
                responseBuilder.AppendLine("<!-- Add descriptive tage form  -->");
                responseBuilder.AppendLine("<div class=\"describe_popup_div\" id=\"describe_item_form\" style=\"display:none;\">");
                responseBuilder.AppendLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">A<span class=\"smaller\">DD </span> I<span class=\"smaller\">TEM </span> D<span class=\"smaller\">ESCRIPTION</span></td><td align=\"right\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"describe_item_form_close()\">X</a> &nbsp; </td></tr></table></div>");
                responseBuilder.AppendLine("  <br />");
                responseBuilder.AppendLine("  <fieldset><legend>Enter a description or notes to add to this item &nbsp; </legend>");
                responseBuilder.AppendLine("    <br />");
                responseBuilder.AppendLine("    <table class=\"popup_table\">");

                // Add comments area
                responseBuilder.Append("      <tr align=\"left\" valign=\"top\"><td><br /><label for=\"add_notes\">Notes:</label></td>");
                responseBuilder.AppendLine("<td><textarea rows=\"10\" cols=\"" + actual_cols + "\" name=\"add_tag\" id=\"add_tag\" class=\"add_notes_textarea\" onfocus=\"javascript:textbox_enter('add_tag','add_notes_textarea_focused')\" onblur=\"javascript:textbox_leave('add_tag','add_notes_textarea')\"></textarea></td></tr>");
                responseBuilder.AppendLine("    </table>");
                responseBuilder.AppendLine("    <br />");
                responseBuilder.AppendLine("  </fieldset><br />");
                responseBuilder.AppendLine("  <center><a href=\"\" onclick=\"return describe_item_form_close();\"><img border=\"0\" src=\"" + CurrentMode.Base_URL + "design/skins/" + CurrentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; &nbsp; <input type=\"image\" src=\"" + CurrentMode.Base_URL + "design/skins/" + CurrentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\" ></center><br />");
                responseBuilder.AppendLine("</div>");
                responseBuilder.AppendLine();

                placeHolder.Controls.Add(new Literal() { Text = responseBuilder.ToString() });
            }
        }
        /// <summary> Adds the main view section to the page turner </summary>
        /// <param name="placeHolder"> Main place holder ( &quot;mainPlaceHolder&quot; ) in the itemNavForm form into which the the bulk of the item viewer's output is displayed</param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        public override void Add_Main_Viewer_Section(PlaceHolder placeHolder, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("YouTube_Embedded_Video_ItemViewer.Add_Main_Viewer_Section", "Adds one literal with all the html");
            }

            //Determine the name of the FLASH file
            string youtube_url = CurrentItem.Bib_Info.Location.Other_URL;
             if ( youtube_url.IndexOf("watch") > 0 )
                 youtube_url = youtube_url.Replace("watch?v=","v/") + "?fs=1&amp;hl=en_US";
            const int width = 600;
            const int height = 480;

            // Add the HTML for the image
            StringBuilder result = new StringBuilder(500);
            result.AppendLine("        <!-- YOU TUBE VIEWER OUTPUT -->");
            result.AppendLine("          <td align=\"left\"><span class=\"SobekViewerTitle\"><b>Streaming Video</b></span></td>");
            result.AppendLine("        </tr>");
            result.AppendLine("        <tr>");
            result.AppendLine("          <td class=\"SobekCitationDisplay\">");
            result.AppendLine("            <object width=\"" + width + "\" height=\"" + height + "\">");
            result.AppendLine("              <param name=\"allowscriptaccess\" value=\"always\" />");
            result.AppendLine("              <param name=\"movie\" value=\"" + youtube_url + "\" />");
            result.AppendLine("              <param name=\"allowFullScreen\" value=\"true\"></param>");
            result.AppendLine("              <embed src=\"" + youtube_url + "\" type=\"application/x-shockwave-flash\" AllowScriptAccess=\"always\" allowfullscreen=\"true\" width=\"" + width + "\" height=\"" + height + "\"></embed>");
            result.AppendLine("            </object>");
            result.AppendLine("          </td>" );
            result.AppendLine("        <!-- END YOU TUBE VIEWER OUTPUT -->" );

            Literal mainLiteral = new Literal {Text = result.ToString()};
            placeHolder.Controls.Add(mainLiteral);
        }
        public void showpeiveodl(DataSet ds, int iden)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                StreamReader fp;
                string folderid = getremembrancefolderName(iden);
                string filepath = Server.MapPath("../remembrancefiles/" + folderid + "/" + iden + "/" + "index.html");
                string imagePath = Server.MapPath("../remembrancefiles/" + folderid + "/" + iden + "/images");
                if (File.Exists(filepath))
                {
                    fp = File.OpenText(Server.MapPath("../remembrancefiles/" + folderid + "/" + iden + "/" + "index.html"));
                    filecontent = fp.ReadToEnd();
                    fp.Close();
                    if (Directory.Exists(imagePath))
                    {
                        filecontent = filecontent.Replace("images", "../remembrancefiles/" + folderid + "/" + iden + "/images");
                    }

                }
                PlaceHolder pl = new PlaceHolder();
                StringBuilder htmlTable = new StringBuilder();
                htmlTable.Append(filecontent);
                pl.Controls.Add(new Literal { Text = htmlTable.ToString() });
                Page.FindControl("mess").Controls.Add(pl);
            }
            else
            {
                Response.Redirect("index.aspx");
            }

        }
Exemplo n.º 26
0
        protected override void OnInit(EventArgs e)
        {
            Title = "View \"" + SelectedItem.Title + "\"";

            // Get selected property from content item.
            ContentType contentType = Zeus.Context.Current.ContentTypes[SelectedItem.GetType()];
            foreach (IContentProperty property in contentType.Properties)
            {
                PlaceHolder plcDisplay = new PlaceHolder();
                Panel panel = new Panel { CssClass = "editDetail" };
                HtmlGenericControl label = new HtmlGenericControl("label");
                label.Attributes["class"] = "editorLabel";
                label.InnerText = property.Name;
                panel.Controls.Add(label);
                plcDisplay.Controls.Add(panel);
                plcDisplayers.Controls.Add(plcDisplay);

                IDisplayer displayer = contentType.GetDisplayer(property.Name);
                if (displayer != null)
                {
                    //displayer.AddTo(this, contentItem, this.PropertyName);
                    displayer.InstantiateIn(panel);
                    displayer.SetValue(panel, SelectedItem, property.Name);
                }
                else
                {
                    panel.Controls.Add(new LiteralControl("{No displayer}"));
                }
                panel.Controls.Add(new LiteralControl("&nbsp;"));
            }

            base.OnInit(e);
        }
        public void InstantiateIn(Control container)
        {

            PlaceHolder templatePlaceHolder = new PlaceHolder();
            container.Controls.Add(templatePlaceHolder);
            templatePlaceHolder.DataBinding += new EventHandler(DataBindTemplate);
        }
        public override void Add_Main_Viewer_Section(PlaceHolder placeHolder, Custom_Tracer Tracer)
        {
            // Set caching on this
            HttpContext.Current.Response.Cache.SetCacheability( HttpCacheability.NoCache );

            if ((CurrentItem.Web.ItemID > 0) && (CurrentUser != null) && (!CurrentUser.Is_In_Bookshelf(CurrentItem.BibID, CurrentItem.VID)))
            {
                StringBuilder responseBuilder = new StringBuilder();

                // Determine the number of columns for text areas, depending on browser
                int actual_cols = 50;
                if (CurrentMode.Browser_Type.ToUpper().IndexOf("FIREFOX") >= 0)
                    actual_cols = 45;

                responseBuilder.AppendLine("<!-- Add to bookshelf form -->");
                responseBuilder.AppendLine("<div id=\"addform_content\">");
                responseBuilder.AppendLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">A<span class=\"smaller\">DD THIS</span> I<span class=\"smaller\">TEM TO YOUR</span> B<span class=\"smaller\">OOKSHELF</span></td><td align=\"right\"> <a href=\"#template\" alt=\"CLOSE\" onclick=\"add_item_form_close()\">X</a> &nbsp; </td></tr></table></div>");
                responseBuilder.AppendLine("  <br />");
                responseBuilder.AppendLine("  <fieldset><legend>Enter notes for this item in your bookshelf &nbsp; </legend>");
                responseBuilder.AppendLine("    <br />");
                responseBuilder.AppendLine("    <table class=\"popup_table\">");

                // Add bookshelf choices
                responseBuilder.Append("      <tr align=\"left\"><td width=\"80px\"><label for=\"add_bookshelf\">Bookshelf:</label></td>");
                responseBuilder.Append("<td><select class=\"email_bookshelf_input\" name=\"add_bookshelf\" id=\"add_bookshelf\">");

                foreach (User_Folder folder in CurrentUser.All_Folders)
                {
                    if (folder.Folder_Name.Length > 80)
                    {
                        responseBuilder.Append("<option value=\"" + HttpUtility.HtmlEncode(folder.Folder_Name) + "\">" + HttpUtility.HtmlEncode(folder.Folder_Name.Substring(0, 75)) + "...</option>");
                    }
                    else
                    {
                        if (folder.Folder_Name != "Submitted Items")
                        {
                            if (folder.Folder_Name == "My Bookshelf")
                                responseBuilder.Append("<option value=\"" + HttpUtility.HtmlEncode(folder.Folder_Name) + "\" selected=\"selected\" >" + HttpUtility.HtmlEncode(folder.Folder_Name) + "</option>");
                            else
                                responseBuilder.Append("<option value=\"" + HttpUtility.HtmlEncode(folder.Folder_Name) + "\">" + HttpUtility.HtmlEncode(folder.Folder_Name) + "</option>");
                        }
                    }
                }
                responseBuilder.AppendLine("</select></td></tr>");

                // Add comments area
                responseBuilder.Append("      <tr align=\"left\" valign=\"top\"><td><br /><label for=\"add_notes\">Notes:</label></td>");
                responseBuilder.AppendLine("<td><textarea rows=\"6\" cols=\"" + actual_cols + "\" name=\"add_notes\" id=\"add_notes\" class=\"add_notes_textarea\" onfocus=\"javascript:textbox_enter('add_notes','add_notes_textarea_focused')\" onblur=\"javascript:textbox_leave('add_notes','add_notes_textarea')\"></textarea></td></tr>");
                responseBuilder.AppendLine("      <tr align=\"left\" valign=\"top\"><td>&nbsp;</td><td><input type=\"checkbox\" id=\"open_bookshelf\" name=\"open_bookshelf\" value=\"open\" /> <label for=\"open_bookshelf\">Open bookshelf in new window</label></td></tr>");
                responseBuilder.AppendLine("    </table>");
                responseBuilder.AppendLine("    <br />");
                responseBuilder.AppendLine("  </fieldset><br />");
                responseBuilder.AppendLine("  <center><a href=\"\" onclick=\"return add_item_form_close();\"><img border=\"0\" src=\"" + CurrentMode.Base_URL + "design/skins/" + CurrentMode.Base_Skin + "/buttons/cancel_button_g.gif\" alt=\"CLOSE\" /></a> &nbsp; &nbsp; <input type=\"image\" src=\"" + CurrentMode.Base_URL + "design/skins/" + CurrentMode.Base_Skin + "/buttons/save_button_g.gif\" value=\"Submit\" alt=\"Submit\" ></center><br />");
                responseBuilder.AppendLine("</div>");
                responseBuilder.AppendLine();

                placeHolder.Controls.Add(new Literal() { Text = responseBuilder.ToString() });
            }
        }
Exemplo n.º 29
0
 private Control CreateDashBoardWrapperControl(Control control)
 {
     PlaceHolder placeHolder = new PlaceHolder();
     placeHolder.Controls.Add(new LiteralControl("<br/><fieldSet style=\"padding: 5px\">"));
     placeHolder.Controls.Add(control);
     placeHolder.Controls.Add(new LiteralControl("</fieldSet>"));
     return placeHolder;
 }
        protected void LoadErrorBar(System.Web.UI.WebControls.PlaceHolder errorBarContainer)
        {
            Control error = Page.LoadControl("uc/ErrorWeb.ascx");

            error.ID = "Error";
            this.AsignarPropiedadesControl(error);
            errorBarContainer.Controls.Add(error);
        }
 /// <summary>
 /// Init routine
 /// </summary>
 protected virtual void InitalizerPlaceHolder(ref PlaceHolder ph)
 {
     if (ph == null)
     {
         ph = new PlaceHolder();
     }
     ph.Controls.Clear();
 }
 /// <summary> Perform all the work of adding to the response stream back to the web user </summary>
 /// <param name="Navigation_Place_Holder"> Place holder is used to add more complex server-side objects during execution</param>
 /// <param name="TOC_Place_Holder"> Place holder is used to add more complex server-side objects during execution</param>
 /// <param name="Main_Place_Holder"> Place holder is used to add more complex server-side objects during execution</param>
 /// <param name="myUfdcUploadPlaceHolder"> Place holder is used to add more complex server-side objects during execution </param>
 /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
 /// <remarks> Since this class writes all the output directly to the response stream, this method simply returns, without doing anything</remarks>
 public override void Add_Controls(PlaceHolder Navigation_Place_Holder,
     PlaceHolder TOC_Place_Holder,
     PlaceHolder Main_Place_Holder,
     PlaceHolder myUfdcUploadPlaceHolder,
     Custom_Tracer Tracer)
 {
     return;
 }
Exemplo n.º 33
0
        public override void RenderControl()
        {
            base.RenderControl();


            ListHolder = new PlaceHolder();
            this.ContentPlaceHolder.Controls.Add(ListHolder);

            RenderList();
        }
Exemplo n.º 34
0
        public override void Add_Controls(System.Web.UI.WebControls.PlaceHolder MainPlaceHolder, Custom_Tracer Tracer)
        {
            if ((page == 1) && (String.IsNullOrEmpty(file_name)))
            {
                Tracer.Add_Trace("Import_Spreadsheet_MySobekViewer.Add_Controls", "Add upload controls for the spreadsheet upload");

                // Add the upload controls to the file place holder
                add_upload_controls(MainPlaceHolder, Tracer);
            }
        }
Exemplo n.º 35
0
 public void AddContraint(System.Web.UI.WebControls.PlaceHolder list, string key, string value, string returnPage)
 {
     System.Web.UI.WebControls.HyperLink hyperlink = new System.Web.UI.WebControls.HyperLink();
     System.Web.UI.WebControls.Label     separator = new System.Web.UI.WebControls.Label();
     hyperlink.Text        = "   " + key + "  [" + value.Replace(",", " - ") + "]";
     hyperlink.NavigateUrl = "search_remove_key.aspx?key=" + key + "&return=" + returnPage;
     separator.Text        = "  |  ";
     list.Controls.Add(hyperlink);
     list.Controls.Add(separator);
 }
Exemplo n.º 36
0
        public override void RenderControl()
        {
            page = HttpContext.Current.Handler as BasePage;
            base.RenderControl();

            ListHolder = new PlaceHolder();
            this.ContentPlaceHolder.Controls.Add(ListHolder);

            RenderList();
        }
Exemplo n.º 37
0
        public override void RenderControl()
        {
            page = HttpContext.Current.Handler as BasePage;
            base.RenderControl();


            Criteria = new PlaceHolder();
            this.ContentPlaceHolder.Controls.Add(Criteria);

            //CodeTorch.Web.CriteriaFunctions.CriteriaButtonClickDelegate clickFunction = this.CriteriaButton_Click;
            RenderCriteria(page, Me, this.Criteria);
        }
Exemplo n.º 38
0
        public void RenderAndAttachCustomControl(ref System.Web.UI.WebControls.PlaceHolder ph, XmlDocument moduledoc, XmlDocument node)
        {
            System.Text.StringBuilder             html = new System.Text.StringBuilder();
            Framework.Utilities.ModulesProcessing mp   = new ModulesProcessing();

            foreach (XmlNode module in moduledoc)
            {
                this.Modules = mp.FetchModules(module);

                foreach (Module m in this.Modules)
                {
                    ph.Controls.Add(mp.LoadControl(m.Path, this.MasterPage, node, m.ParamList, this.Namespaces));
                }
                this.Modules = null;
            }
        }
Exemplo n.º 39
0
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。


            //

            this.CheckSession();

            if (this.Session != null)
            {
                this.ViewStateUserKey = Session.SessionID;
            }

            //if (new BusinessHelper().IsLockData() == true)
            //    throw new Exception("数据被锁定,禁止操作。");

            InitializeComponent();

            this.CssHolder = this.FindControl("MyCSS") as System.Web.UI.WebControls.PlaceHolder;

            if (this.CssHolder != null)
            {
                this.SetScript(this.CssHolder, "JS/jquery.min-1.11.1");
                this.SetScript(this.CssHolder, "easyui/jquery.easyui.min");
                this.SetScript(this.CssHolder, "easyui/locale/easyui-lang-zh_CN");


                this.SetScript(this.CssHolder, "JS/CommonActions");
                this.SetScript(this.CssHolder, "JS/DatePicker/WdatePicker");

                this.SetCSS("easyui/themes/bootstrap/easyui");
                this.SetCSS("easyui/themes/icon");
                this.SetCSS("css/Site");
            }

            Response.AddHeader("Pragma", "no-cache");
            Response.AddHeader("cache-control", "no-cache");
            Response.AddHeader("expires", "-1");

            base.OnInit(e);
        }
            //- @InstantiateIn -//
            public void InstantiateIn(System.Web.UI.Control container)
            {
                System.Web.UI.WebControls.PlaceHolder pane = new System.Web.UI.WebControls.PlaceHolder();
                switch (type)
                {
                case ListItemType.Header:
                    pane.Controls.Add(new System.Web.UI.WebControls.Literal {
                        Text = "<div id=\"" + listCssClass + "\">"
                    });
                    break;

                case ListItemType.Item:
                    System.Web.UI.WebControls.Literal literal = new System.Web.UI.WebControls.Literal();
                    literal.DataBinding += new EventHandler(delegate(Object sender, EventArgs ea)
                    {
                        IDataItemContainer item = (IDataItemContainer)container;
                        String url            = DataBinder.Eval(item.DataItem, "Url").ToString();
                        String title          = DataBinder.Eval(item.DataItem, "Title").ToString();
                        Int32 entryCountInt32 = (DataBinder.Eval(item.DataItem, "EntryCount") as Int32?) ?? 0;
                        String entryCount     = entryCountInt32.ToString();
                        String fontStyle      = String.Format("font-size:{0}pt", (Double)(entryCountInt32 * largest) / max < 7 ? 7 : (entryCountInt32 * largest / max));
                        //+
                        literal.Text = @"<span style=""{FontStyle}""><a href=""{Url}"">{Title}</a></span>"
                                       .Replace("{Url}", url)
                                       .Replace("{Title}", title + " ")
                                       .Replace("{EntryCount}", entryCount)
                                       .Replace("{FontStyle}", fontStyle);
                    });
                    container.Controls.Add(literal);
                    pane.Controls.Add(literal);
                    break;

                case ListItemType.Footer:
                    pane.Controls.Add(new System.Web.UI.WebControls.Literal {
                        Text = "</div>"
                    });
                    break;
                }
                //+
                container.Controls.Add(pane);
            }
Exemplo n.º 41
0
        public override void RenderControl()
        {
            page = HttpContext.Current.Handler as BasePage;
            base.RenderControl();

            page.MessageBus.Subscribe <DisplayAlertMessage>(RenderAlert);

            AlertHolder = new PlaceHolder();
            this.ContentPlaceHolder.Controls.Add(AlertHolder);

            if (Me.IncludeValidationSummary)
            {
                ValidationSummary summary = new ValidationSummary();
                summary.HeaderText         = "The following error(s) occurred:";
                summary.DisplayMode        = ValidationSummaryDisplayMode.List;
                summary.EnableClientScript = true;
                summary.CssClass           = "alert alert-danger";

                this.ContentPlaceHolder.Controls.Add(summary);
            }
        }
            //- @InstantiateIn -//
            public void InstantiateIn(System.Web.UI.Control container)
            {
                System.Web.UI.WebControls.PlaceHolder pane = new System.Web.UI.WebControls.PlaceHolder();
                switch (type)
                {
                case ListItemType.Header:
                    pane.Controls.Add(new System.Web.UI.WebControls.Literal {
                        Text = "<ul id=\"" + listCssClass + "\">"
                    });
                    break;

                case ListItemType.Item:
                    System.Web.UI.WebControls.Literal literal = new System.Web.UI.WebControls.Literal();
                    literal.DataBinding += new EventHandler(delegate(Object sender, EventArgs ea)
                    {
                        IDataItemContainer item = (IDataItemContainer)container;
                        String url        = DataBinder.Eval(item.DataItem, "Url").ToString();
                        String title      = DataBinder.Eval(item.DataItem, "Title").ToString();
                        String entryCount = DataBinder.Eval(item.DataItem, "EntryCount").ToString();
                        //+
                        literal.Text = @"<li><a href=""{Url}"">{Title} ({EntryCount})</a></li>"
                                       .Replace("{Url}", url)
                                       .Replace("{Title}", title)
                                       .Replace("{EntryCount}", entryCount);
                    });
                    pane.Controls.Add(literal);
                    break;

                case ListItemType.Footer:
                    pane.Controls.Add(new System.Web.UI.WebControls.Literal {
                        Text = "</ul>"
                    });
                    break;
                }
                //+
                container.Controls.Add(pane);
            }
Exemplo n.º 43
0
 void ShowMessage(System.Web.UI.WebControls.PlaceHolder panel)
 {
     mv1.ActiveViewIndex = 3;
     plSuccess.Visible   = plValidate.Visible = plValidateError.Visible = plValidateSuccess.Visible = plMessage.Visible = false;
     panel.Visible       = true;
 }
Exemplo n.º 44
0
 //+
 //- @InstantiateIn -//
 public void InstantiateIn(System.Web.UI.Control container)
 {
     System.Web.UI.WebControls.PlaceHolder pane = new System.Web.UI.WebControls.PlaceHolder();
     switch (type)
     {
     case ListItemType.Item:
         pane.DataBinding += new EventHandler(delegate(Object sender, System.EventArgs ea)
         {
             RepeaterItem item = (RepeaterItem)pane.NamingContainer;
             //+
             System.Web.UI.WebControls.Literal dtHeader = new System.Web.UI.WebControls.Literal();
             dtHeader.Text = "<dl class=\"index-section-list\"><dt>";
             pane.Controls.Add(dtHeader);
             //+
             System.Web.UI.WebControls.Literal image = new System.Web.UI.WebControls.Literal();
             Themelia.Template template  = new Themelia.Template(Themelia.Template.Common.Image);
             Themelia.Map map            = new Themelia.Map();
             BlogEntryType blogEntryType = FindBlogEntryType((String)DataBinder.Eval(item.DataItem, "TypeGuid"));
             if (blogEntryType != null && !String.IsNullOrEmpty(blogEntryType.Extra))
             {
                 map.Add("Source", blogEntryType.Extra);
                 map.Add("Text", blogEntryType.Name);
                 image.Text = template.Interpolate(map);
                 pane.Controls.Add(image);
             }
             //+
             System.Web.UI.WebControls.Literal dtddConnection = new System.Web.UI.WebControls.Literal();
             dtddConnection.Text = "</dt><dd>";
             pane.Controls.Add(dtddConnection);
             //+
             System.Web.UI.WebControls.Literal link = new System.Web.UI.WebControls.Literal();
             template = new Themelia.Template(Themelia.Template.Common.Link);
             map      = new Themelia.Map();
             map.Add("Link", (String)DataBinder.Eval(item.DataItem, "Url"));
             map.Add("Text", (String)DataBinder.Eval(item.DataItem, "Title"));
             link.Text = template.Interpolate(map);
             pane.Controls.Add(link);
             //+
             List <Minima.Service.Label> labelList = (List <Minima.Service.Label>)DataBinder.Eval(item.DataItem, "LabelList");
             if (labelList != null && labelList.Count > 0)
             {
                 Repeater rptLabel   = new Repeater();
                 rptLabel.DataSource = labelList.Select(label => new
                 {
                     Title = label.Title,
                     Url   = LabelHelper.GetLabelUrl(label)
                 });
                 rptLabel.HeaderTemplate = new IndexLabelListTemplate(ListItemType.Header);
                 rptLabel.ItemTemplate   = new IndexLabelListTemplate(ListItemType.Item);
                 rptLabel.FooterTemplate = new IndexLabelListTemplate(ListItemType.Footer);
                 pane.Controls.Add(rptLabel);
             }
             //+
             System.Web.UI.WebControls.Literal ddFooter = new System.Web.UI.WebControls.Literal();
             ddFooter.Text = "</dd></dl>";
             pane.Controls.Add(ddFooter);
         });
         break;
     }
     container.Controls.Add(pane);
 }