public static void ClearNotificationMsgList(BulletedList notificationMsgList) { if (notificationMsgList.Items.Count > 0) { notificationMsgList.Items.Clear(); } }
/// <summary>See <see cref="Control.CreateChildControls"/>.</summary> protected override void CreateChildControls() { base.CreateChildControls(); navigationList = new System.Web.UI.WebControls.BulletedList(); navigationList.ID = "navigationList"; NextPanel.Controls.Add(navigationList); }
private void CreateSummary(string firstName, string lastName, string facultyNumber, string university, string speciality, List<string> courses) { this.Registration.Visible = false; Panel panel = new Panel(); panel.ID = "Summary"; panel.Controls.Add(new LiteralControl("<h3>Summary:</h3>")); panel.Controls.Add(new Label { Text = "First Name: " }); panel.Controls.Add(new Label { Text = firstName, CssClass = "float-right" }); panel.Controls.Add(new LiteralControl("<br />")); panel.Controls.Add(new Label { Text = "Last Name: " }); panel.Controls.Add(new Label { Text = lastName, CssClass = "float-right" }); panel.Controls.Add(new LiteralControl("<br />")); panel.Controls.Add(new Label { Text = "Faculty Number: " }); panel.Controls.Add(new Label { Text = facultyNumber, CssClass = "float-right" }); panel.Controls.Add(new LiteralControl("<br />")); panel.Controls.Add(new Label { Text = "University: " }); panel.Controls.Add(new Label { Text = university, CssClass = "float-right" }); panel.Controls.Add(new LiteralControl("<br />")); panel.Controls.Add(new Label { Text = "Speciality: " }); panel.Controls.Add(new Label { Text = speciality, CssClass = "float-right" }); panel.Controls.Add(new LiteralControl("<br />")); panel.Controls.Add(new Label { Text = "Courses: " }); panel.Controls.Add(new LiteralControl("<br />")); BulletedList ul = new BulletedList(); foreach (var course in courses) { ul.Items.Add(new ListItem(course)); } panel.Controls.Add(ul); this.formMain.Controls.Add(panel); }
public static void AppendNotificationMsg(string notificationMsg, BulletedList notificationMsgList) { if (string.IsNullOrEmpty(notificationMsg) == false) { ListItem item = new ListItem(notificationMsg); notificationMsgList.Items.Add(item); } }
private static void TranslateBulletedList(System.Web.UI.WebControls.BulletedList obj) { if (obj != null) { obj.ToolTip = TagReplace(obj.ToolTip); for (int i = 0; i < obj.Items.Count; i++) { obj.Items[i].Text = TagReplace(obj.Items[i].Text); } } }
private void ShowMessage(UserMessage userMessage) { ltlTitle.Text = userMessage.Title; if (userMessage.Messages.Count == 1) { ltlMsg.Text = userMessage.Messages[0].Text; return; } var msgList = new BulletedList(); foreach (UserMessageItem msg in userMessage.Messages) { var listItem = new ListItem(msg.Text); msgList.Items.Add(listItem); } plhMsgs.Controls.Add(msgList); }
private void DisplaySingleRezeptabteilung(ICollection<RezeptZutat> rezeptZutatsForSingleRezeptabteilung) { if (rezeptZutatsForSingleRezeptabteilung.Count == 0) return; //Rezeptabteilung var rezeptAbteilung = rezeptZutatsForSingleRezeptabteilung.First().Rezeptabteilung; if (rezeptAbteilung != null && rezeptAbteilung.Name != String.Empty) { Literal litRezeptAbteilungName = new Literal(); this.Panel_Rezeptabteilungen.Controls.Add(litRezeptAbteilungName); litRezeptAbteilungName.Text = rezeptAbteilung.Name; } //Zutaten List ListItem item = null; BulletedList bulletedListZutaten = new BulletedList(); foreach (var rZut in rezeptZutatsForSingleRezeptabteilung) { item = new ListItem(); StringBuilder sb = new StringBuilder(); if (rZut.Menge != null) { sb.Append(rZut.Menge); } sb.Append(" "); //Einheit is optional if (rZut.Einheit != null) sb.Append(rZut.Einheit.Bezeichnung); else sb.Append(string.Empty); sb.Append(" "); sb.Append(rZut.Zutat.Name); item.Text = sb.ToString(); bulletedListZutaten.Items.Add(item); } Panel_Rezeptabteilungen.Controls.Add(bulletedListZutaten); }
/// <summary> /// Pentru a afisa in tabul 'Facilitati' al unitatii toate facilitatile acesteia, creem un bulleted list pe care o populam cu numele acestor facilitati. /// </summary> /// <param name="idUnitate">id-ul unitatii curente</param> private void PopulateFacilitati(int idUnitate) { string[] facilitati = client.GetFacilitatiPtUnitate(numeUnitate); BulletedList lists = new BulletedList(); lists.DataSource = facilitati; lists.DataBind(); facilitatiUnitate.Controls.Add(lists); facilitatiUnitate.Controls.Add(new LiteralControl("<br/>")); }
public static void _PostBackEvent (Page p) { BulletedList list = new BulletedList (); list.ID = "BL"; list.DisplayMode = BulletedListDisplayMode.LinkButton; list.Items.Add (new ListItem ("Test_Item", "Test_Value", true)); list.Click += new BulletedListEventHandler (list_Click); p.Controls.Add (list); }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls( this, Controls ); _bulletedList = new BulletedList(); _bulletedList.ID = this.ID; Controls.Add( _bulletedList ); }
public static void HideNotificationMsgList(BulletedList notificationMsgList) { notificationMsgList.Visible = false; }
public static bool ProcessRepairPrices(string sparePartsPriceTxt, string repairPriceTxt, BulletedList notificationMsgList, out decimal sparePartsPrice, out decimal repairPrice) { sparePartsPrice = 0M; repairPrice = 0M; bool validPrices = ValidatePrices(sparePartsPriceTxt, repairPriceTxt, out sparePartsPrice, out repairPrice); if (validPrices == false) { CarServicePresentationUtility.AppendNotificationMsg("Repair price should be larger than or equal to spare parts price", notificationMsgList); } return validPrices; }
public static bool IsSparePartItemsValid(ListItemCollection selectedSparePartItems, BulletedList notificationMsgList) { bool validSpareParts = (selectedSparePartItems.Count > 0); if (validSpareParts == false) { CarServicePresentationUtility.AppendNotificationMsg("Spare parts are not selected", notificationMsgList); } return validSpareParts; }
private void AddTab(int index, BulletedList tabList, List<ITab> tabsContentList) { ListItem listItem = new ListItem(_tabs[index].TabTitle); listItem.Attributes.Add("tabIndexNumber", index.ToString()); listItem.Attributes.Add("onclick", "showTabIndex('" + ClientID + "','" + _tabEventProcessor.UniqueID + "'," + index.ToString() + ",'" + _selectedTabCssClass + "','" + _tabCssClass + "')"); tabList.Items.Add(listItem); if (SelectedIndex == index) listItem.Attributes.Add("class", _selectedTabCssClass); else listItem.Attributes.Add("class", _tabCssClass); _tabs[index].TabIndexNumber = index; tabsContentList.Add(_tabs[index]); }
protected override void CreateChildControls() { Controls.Clear(); 树状视图 = new TreeView(); 树状视图.ID = "树状视图"; 树状视图.ExpandDepth = 1; 树状视图.EnableViewState = true; 树状视图.SelectedNodeStyle.ForeColor = Color.OrangeRed; 树状视图.NodeStyle.ForeColor = Color.DarkSlateGray; 树状视图.SelectedNodeStyle.Font.Bold = true; 树状视图.ShowCheckBoxes = TreeNodeTypes.Leaf | TreeNodeTypes.Parent; 树状视图.TreeNodeCheckChanged -= new TreeNodeEventHandler(树状视图_TreeNodeCheckChanged); 树状视图.SelectedNodeChanged -= new EventHandler(树状视图_SelectedNodeChanged); 树状视图.TreeNodeCheckChanged += new TreeNodeEventHandler(树状视图_TreeNodeCheckChanged); 树状视图.SelectedNodeChanged += new EventHandler(树状视图_SelectedNodeChanged); 树状视图.Attributes.Add("onclick", "postBackByObject()"); this.Controls.Add(树状视图); 删除按钮 = new Button(); 删除按钮.ID = "删除按钮"; 删除按钮.Text = "删除"; 删除按钮.Click -= new EventHandler(删除按钮_Click); 删除按钮.Click += new EventHandler(删除按钮_Click); 删除按钮.添加确认对话框("确定要删除所有勾选项吗?"); this.Controls.Add(删除按钮); 复制按钮 = new Button(); 复制按钮.ID = "复制按钮"; 复制按钮.Text = "复制"; 复制按钮.Click -= new EventHandler(复制按钮_Click); 复制按钮.Click += new EventHandler(复制按钮_Click); 复制按钮.添加确认对话框("确定要复制所有勾选项到选定目录吗?(同路径文件将被覆盖)"); this.Controls.Add(复制按钮); 移动按钮 = new Button(); 移动按钮.ID = "移动按钮"; 移动按钮.Text = "移动"; 移动按钮.Click -= new EventHandler(移动按钮_Click); 移动按钮.Click += new EventHandler(移动按钮_Click); 移动按钮.添加确认对话框("确定要移动所有勾选项到选定目录吗?(同路径文件将被覆盖)"); this.Controls.Add(移动按钮); 重命名标签 = new Label(); 重命名标签.ID = "重命名标签"; 重命名标签.Text = "重命名:"; this.Controls.Add(重命名标签); 重命名文本框 = new TextBox(); 重命名文本框.ID = "重命名文本框"; this.Controls.Add(重命名文本框); 重命名按钮 = new Button(); 重命名按钮.ID = "重命名按钮"; 重命名按钮.Text = "确定"; 重命名按钮.Click -= new EventHandler(重命名按钮_Click); 重命名按钮.Click += new EventHandler(重命名按钮_Click); this.Controls.Add(重命名按钮); 新建目录标签 = new Label(); 新建目录标签.ID = "新建目录标签"; 新建目录标签.Text = "新建目录:"; this.Controls.Add(新建目录标签); 新建目录文本框 = new TextBox(); 新建目录文本框.ID = "新建目录文本框"; 新建目录文本框.Text = "新建文件夹"; this.Controls.Add(新建目录文本框); 新建目录按钮 = new Button(); 新建目录按钮.ID = "新建目录按钮"; 新建目录按钮.Text = "确定"; 新建目录按钮.Click -= new EventHandler(新建目录按钮_Click); 新建目录按钮.Click += new EventHandler(新建目录按钮_Click); this.Controls.Add(新建目录按钮); 消息记录列表 = new BulletedList(); 消息记录列表.ID = "消息记录列表"; this.Controls.Add(消息记录列表); }
private PageView BuildPageViewContents(int cId, int group) { PageView pageView = new PageView(); string strCate = CateParentIDArray(cId); NewsGroupBSO newsGroupBSO = new NewsGroupBSO(); DataTable table = newsGroupBSO.GetNewsGroupByCateAll(strCate, group); DataTable table1 = table.Clone(); DataTable table2 = table.Clone(); if (table.Rows.Count > 0) { for (int i = 0; i < table.Rows.Count; i++) { if (i == 0) table1.ImportRow(table.Rows[i]); else if (i > 0 && i < 10) table2.ImportRow(table.Rows[i]); else break; } DataRow dataRow = table1.Rows[0]; //HtmlTable HtmlTable htmlTable = new HtmlTable(); htmlTable.Style.Value = "tab_Border_doc"; htmlTable.CellPadding = 5; //Khoi tao 1 hang HtmlTableRow htmlRow = new HtmlTableRow(); //Them dieu khien vao Cot thu 1 HtmlTableCell htmlCell = new HtmlTableCell(); htmlCell.VAlign = "top"; htmlCell.Width = "100%"; htmlCell.Align = "justify"; Literal lit_img = new Literal(); if (dataRow["ImageThumb"].ToString() != "") lit_img.Text = @"<a href='" + ResolveUrl("~/") + "News/" + Convert.ToString(group) + "/" + dataRow["NewsGroupID"].ToString() + "/Default.aspx'><img src='" + ResolveUrl("~/") + "Admin/Upload/NewsGroup/NewsGroupThumb/" + dataRow["ImageThumb"].ToString() + "' vspace='1' align='left' border='1' style='border-color:#cdcdcd; margin-right:5px ' width='100'></a>"; else lit_img.Text = ""; HyperLink hyp = new HyperLink(); hyp.Text = dataRow["Title"].ToString(); hyp.NavigateUrl = "~/News/" + Convert.ToString(group) + "/" + dataRow["NewsGroupID"].ToString() + "/Default.aspx"; hyp.CssClass = "tab_title_news"; //Literal liter_br = new Literal(); //liter_br.Text = @"<br/>"; Label liter = new Label(); liter.Text = "<div style='text-align:justify;padding-top:5px;margin-bottom:0px;'>" + dataRow["ShortDescribe"].ToString() + "</div>"; liter.CssClass = "tab_desc_news"; htmlCell.Controls.Add(lit_img); htmlCell.Controls.Add(hyp); // htmlCell.Controls.Add(liter_br); htmlCell.Controls.Add(liter); //Them cot1 vao hang htmlRow.Cells.Add(htmlCell); //Thêm dòng 1 vào bảng htmlTable.Rows.Add(htmlRow); //Them hàng 2 htmlRow = new HtmlTableRow(); //Them dieu khien vao cot 2 htmlCell = new HtmlTableCell(); htmlCell.VAlign = "top"; BulletedList bullet = new BulletedList(); bullet.CssClass = "tab_bullet_link"; bullet.DisplayMode = BulletedListDisplayMode.HyperLink; bullet.BulletStyle = BulletStyle.NotSet; bullet.DataSource = table2; bullet.DataTextField = "Title"; bullet.DataValueField = "NewsGroupID"; bullet.DataBind(); foreach (ListItem items in bullet.Items) { items.Value = "~/News/" + Convert.ToString(group) + "/" + items.Value + "/Default.aspx"; } htmlCell.Controls.Add(bullet); //Them cot 2 vao hang htmlRow.Cells.Add(htmlCell); //Them hang vao bang htmlTable.Rows.Add(htmlRow); //Them bang vao pageview pageView.Controls.Add(htmlTable); } return pageView; }
private void FillListFromSummaryCart(BulletedList list, Cart summaryCart) { foreach (CartSeatGroupItem seatGroup in summaryCart.SeatGroups) { if (seatGroup.SeatsPerPriceTypes.Count == 1) { list.Items.Add(seatGroup.SeatingZoneName + ", " + seatGroup.SeatsPerPriceTypes[0].SeatCount.ToString() + " seat" + (seatGroup.SeatsPerPriceTypes[0].SeatCount > 1 ? "s" : "")); } else { foreach (CartPriceTypeSeats seatsPerPriceType in seatGroup.SeatsPerPriceTypes) { list.Items.Add(seatGroup.SeatingZoneName + ", " + seatsPerPriceType.SeatCount.ToString() + " seat" + (seatsPerPriceType.SeatCount > 1 ? "s" : "") + " (" + seatsPerPriceType.PriceTypeName + ")"); } } } }
protected void Page_Load(object sender, EventArgs e) { Button helloButton = new Button(); // Новый объект кнопки //helloButton.Text = "Say Hello"; // Текст кнопки //helloButton.ID = "helloButton"; // Идентификатор для будущего извлечения //Panel1.Controls.Add(helloButton); // Добавление кнопки на панель //helloButton.Click += HelloButton_Click; //PlaceHolder1.Controls.Add(helloButton); //Label sex = new Label(); //sex.Text = "sex"; //sex.ID = "sex"; //PlaceHolder1.Controls.Add(sex); //RadioButton m = new RadioButton(); //m.Text = "m"; //m.ID = "m"; //m.AutoPostBack = true; //PlaceHolder1.Controls.Add(m); //RadioButton f = new RadioButton(); //f.Text = "f"; //f.ID = "f"; //f.AutoPostBack = true; //PlaceHolder1.Controls.Add(f); //PlaceHolder1.Controls.Add(Span("</br>")); //Button b = new Button(); //b.Text = "Выбрать"; //b.ID = "b"; //PlaceHolder1.Controls.Add(b); //PlaceHolder1.Controls.Add(Span("</br>")); //Label res = new Label(); //res.Text = ""; //res.ID = "res"; //PlaceHolder1.Controls.Add(res); //controlsDictionary = new SortedDictionary<int, Control>(); //controlsDictionary.Add(1, sex); //controlsDictionary.Add(2, m); //controlsDictionary.Add(3, f); //controlsDictionary.Add(4, b); //controlsDictionary.Add(5, res); //m.CheckedChanged += m_CheckedChanged; //f.CheckedChanged += f_CheckedChanged; //b.Click += b_Click; BulletedList MyList = new BulletedList(); MyList.BulletStyle = BulletStyle.Numbered; MyList.Items.Add("Яблоко"); MyList.Items.Add("Груша"); MyList.Items.Add("Слива"); PlaceHolder1.Controls.Add(MyList); }
public static bool ProcessStartRepairDate(string startRepairDateTxt, BulletedList notificationMsgList, out DateTime? startRepairDate) { startRepairDate = null; bool validStartRepairDate = string.IsNullOrEmpty(startRepairDateTxt) == false; if (validStartRepairDate == false) { CarServicePresentationUtility.AppendNotificationMsg("Start repair date is required", notificationMsgList); } else { DateTime startRepairDateValue = DateTime.Now; validStartRepairDate = CarServiceUtility.IsValidDate(startRepairDateTxt, out startRepairDateValue); if (validStartRepairDate == true) { startRepairDate = startRepairDateValue; } else { CarServicePresentationUtility.AppendNotificationMsg("Start repair date is not in valid format", notificationMsgList); } } return validStartRepairDate; }
public static void ShowNotificationMsgList(BulletedList notificationMsgList) { if (notificationMsgList.Items.Count > 0) notificationMsgList.Visible = true; }
protected internal override void OnInit(EventArgs e) { bulletedList = new BulletedList(); Control.Controls.Add(bulletedList); }
protected override void CreateChildControls() { //add event processor in order to fire events _tabEventProcessor.ID = this.ID + "_tep"; Controls.Add(_tabEventProcessor); //adding tabs BulletedList tabList = new BulletedList(); tabList.Attributes.Add("class", _tabPanelCssClass); List<ITab> tabsContentList = new List<ITab>(); for (int index = 0; index < _tabs.Count; index++) AddTab(index, tabList, tabsContentList); Panel tabsHolder = new Panel(); tabsHolder.Controls.Add(tabList); Controls.Add(tabsHolder); //adding tabs content Panel tabsContentHolder = new Panel(); tabsContentHolder.Attributes.Add("class", _tabContentCssClass); for (int index = 0; index < tabsContentList.Count; index++) tabsContentHolder.Controls.Add(tabsContentList[index] as Control); Controls.Add(tabsContentHolder); base.CreateChildControls(); }