public string IsGroupAssigned(string groupId, System.Web.UI.WebControls.Label labelControl) { string isAssigned = "false"; if (groupId != "") { //*************** // Uses TODO 25 * //*************** DataTable dtIsAssigned = myFYPMSDB.GetAssignedFypId(groupId); // Attributes expected to be returned by the query result. var attributeList = new List <string> { "ASSIGNEDFYP" }; // Display the query result if it is valid. if (myHelpers.IsQueryResultValid("TODO 25", dtIsAssigned, attributeList, labelControl)) { if (dtIsAssigned.Rows.Count != 0) { if (dtIsAssigned.Rows[0]["ASSIGNEDFYP"].ToString() != "") { isAssigned = "true"; } } } else // An SQL error occurred. { isAssigned = "SQL_ERROR"; } } return(isAssigned); }
public string GetStudentGroupId(string username, System.Web.UI.WebControls.Label labelControl) { string groupId = "SQL_ERROR"; if (username != "") { //*************** // Uses TODO 24 * //*************** DataTable dtGroup = myFYPMSDB.GetStudentGroupId(username); // Attributes expected to be returned by the query result. var attributeList = new List <string> { "GROUPID" }; // Display the query result if it is valid. if (myHelpers.IsQueryResultValid("TODO 24", dtGroup, attributeList, labelControl)) { if (dtGroup.Rows.Count != 0) // The student is a member of a group. { groupId = dtGroup.Rows[0]["GROUPID"].ToString(); } else // The student is not a member of a group. { groupId = ""; } } } else // There is no username; should not happen! { myHelpers.DisplayMessage(labelControl, "*** Application error in SharedDBAccess\\GetStudentGroupId: Cannot get the logged in username. Please report to 3311rep."); } return(groupId); }
public void Render() { // Set the css class of the tip gallery. this.CssClass = "BoxTip " + this.CssClass; // Create a new label to display the tips. System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label(); // Check if there are tip labels defined. if (this.TipItems.Length > 0) { // Set the text of the first tip as default. lbl.Text = base.LanguageManager.GetText(this.TipItems[0].Trim()); } base.Controls.Add(lbl); Page.ClientScript.RegisterStartupScript( this.GetType(), "InitTipGallery" + this.ID, string.Format( "window.setTimeout(function() {3} TipGalleryNext('{0}', '{1}', [{2}], 0); {4}, {1});", this.ClientID, this.Interval, string.Join(",", this.TipItems.Select(x => "'" + x.Trim() + "'")), "{", "}" ), true ); }
public Control Render(string value = null) { Control result = null; switch (this.Type) { case UserValidationFieldType.Numeric: result = new TextBox() { TextMode = System.Web.UI.WebControls.TextBoxMode.Number, Text = value }; break; case UserValidationFieldType.Text: result = new TextBox() { Text = value }; break; } if (result == null) { result = new System.Web.UI.WebControls.Label(); } result.ID = "ctlUserValidationField" + this.Name; return(result); }
public void MessageBox(String message) { System.Web.UI.WebControls.Label lblMessageBoxForAlert = new System.Web.UI.WebControls.Label(); lblMessageBoxForAlert.ID = "testjavascriptlabelid"; lblMessageBoxForAlert.Text = "<script language='javascript'>" + Environment.NewLine + "window.alert(" + "'" + message + "'" + ");</script>"; Page.Controls.Add(lblMessageBoxForAlert); }
protected void FetchKeyword(string keyword, System.Web.UI.WebControls.Label lblObj) { if (Request.QueryString[keyword] != null) { lblObj.Text = LTP.Common.StringClass.EncodeString(Request.QueryString[keyword].Trim()); } }
public static void ShowWarning(System.Web.UI.WebControls.Label lbl, System.Exception ex) { // Show the original warning exception Exception warn = CException.FindWarning(ex); if (warn != null) { //div.InnerHtml = ""; ShowWarning(lbl, warn.Message); return; } else { string msg = ""; while (ex != null) { msg += "Source: " + ex.Source + LF + "Description: " + ex.Message + LF + LF; ex = ex.InnerException; } lbl.Attributes.Add("class", "WarningOn"); if (lbl.Text.Length > 0) { lbl.Text += " " + msg; } else { lbl.Text += msg; } } }
/// <summary> /// Handles the AfterSubmitPostedData event of the XFormControl. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EPiServer.XForms.WebControls.SaveFormDataEventArgs"/> instance containing the event data.</param> public void XForm_AfterSubmitPostedData(object sender, SaveFormDataEventArgs e) { XFormControl control = (XFormControl)sender; if (control.FormDefinition.PageGuidAfterPost != Guid.Empty) { PermanentContentLinkMap pageMap = PermanentLinkMapStore.Find(control.FormDefinition.PageGuidAfterPost) as PermanentContentLinkMap; if (pageMap != null) { string internalUrl = pageMap.MappedUrl.ToString(); internalUrl = UriSupport.AddLanguageSelection(internalUrl, ContentLanguage.PreferredCulture.Name); UrlBuilder urlBuilder = new UrlBuilder(internalUrl); //Rewrite the url to make sure that it gets the friendly url if such a provider has been configured. Global.UrlRewriteProvider.ConvertToExternal(urlBuilder, null, Encoding.UTF8); //Always cast UrlBuilders to get a correctly encoded url since ToString() is for "human" readability. control.Page.Response.Redirect((string)urlBuilder); return; } } //After the form has been posted we remove the form elements and add a "thank you message". control.Controls.Clear(); Label label = new Label(); label.CssClass = "thankyoumessage"; label.Text = LocalizationService.Current.GetString("/form/postedmessage"); control.Controls.Add(label); }
public Boolean validarArts() { Boolean validado = true; System.Web.UI.WebControls.Label lblCod = new System.Web.UI.WebControls.Label(); System.Web.UI.WebControls.Label lblPre = new System.Web.UI.WebControls.Label(); string cssLbl = "text-success"; //mostrarBoxesArticulos(); //mostrarBoxesPagos(); if (listadoArts.Count > 0) { int total = listadoArts.Count - 1; if (listadoArts[total].codArt == "" || listadoArts[total].codArt == "") { lblCod.Text = "Inserta el codigo de barras"; lblCod.CssClass = cssLbl; codBarras.Controls.Add(lblCod); validado = false; } if (listadoArts[total].precioArt == "" || listadoArts[total].precioArt == "") { lblPre.Text = "Inserta el precio "; lblPre.CssClass = cssLbl; precio.Controls.Add(lblPre); validado = false; } } return(validado); }
public static void Bind( long totalItems_in, System.Web.UI.WebControls.Label lbl_pageSeparator_left_in, System.Web.UI.WebControls.Label lbl_pageSeparator_2_in, System.Web.UI.WebControls.Label lbl_pageSeparator_3_in, System.Web.UI.WebControls.Label lbl_pageSeparator_4_in, System.Web.UI.WebControls.Label lbl_pageSeparator_right_in, System.Web.UI.WebControls.Label lbl_pageSeparator_5_in, System.Web.UI.HtmlControls.HtmlAnchor a_page_1_in, System.Web.UI.HtmlControls.HtmlAnchor a_page_2_in, System.Web.UI.HtmlControls.HtmlAnchor a_page_3_in, System.Web.UI.HtmlControls.HtmlAnchor a_page_4_in, System.Web.UI.HtmlControls.HtmlAnchor a_page_5_in ) { Bind( totalItems_in, ITEMSPERPAGE_DEFAULT, lbl_pageSeparator_left_in, lbl_pageSeparator_2_in, lbl_pageSeparator_3_in, lbl_pageSeparator_4_in, lbl_pageSeparator_right_in, lbl_pageSeparator_5_in, a_page_1_in, a_page_2_in, a_page_3_in, a_page_4_in, a_page_5_in ); }
protected override void AttachChildControls() { this.rptHelps = (ThemedTemplatedRepeater)this.FindControl("rptHelps"); this.pager = (Pager)this.FindControl("pager"); this.lblCategory = (System.Web.UI.WebControls.Label) this.FindControl("lblCategory"); this.lblhelpName = (System.Web.UI.WebControls.Label) this.FindControl("lblhelpName"); this.lblhelpcontent = (System.Web.UI.WebControls.Literal) this.FindControl("lblhelpcontent"); if (!this.Page.IsPostBack) { if (!string.IsNullOrEmpty(this.Page.Request.QueryString["helpid"])) { int helpid = 0; int.TryParse(this.Page.Request.QueryString["helpid"], out helpid); HelpInfo helpInfo = CommentBrowser.GetHelp(helpid); if (helpInfo != null) { HelpCategoryInfo helpCategory = CommentBrowser.GetHelpCategory(helpInfo.CategoryId); PageTitle.AddSiteNameTitle(helpInfo.Title); this.lblCategory.Text = helpCategory.Name; this.lblhelpName.Text = helpInfo.Title; this.lblhelpcontent.Text = helpInfo.Content; } } this.BindList(); } }
public string GetStudentGroupId(string username, System.Web.UI.WebControls.Label labelControl) { string groupId = "SQL_ERROR"; if (username != "") { //*************** // Uses TODO 38 * //*************** DataTable dtGroup = myFYPMSDB.GetStudentGroupId(username); // Attributes expected to be returned by the query result. var attributeList = new List <string> { "GROUPID" }; // Display the query result if it is valid. if (myHelpers.IsQueryResultValid("38", dtGroup, attributeList, labelControl)) { if (dtGroup.Rows.Count != 0) // The student is a member of a group. { groupId = dtGroup.Rows[0]["GROUPID"].ToString(); } else // The student is not a member of a group. { groupId = ""; } } } else // There is no username; should not happen! { myHelpers.ShowMessage(labelControl, "*** Cannot get the username. Please check your database."); } return(groupId); }
//------------------------------------------------------------------- protected void Page_Init(object sender, EventArgs e) { _label = new System.Web.UI.WebControls.Label { ID = ID + "label"}; Controls.Add(_label); _textBox = new System.Web.UI.WebControls.TextBox { ID = ID + "textBox" }; Controls.Add(_textBox); }
public string getGridCellText(System.Web.UI.WebControls.TableCell tc) { string cellText = ""; if (tc.HasControls()) { foreach (System.Web.UI.Control c in tc.Controls) { if (c.GetType() == typeof(System.Web.UI.WebControls.LinkButton)) { System.Web.UI.WebControls.LinkButton lb = c as System.Web.UI.WebControls.LinkButton; cellText = lb.Text.Trim(); } else if (c.GetType() == typeof(System.Web.UI.WebControls.HyperLink)) { System.Web.UI.WebControls.HyperLink h1 = c as System.Web.UI.WebControls.HyperLink; cellText = h1.Text.Trim(); } else if (c.GetType() == typeof(System.Web.UI.WebControls.Label)) { System.Web.UI.WebControls.Label lbl = c as System.Web.UI.WebControls.Label; cellText = lbl.Text.Trim(); } } } else { cellText = tc.Text; } return(cellText); }
private void SetRowValue(System.Web.UI.WebControls.Label status) { switch (status.Text) { case "0": status.Text = "未开始"; break; case "1": status.Text = "进行中"; break; case "2": status.Text = "已完成"; break; case "3": status.Text = "失败"; break; case "4": status.Text = "重试"; break; } }
protected void FetchKeydate(string keyword, System.Web.UI.WebControls.Label lblObj) { if (Request.QueryString[keyword] != null && CheckInput.CheckDateTime(Request.QueryString[keyword].Trim())) { lblObj.Text = Request.QueryString[keyword].Trim(); } }
/// <summary> /// Método para gerar mensagem flutuante na página /// </summary> /// <param name="mensagem">String contendo a mensagem</param> /// <param name="label">Referência ao webcontrol que renderizará a mensagem</param> /// <param name="left">número com posição left da caixa</param> /// <param name="top">número com posição top da caixa</param> /// <param name="className">Classe contendo estilo a ser aplicado na caixa de mensagem. /// Podendo conter entre outros: left, top, background-color e color.</param> protected void ExibirMensagem(String mensagem, System.Web.UI.WebControls.Label label, String left, String top, String className) { StringBuilder buffer = new StringBuilder(); buffer.Append("<div class=\"" + className + "\" style=\"position:absolute; z-index:1; width: 300px; left:" + left + "px; top:" + top + "px; visibility: visible;\" id=\"resposta\">\n"); buffer.Append(" <table border=\"0\">\n"); buffer.Append(" <tr>"); buffer.Append(" <td align=\"center\"></td>\n"); buffer.Append(" </tr>"); buffer.Append(" <tr>"); buffer.Append(" <td align=\"center\">" + mensagem + "</td>\n"); buffer.Append(" </tr>\n"); buffer.Append(" <tr>\n"); buffer.Append(" <td align=\"center\"></td>\n"); buffer.Append(" </tr>\n"); buffer.Append(" <tr>\n"); buffer.Append(" <td align=\"center\"><a href=\"#\" onclick=\"document.getElementById('resposta').style.visibility='hidden'\">Fechar</a></td>\n"); buffer.Append(" </tr>\n"); buffer.Append(" </table>\n"); buffer.Append("</div>\n"); label.Text = buffer.ToString(); label.Visible = true; label.Enabled = true; label.EnableViewState = false; }
//计划下线 protected void btn_offLine_Click(object sender, EventArgs e) { try { if (Grid1.SelectedRowIndexArray.Length < 1) { Alert.Show("没有选中任何行!"); return; } int pId = 0; int[] selections = Grid1.SelectedRowIndexArray; foreach (int rowIndex in selections) { GridRow row = Grid1.Rows[rowIndex]; System.Web.UI.WebControls.Label lineStatus = (System.Web.UI.WebControls.Label)row.FindControl("Label2"); if (lineStatus.Text == "上线") { pId = Convert.ToInt32(Grid1.DataKeys[rowIndex][0]); string sqlCmd = "update PLM_Product_OnLine set OnlineStatus=0,endTime='" + DateTime.Now + "' where id='" + pId + "'"; SqlSel.ExeSql(sqlCmd); } } Alert.Show("已下线!"); bindGrid(RadioButtonList1.SelectedValue, ddl_line.SelectedValue); } catch (Exception ex) { Alert.ShowInTop(ex.Message); return; } }
protected void Page_Init() { this.EnsureChildControls(); this._email = (System.Web.UI.HtmlControls.HtmlInputText) this.SharpUI.FindControl("email"); this._name = (System.Web.UI.HtmlControls.HtmlInputText) this.SharpUI.FindControl("name"); this._addressbook_entry_title = (System.Web.UI.WebControls.Label) this.SharpUI.FindControl("addressbookEntryTitle"); this._entry = Request.QueryString["addr"]; this._book_name = Request.QueryString["book"]; if (this._entry != null && this._book_name != null && this._entry.Length > 0 && this._book_name.Length > 0) { this._update = true; } else { this._update = false; } System.Web.UI.WebControls.RegularExpressionValidator emailvalidator = (System.Web.UI.WebControls.RegularExpressionValidator) this.SharpUI.FindControl("REEmailValidator"); emailvalidator.ValidationExpression = "^" + anmar.SharpMimeTools.ABNF.addr_spec + "$"; System.Web.UI.WebControls.Label addrname = (System.Web.UI.WebControls.Label) this.SharpUI.FindControl("addressbookLabelItem"); if (addrname != null) { addrname.Text = this._book_name; } this.SharpUI.nextPageImageButton.Enabled = false; this.SharpUI.prevPageImageButton.Enabled = false; this.SharpUI.refreshPageImageButton.Enabled = false; }
/// <summary> /// /// </summary> /// <param name="pageindex"></param> /// <param name="pagecount"></param> /// <param name="sumNum"></param> private void CreateShuju(string pageindex, string pagecount, string sumNum) { System.Web.UI.WebControls.Label _Label = new System.Web.UI.WebControls.Label(); _Label.ID = "M_$NowPageNum" + _SessionString; _Label.Text = "当前第 " + pageindex + " 页/总共 " + pagecount + " 页" + " 共 " + sumNum + " 条数据"; __HtmlGenericControl.Controls.Add(_Label); }
public Panel RenderControl() { Panel result = new Panel(); System.Web.UI.WebControls.Label lblVariable = new System.Web.UI.WebControls.Label(); lblVariable.Text = this.VariableLabel + ": "; result.Controls.Add(lblVariable); System.Web.UI.WebControls.Label lblCategory = new System.Web.UI.WebControls.Label(); lblCategory.Text = this.Label; result.Controls.Add(lblCategory); Image imgDeleteFilterCategory = new Image(); imgDeleteFilterCategory.Style.Add("cursor", "pointer"); imgDeleteFilterCategory.ID = this.Owner.Identity + this.IdCategory; imgDeleteFilterCategory.ImageUrl = "/Images/Icons/Delete2.png"; //imgDeleteFilterCategory.Click += imgDeleteFilterCategory_Click; imgDeleteFilterCategory.Attributes.Add("onclick", string.Format( "DeleteFilterCategory('{0}', '{1}', '{2}')", this.Owner.FileName, this.Owner.XmlNode.GetXPath(), this.IdCategory )); result.Controls.Add(imgDeleteFilterCategory); return(result); }
public Boolean validarGeneral() { Boolean validado = true; string tbFecha = TextBoxFecha.Text; string tbCorre = TextBoxCorrelativo.Text; string tbSerie = TextBoxSerie.Text; string tbCliente = TextBoxCliente.Text; string tbDoc = DropDownListTipoDoc.SelectedValue; string tbMonTotal = TextBoxMontoTotal.Text; string cssLbl = "text-success"; System.Web.UI.WebControls.Label lblFecha = new System.Web.UI.WebControls.Label(); System.Web.UI.WebControls.Label lblCorre = new System.Web.UI.WebControls.Label(); System.Web.UI.WebControls.Label lblSerie = new System.Web.UI.WebControls.Label(); System.Web.UI.WebControls.Label lblCliente = new System.Web.UI.WebControls.Label(); System.Web.UI.WebControls.Label lblMonto = new System.Web.UI.WebControls.Label(); if (tbFecha == "") { lblFecha.Text = "Seleccione la fecha "; lblFecha.CssClass = cssLbl; Div_Fecha.Controls.Add(lblFecha); validado = false; } if (tbCorre == "") { lblCorre.Text = "Inserte el folio Correlativo "; lblCorre.CssClass = cssLbl; Div_Correlativo.Controls.Add(lblCorre); validado = false; } if (tbSerie == "") { lblSerie.Text = "Inserte la Serie "; lblSerie.CssClass = cssLbl; Div_Serie.Controls.Add(lblSerie); validado = false; } if (tbCliente == "") { lblCliente.Text = "Inserte nombre del cliente"; lblCliente.CssClass = cssLbl; Div_Cliente.Controls.Add(lblCliente); validado = false; } if (tbMonTotal == "") { lblMonto.Text = "Inserta el monto total"; lblMonto.CssClass = cssLbl; Div_MontoTotal.Controls.Add(lblMonto); validado = false; } return(validado); }
protected void FetchKeyword(string keyword, System.Web.UI.WebControls.Label lblObj, System.Web.UI.HtmlControls.HtmlInputText txtObj) { if (Request.QueryString[keyword] != null) { lblObj.Text = StringClass.EncodeString(Request.QueryString[keyword].Trim()); txtObj.Value = lblObj.Text; } }
protected void FetchKeyID(string keyword, System.Web.UI.WebControls.Label lblObj, System.Web.UI.WebControls.DropDownList dropObj) { if (Request.QueryString[keyword] != null && CheckInput.CheckDigit(Request.QueryString[keyword].Trim())) { lblObj.Text = Request.QueryString[keyword].Trim(); dropObj.SelectedValue = lblObj.Text; } }
protected void FetchKeyword(string keyword, System.Web.UI.WebControls.Label lblObj, System.Web.UI.WebControls.DropDownList dropObj) { if (Request.QueryString[keyword] != null) { lblObj.Text = StringClass.EncodeString(Request.QueryString[keyword].Trim()); dropObj.SelectedValue = lblObj.Text; } }
protected void FetchKeyNumber(string keyword, System.Web.UI.WebControls.Label lblObj, System.Web.UI.WebControls.TextBox txtObj) { if (Request.QueryString[keyword] != null && CheckInput.CheckNumber(Request.QueryString[keyword].Trim())) { lblObj.Text = Request.QueryString[keyword].Trim(); txtObj.Text = lblObj.Text; } }
public static System.Web.UI.WebControls.Label ReturnErrorLabel(string message) { System.Web.UI.WebControls.Label label = new System.Web.UI.WebControls.Label(); label.Text = message; label.ForeColor = System.Drawing.Color.Red; label.ID = "lblErrorMessage"; return(label); }
public ConfirmBox() { this.Visible = false; this.Dragable = true; this.Label = new System.Web.UI.WebControls.Label(); this.Load += new EventHandler(ConfirmBox_Load); }
public void msgbox(string strMessage) { string strScript = "<script language=JavaScript>"; strScript += "window.alert(\"" + strMessage + "\");"; strScript += "</script>"; System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label(); lbl.Text = strScript; Page.Controls.Add(lbl); }
public void ViewExamPaper(string vStudentId, string vModuleId, string vAttempt, System.Web.UI.WebControls.Panel panelDataView) { try { DatabaseConnection DB = new DatabaseConnection(); DB.openConnection(); string sqlSelectCmd = "SELECT t1.providedAnswer, t2.question, t2.answer01, t2.answer02, t2.answer03, t2.answer04, t2.correctAnswer FROM StudentAnswer AS t1 LEFT JOIN Questions AS t2 ON t1.answeredQuestionId = t2.questionId WHERE answeredStudentId = '" + vStudentId + "' AND answerModuleId = '" + vModuleId + "' AND questionAttempt = '" + vAttempt + "'"; SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlSelectCmd, DatabaseConnection.dbConnection); DataSet DSet = new DataSet(); dataAdapter.Fill(DSet); DB.closeConnection(); int number = 0; foreach (DataTable DT in DSet.Tables) { foreach (DataRow row in DT.Rows) { System.Web.UI.WebControls.Label lblQuestion = new System.Web.UI.WebControls.Label(); lblQuestion.Text = row[1].ToString(); System.Web.UI.WebControls.RadioButtonList rbListQuestion = new System.Web.UI.WebControls.RadioButtonList(); rbListQuestion.Items.Add(row[2].ToString()); rbListQuestion.Items.Add(row[3].ToString()); rbListQuestion.Items.Add(row[4].ToString()); rbListQuestion.Items.Add(row[5].ToString()); rbListQuestion.SelectedIndex = Convert.ToInt32(row[0]) - 1; if (row[0].ToString() != row[6].ToString()) { rbListQuestion.SelectedItem.Attributes.Add("style", "color: red"); } else { rbListQuestion.SelectedItem.Attributes.Add("style", "color: green"); } System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label(); lbl.Text = ((number + 1) + ". ").ToString(); number++; System.Web.UI.WebControls.Label label = new System.Web.UI.WebControls.Label(); label.Text = ""; panelDataView.Controls.Add(lbl); panelDataView.Controls.Add(lblQuestion); panelDataView.Controls.Add(rbListQuestion); panelDataView.Controls.Add(new LiteralControl("<br />")); } } } catch (Exception e) { MessageBox.Show("Error" + e); } }
private void RenderTitlePorletInTable() { System.Web.UI.WebControls.Table tblTop = new System.Web.UI.WebControls.Table(); tblTop.CellPadding = 0; tblTop.CellSpacing = 0; System.Web.UI.WebControls.TableRow rTop = new System.Web.UI.WebControls.TableRow(); tblTop.Rows.Add(rTop); System.Web.UI.WebControls.TableCell cLeft = new System.Web.UI.WebControls.TableCell(); cLeft.Width = System.Web.UI.WebControls.Unit.Percentage(100); cLeft.CssClass = "TitlePortlet"; rTop.Cells.Add(cLeft); System.Web.UI.WebControls.TableCell cRight = new System.Web.UI.WebControls.TableCell(); rTop.Cells.Add(cRight); cRight.Width = System.Web.UI.WebControls.Unit.Pixel(50); cRight.CssClass = "PanelTitlePortlet"; System.Web.UI.WebControls.Panel pnTitle = new System.Web.UI.WebControls.Panel(); pnTitle.Width = System.Web.UI.WebControls.Unit.Percentage(100); System.Web.UI.WebControls.Label lblPortletInfo = new System.Web.UI.WebControls.Label(); lblPortletInfo.Text = string.Format("{0}{1}", Portlet.PortletInstance.Portlet.Name, Portlet.PortletInstance.Name != string.Empty ? "-" + Portlet.PortletInstance.Name : string.Empty); pnTitle.Controls.Add(lblPortletInfo); System.Web.UI.WebControls.Panel pnControlPortlet = new System.Web.UI.WebControls.Panel(); pnControlPortlet.Width = System.Web.UI.WebControls.Unit.Pixel(50); LiteralControl btnDelete = new LiteralControl(); btnDelete.Text = string.Format("<img src='{0}' onclick=\"{1}\" class='{2}' alt='{3}'/>", "/Systems/Engine/Images/PortletDelete.png", string.Format("PortletRemove('{0}','{1}');", Portlet.PortletInstance.Id, Portlet.PortletInstance.Name), "ButtonImage", "Remove Portlet"); LiteralControl btnEdit = new LiteralControl(); btnEdit.Text = string.Format("<img src='{0}' onclick=\"{1}\" class='{2}' alt='{3}'/>", "/Systems/Engine/Images/PortletEditData.png", string.Format("PortletEditData('{0}');", Portlet.PortletInstance.Id), "ButtonImage", "Edit Portlet"); LiteralControl btnEditApperance = new LiteralControl(); btnEditApperance.Text = string.Format("<img src='{0}' onclick=\"{1}\" class='{2}' alt='{3}'/>", "/Systems/Engine/Images/PortletEditApperance.png", string.Format("PortletEditCSS('{0}');", Portlet.PortletInstance.Id), "ButtonImage", "Edit Portlet CSS"); if (Portlet.PortletInstance.Portlet.EditURL.Trim() != string.Empty) { pnControlPortlet.Controls.Add(btnEdit); } pnControlPortlet.Controls.Add(btnEditApperance); pnControlPortlet.Controls.Add(btnDelete); _pnTop.ID = string.Format("{0}", "Title"); cLeft.Controls.Add(pnTitle); cRight.Controls.Add(pnControlPortlet); _pnTop.Controls.Add(tblTop); Controls.AddAt(0, _pnTop); }
public DataLoader( string strPath , System.Web.UI.WebControls.TextBox tbStatusParam , System.Web.UI.WebControls.Label lblErrorParam , System.Web.UI.HtmlControls.HtmlGenericControl OpenCSVListParam) { strAppPath = strPath; //Request.PhysicalApplicationPath tbStatus = tbStatusParam; lblError = lblErrorParam; objDB = new DBAccess(); objDB.ErrorLabel = lblErrorParam; Company2SFUtils.OpenCSVList = OpenCSVListParam; }
/// <summary> /// /// </summary> protected void mainInterface( ) { if ( this.readMessageWindowSubjectTextLabel == null ) { this.readMessageWindowCcTextLabel=(System.Web.UI.WebControls.Label )this.SharpUI.FindControl("readMessageWindowCcTextLabel"); this.readMessageWindowDateTextLabel=(System.Web.UI.WebControls.Label )this.SharpUI.FindControl("readMessageWindowDateTextLabel"); this.readMessageWindowFromTextLabel=(System.Web.UI.WebControls.Label )this.SharpUI.FindControl("readMessageWindowFromTextLabel"); this.readMessageWindowSubjectTextLabel=(System.Web.UI.WebControls.Label )this.SharpUI.FindControl("readMessageWindowSubjectTextLabel"); this.readMessageWindowToTextLabel=(System.Web.UI.WebControls.Label )this.SharpUI.FindControl("readMessageWindowToTextLabel"); this.newMessageWindowTitle=(System.Web.UI.WebControls.Label )this.SharpUI.FindControl("newMessageWindowTitle"); this.readMessageWindowBodyTextHolder=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("readMessageWindowBodyTextHolder"); this.readMessageWindowAttachmentsHolder=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("readMessageWindowAttachmentsHolder"); ((System.Web.UI.WebControls.HyperLink)this.SharpUI.FindControl("msgtoolbarHeader")).Attributes.Add ("onclick", "window.open('headers.aspx?msgid=" + Server.UrlEncode(msgid) + "', '_blank', 'menubar=no, toolbar=no, resizable=yes, scrollbars=yes, width=500, height=300')"); } // Disable some things this.SharpUI.nextPageImageButton.Enabled = false; this.SharpUI.prevPageImageButton.Enabled = false; }
protected void Page_Load(object sender, EventArgs e) { _label = new System.Web.UI.WebControls.Label(); Controls.Add(_label); }
private void RenderErrorPage(Bobs.SpottedException spottedEx) { HttpResponse resp = HttpContext.Current.Response; resp.Clear(); resp.StatusCode = 500; System.Web.UI.WebControls.Literal openPage = new System.Web.UI.WebControls.Literal(); openPage.Text = @" <html><head><style> .{ font-family: Verdana; font-size:12px; font-weight:bold; } p{ font-family: Verdana; font-size:12px; font-weight:bold; margin-bottom:3px; margin-top:3px; line-height:130%; } a:link, a:visited { color:#000000; } a:hover { color:#FF0000; } </style></head><body> <br> <center> <table width=""400"" cellpadding=""0"" cellspacing=""0"" border=""0""> <tr> <td valign=bottom align=left width=""100%"" rowspan=""2""> <center> <a href=""/""><img src=""/gfx/dsi-sign-100.png"" border=0 style=""border:1px solid #000000;""></a> </center> <div style=""padding:10px;""> <div style=""width:100%;border:solid 1px #000000;padding:2px 4px 2px 4px; margin:0px 0px 13px 0px;""> "; System.Web.UI.WebControls.Literal closePage = new System.Web.UI.WebControls.Literal(); closePage.Text = @" </div> </td></tr></table> </center></body></html>"; System.Web.UI.WebControls.Label exceptionLabel = new System.Web.UI.WebControls.Label(); exceptionLabel.Text = "<p>"; if (spottedEx != null && spottedEx.ExceptionType == typeof(Bobs.MalformedUrlException).ToString()) { exceptionLabel.Text += "Page not found."; } else if (spottedEx != null && (Bobs.Usr.Current != null && Bobs.Usr.Current.IsAdmin || HttpContext.Current.Request.UserHostAddress.StartsWith("84.45.14.") || HttpContext.Current.Request.UserHostAddress.StartsWith("192.168.113.") || HttpContext.Current.Request.UserHostAddress.Equals("127.0.0.1"))) { exceptionLabel.Text += spottedEx.Message + "</p><p>" + spottedEx.StackTrace; } else if (spottedEx != null && (spottedEx.ShowMessageToUsrs)) { exceptionLabel.Text += spottedEx.Message; } else { exceptionLabel.Text += "An error has occurred."; } exceptionLabel.Text += "</p><p><br></p><p>If this problem persists, you may wish to report this to an Admin"; if (spottedEx != null && spottedEx.K > 0) exceptionLabel.Text += ", quoting error #" + spottedEx.K; exceptionLabel.Text += ".</p>"; System.Web.UI.WebControls.Button retryButton = new System.Web.UI.WebControls.Button(); retryButton.Text = "Retry"; retryButton.OnClientClick = "location.reload();"; System.Web.UI.WebControls.Button historyBackButton = new System.Web.UI.WebControls.Button(); historyBackButton.Text = "Back"; historyBackButton.OnClientClick = @"history.back();"; System.Web.UI.WebControls.Button homeButton = new System.Web.UI.WebControls.Button(); homeButton.Text = "Home"; homeButton.OnClientClick = @"location = ""/"";"; System.IO.StringWriter stringWriter = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(stringWriter); openPage.RenderControl(htmlWriter); exceptionLabel.RenderControl(htmlWriter); htmlWriter.RenderBeginTag("center"); retryButton.RenderControl(htmlWriter); historyBackButton.RenderControl(htmlWriter); homeButton.RenderControl(htmlWriter); htmlWriter.RenderEndTag(); closePage.RenderControl(htmlWriter); resp.Write(stringWriter.ToString()); }
private void decodeMessage( anmar.SharpMimeTools.SharpMimeMessage mm, System.Web.UI.WebControls.PlaceHolder entity ) { System.String inline = System.String.Empty; switch ( mm.Header.TopLevelMediaType ) { case anmar.SharpMimeTools.MimeTopLevelMediaType.multipart: case anmar.SharpMimeTools.MimeTopLevelMediaType.message: // TODO: allow other subtypes of "message" // Only message/rfc822 allowed, other subtypes ignored if ( mm.Header.TopLevelMediaType.Equals(anmar.SharpMimeTools.MimeTopLevelMediaType.message) && !mm.Header.SubType.Equals("rfc822") ) break; if ( mm.Header.SubType.Equals ("alternative") ) { if ( mm.PartsCount>0 ) { this.decodeMessage ( mm.GetPart(mm.PartsCount-1), entity); } // TODO: Take into account each subtype of "multipart" } else if ( mm.PartsCount>0 ) { System.Web.UI.WebControls.PlaceHolder nestedentity = new System.Web.UI.WebControls.PlaceHolder (); System.Collections.IEnumerator enu = mm.GetEnumerator(); while ( enu.MoveNext() ) { this.decodeMessage ((anmar.SharpMimeTools.SharpMimeMessage) enu.Current, nestedentity); } entity.Controls.Add (nestedentity); } break; case anmar.SharpMimeTools.MimeTopLevelMediaType.text: if ( ( mm.Disposition==null || !mm.Disposition.Equals("attachment") ) && ( mm.Header.SubType.Equals("plain") || mm.Header.SubType.Equals("html") ) ) { System.Web.UI.WebControls.Label label = new System.Web.UI.WebControls.Label (); label.Text = mm.BodyDecoded; if ( mm.IsTextBrowserDisplay ) { label.Text = System.Web.HttpUtility.HtmlEncode (label.Text); label.Text = label.Text.Insert (0, "<pre id=\"message\">"); label.Text = label.Text.Insert (label.Text.Length, "</pre>"); } else { label.CssClass = "XPFormText"; if ( (int)Application["sharpwebmail/read/message/sanitizer_mode"]==1 ) { label.Text = anmar.SharpWebMail.BasicSanitizer.SanitizeHTML(label.Text, anmar.SharpWebMail.SanitizerMode.CommentBlocks|anmar.SharpWebMail.SanitizerMode.RemoveEvents); } } entity.Controls.Add (label); break; } else { goto case anmar.SharpMimeTools.MimeTopLevelMediaType.application; } case anmar.SharpMimeTools.MimeTopLevelMediaType.application: case anmar.SharpMimeTools.MimeTopLevelMediaType.audio: case anmar.SharpMimeTools.MimeTopLevelMediaType.image: case anmar.SharpMimeTools.MimeTopLevelMediaType.video: System.Web.UI.WebControls.HyperLink attachment = new System.Web.UI.WebControls.HyperLink (); System.Web.UI.WebControls.Image image = null; attachment.CssClass = "XPDownload"; if ( mm.Name!=null ) attachment.Text = System.String.Format ("{0} ({1} bytes)", System.IO.Path.GetFileName(mm.Name), mm.Size); if ( Session["sharpwebmail/read/message/temppath"]!=null ) { System.String path = Session["sharpwebmail/read/message/temppath"].ToString(); path = System.IO.Path.Combine (path, msgid); // Dump file contents System.IO.FileInfo file = mm.DumpBody ( path, true ); if ( file!=null && file.Exists ) { System.String urlstring = System.String.Format("download.aspx?msgid={0}&name={1}&i={2}", Server.UrlEncode(msgid), Server.UrlEncode(file.Name), inline); if ( mm.Disposition!=null && mm.Disposition.Equals("inline") ) { inline = "1"; if ( mm.Header.TopLevelMediaType.Equals(anmar.SharpMimeTools.MimeTopLevelMediaType.image) && ( mm.Header.SubType.Equals("gif") || mm.Header.SubType.Equals("jpg") || mm.Header.SubType.Equals("png")) ) { image = new System.Web.UI.WebControls.Image (); image.ImageUrl = urlstring; } } attachment.NavigateUrl = urlstring; attachment.Text = System.String.Format ("{0} ({1} bytes)", file.Name, file.Length); } } this.readMessageWindowAttachmentsHolder.Controls.Add (attachment); // Display inline image if ( image!=null ) { entity.Controls.Add (image); } break; default: break; } }
protected void Page_Init() { this.EnsureChildControls(); this._email=(System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("email"); this._name=(System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("name"); this._addressbook_entry_title=(System.Web.UI.WebControls.Label)this.SharpUI.FindControl("addressbookEntryTitle"); this._entry = Request.QueryString["addr"]; this._book_name = Request.QueryString["book"]; if ( this._entry!=null && this._book_name!=null && this._entry.Length>0 && this._book_name.Length>0 ) this._update = true; else this._update = false; System.Web.UI.WebControls.RegularExpressionValidator emailvalidator=(System.Web.UI.WebControls.RegularExpressionValidator)this.SharpUI.FindControl("REEmailValidator"); emailvalidator.ValidationExpression = "^" + anmar.SharpMimeTools.ABNF.addr_spec + "$"; System.Web.UI.WebControls.Label addrname = (System.Web.UI.WebControls.Label)this.SharpUI.FindControl("addressbookLabelItem"); if ( addrname!=null ) { addrname.Text = this._book_name; } this.SharpUI.nextPageImageButton.Enabled = false; this.SharpUI.prevPageImageButton.Enabled = false; this.SharpUI.refreshPageImageButton.Enabled = false; }
protected void Page_Init() { this.EnsureChildControls(); // Full page things if ( this.AddressBookDataGrid==null && this.SharpUI!=null ) { this.addressbookselect=(System.Web.UI.HtmlControls.HtmlSelect)this.SharpUI.FindControl("addressbookselect"); this.AddressBookDataGrid=(System.Web.UI.WebControls.DataGrid)this.SharpUI.FindControl("AddressBookDataGrid"); this.addressbooklabel=(System.Web.UI.WebControls.Label)this.SharpUI.FindControl("addressbookLabel"); this.SharpUI.nextPageImageButton.Click += new System.Web.UI.ImageClickEventHandler(AddressBookNextPageButton_Click); this.SharpUI.prevPageImageButton.Click += new System.Web.UI.ImageClickEventHandler(AddressBookPrevPageButton_Click); this.SharpUI.refreshPageImageButton.Enabled = false; this.AddressBookDataGrid.PagerStyle.NextPageText = this.SharpUI.LocalizedRS.GetString("inboxNextPage"); this.AddressBookDataGrid.PagerStyle.PrevPageText = this.SharpUI.LocalizedRS.GetString("inboxPrevPage"); } if ( Application["sharpwebmail/send/addressbook"]!=null ) { System.Collections.SortedList addressbooks = (System.Collections.SortedList)Application["sharpwebmail/send/addressbook"]; if ( addressbooks.Count>1 ) { addressbookselect.Visible = true; if ( this.addressbooklabel!=null ) this.addressbooklabel.Visible = true; } addressbookselect.DataSource = addressbooks; addressbookselect.DataTextField = "Key"; addressbookselect.DataValueField = "Key"; addressbookselect.DataBind(); if ( !this.IsPostBack ) { System.String book = Request.QueryString["book"]; if ( book!=null && book.Length>0 ) { addressbookselect.Value = book; } } } }
/// <summary> /// ����¡ ������ /// </summary> /// <param name="Page"></param> /// <param name="lblPage"></param> public Pager(System.Web.UI.Page Page, ref System.Web.UI.WebControls.Label lblPage) { mPage = Page; mlblPage = lblPage; }
// private string m_extractionlayers;// needs to be array // private bool m_inputPolyAllowed; // private string m_jsonServiceLayers = "{}"; public string LoadConfigurator(ESRI.ArcGIS.Server.IServerContext serverContext, System.Collections.Specialized.NameValueCollection ServerObjectProperties, System.Collections.Specialized.NameValueCollection ExtensionProperties, System.Collections.Specialized.NameValueCollection InfoProperties, bool isEnabled, string servicesEndPoint, string serviceName, string serviceTypeName) { logger.LogMessage(ServerLogger.msgType.warning, "SOE manager page", 8000, "SOE Manager page: Loading"); // Just return a message if the SOE is not enabled on the current service. if (!isEnabled) return ("<span>No Properties to configure, sorry</span>"); // Initialize member variables holding the SOE's properties. if (!string.IsNullOrEmpty(ExtensionProperties["FlowAccum"])){ m_flowacc = ExtensionProperties["FlowAccum"]; } if (!string.IsNullOrEmpty(ExtensionProperties["FlowDir"])){ m_flowdir = ExtensionProperties["FlowDir"]; } //if (!(ExtensionProperties["ExtractionLayers"] == null || ExtensionProperties["ExtractionLayers"].Length==0)) //{ // m_extractionlayers = ExtensionProperties["ExtractionLayers"]; // } //Container div and table. System.Web.UI.HtmlControls.HtmlGenericControl propertiesDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("propertiesDiv"); propertiesDiv.Style[System.Web.UI.HtmlTextWriterStyle.Padding] = "10px"; System.Web.UI.HtmlControls.HtmlTable table = new System.Web.UI.HtmlControls.HtmlTable(); table.CellPadding = table.CellSpacing = 4; propertiesDiv.Controls.Add(table); // Header row. System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow(); table.Rows.Add(row); System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell.ColSpan = 2; System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label(); lbl.Text = "Choose the flow accumulation and flow direction layers."; cell.Controls.Add(lbl); // Flow Acc Layer drop-down row. row = new System.Web.UI.HtmlControls.HtmlTableRow(); table.Rows.Add(row); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); lbl = new System.Web.UI.WebControls.Label(); cell.Controls.Add(lbl); lbl.Text = "Flow Accumulation:"; cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell.Controls.Add(m_FlowAccDropDown); m_FlowAccDropDown.ID = "flowAccDropDown"; // Wire the OnLayerChanged JavaScript function (defined in SupportingJavaScript) to fire when a new layer is selected. m_FlowAccDropDown.Attributes["onchange"] = "ExtensionConfigurator.OnLayerChanged(this);"; // Flow dir layer drop-down row. row = new System.Web.UI.HtmlControls.HtmlTableRow(); table.Rows.Add(row); cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); lbl = new System.Web.UI.WebControls.Label(); cell.Controls.Add(lbl); lbl.Text = "Flow Direction:"; cell = new System.Web.UI.HtmlControls.HtmlTableCell(); row.Cells.Add(cell); cell.Controls.Add(m_FlowDirDropDown); m_FlowDirDropDown.ID = "flowDirDropDown"; // Get the path of the underlying map document and use it to populate the properties drop-downs. string fileName = ServerObjectProperties["FilePath"]; populateDropDowns(serverContext, fileName); // Render and return the HTML for the container div. System.IO.StringWriter stringWriter = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter (stringWriter); propertiesDiv.RenderControl(htmlWriter); string html = stringWriter.ToString(); stringWriter.Close(); return html; }
private void GenAjaxRefValTemplate(String ExtraName) { if (ExtraName == "") { System.Web.UI.WebControls.Label aLabel = new System.Web.UI.WebControls.Label(); aLabel.ID = "l" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; aLabel.ToolTip = FFieldItem.DataField; FContainer.Controls.Add(aLabel); Boolean isFound = false; foreach (System.Web.UI.WebControls.Label bLabel in aLabelList) { if (String.Compare(aLabel.ID, bLabel.ID) == 0) { isFound = true; break; } } if (!isFound) { aLabelList.Add(aLabel); } } else { //AjaxRefVal AjaxTools.AjaxRefVal aAjaxRefVal = new AjaxTools.AjaxRefVal(); aAjaxRefVal.ID = "arv" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; aAjaxRefVal.DataSourceID = FDataSourceID; //if (ExtraName != "F") aAjaxRefVal.BindingValue = FFieldItem.DataField; aAjaxRefVal.Width = 130; if (FFieldItem.RefField != null) { aAjaxRefVal.DataValueField = FFieldItem.RefField.ValueMember; aAjaxRefVal.DataTextField = FFieldItem.RefField.DisplayMember; foreach (RefColumns aColumn in FFieldItem.RefField.LookupColumns) { WebRefColumn RC = new WebRefColumn(); RC.ColumnName = aColumn.Column; RC.HeadText = aColumn.HeaderText; aAjaxRefVal.Columns.Add(RC); } } else { InfoCommand aInfoCommand = new InfoCommand(DatabaseType); //aInfoCommand.Connection = WzdUtils.AllocateConnection(DatabaseName, DatabaseType, true); aInfoCommand.Connection = FConnection; IDbDataAdapter DA = DBUtils.CreateDbDataAdapter(aInfoCommand); DataSet aDataSet = new DataSet(); //SYS_REFVAL aDataSet.Clear(); aInfoCommand.CommandText = String.Format("Select * from SYS_REFVAL where REFVAL_NO = '{0}'", FFieldItem.RefValNo); WzdUtils.FillDataAdapter(FDatabaseType, DA, aDataSet, FFieldItem.RefValNo); aAjaxRefVal.DataValueField = aDataSet.Tables[0].Rows[0]["VALUE_MEMBER"].ToString(); aAjaxRefVal.DataTextField = aDataSet.Tables[0].Rows[0]["DISPLAY_MEMBER"].ToString(); //aWebRefVal.BindingValue = "'<%# + Bind(\"" + FFieldItem.DataField + "\") %>'"; //SYS_REFVSL_D1 --> Columns aDataSet.Clear(); aInfoCommand.CommandText = String.Format("Select * from SYS_REFVAL_D1 where REFVAL_NO = '{0}'", FFieldItem.RefValNo); WzdUtils.FillDataAdapter(FDatabaseType, DA, aDataSet, FFieldItem.RefValNo); foreach (DataRow DR in aDataSet.Tables[0].Rows) { WebRefColumn RC = new WebRefColumn(); RC.ColumnName = DR["FIELD_NAME"].ToString(); RC.HeadText = DR["HEADER_TEXT"].ToString(); aAjaxRefVal.Columns.Add(RC); } } FContainer.Controls.Add(aAjaxRefVal); Boolean Found = false; foreach (AjaxTools.AjaxRefVal bWebRefVal in aAjaxRefValList) { if (String.Compare(bWebRefVal.ID, aAjaxRefVal.ID) == 0) { Found = true; break; } } if (!Found) aAjaxRefValList.Add(aAjaxRefVal); //Add AddNewRowControlItem to WebGridView if (ExtraName == "F") { if (FWebGridView != null) { Found = false; foreach (AddNewRowControlItem aControlItem in FWebGridView.AddNewRowControls) { if (aControlItem.FieldName.CompareTo(FFieldItem.DataField) == 0) { Found = true; break; } } if (!Found) { AddNewRowControlItem aItem = new AddNewRowControlItem(); aItem.ControlID = "arv" + FTableName + FFieldItem.DataField + ExtraName; aItem.ControlType = WebGridView.AddNewRowControlType.RefVal; aItem.FieldName = FFieldItem.DataField; FWebGridView.AddNewRowControls.Add(aItem); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) Initialize(); string[] values = Request.QueryString.GetValues("DocumentID"); if (values == null) return; iDocumentID = System.Convert.ToInt32(values[0]); DAL.ConferenceDataSet.PaperListDataTable dataTableDocument; DAL.ConferenceDataSetTableAdapters.PaperListTableAdapter adapterDocument = new DAL.ConferenceDataSetTableAdapters.PaperListTableAdapter(); dataTableDocument = adapterDocument.GetDataByDocumentID(iDocumentID); System.Web.UI.WebControls.Table table = new System.Web.UI.WebControls.Table(); int iRows = dataTableDocument.Rows.Count; for (int i = 0; i < iRows; i++) { // System.Data.DataRow dataRow = dataTableDocument.Rows[i]; DAL.ConferenceDataSet.PaperListRow dataRow = (DAL.ConferenceDataSet.PaperListRow)dataTableDocument.Rows[i]; // Define a new Web Control Image /*System.Web.UI.WebControls.Image imgCoverImage = new System.Web.UI.WebControls.Image(); imgCoverImage.AlternateText = dr["Title"].ToString(); string strImageUrl = System.String.Format("~/ImageHandler.ashx?id={0}", documentIDParam); imgCoverImage.ImageUrl = strImageUrl; cellImage.Controls.Add(imgCoverImage);*/ // Define a new Web Control Table Row System.Web.UI.WebControls.TableRow tableRow = new System.Web.UI.WebControls.TableRow(); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellDocumentIDLabel = new System.Web.UI.WebControls.TableCell(); tableCellDocumentIDLabel.Style["text-align"] = "right;"; System.Web.UI.WebControls.Label lblDocumentID = new System.Web.UI.WebControls.Label(); lblDocumentID.Text = "DocumentID"; tableCellDocumentIDLabel.Controls.Add(lblDocumentID); tableRow.Cells.Add(tableCellDocumentIDLabel); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellDocumentIDText = new System.Web.UI.WebControls.TableCell(); System.Web.UI.WebControls.TextBox txtDocumentID = new System.Web.UI.WebControls.TextBox(); txtDocumentID.Text = dataRow.DocumentID.ToString(); tableCellDocumentIDText.Controls.Add(txtDocumentID); tableRow.Cells.Add(tableCellDocumentIDText); table.Rows.Add(tableRow); // Define a new Web Control Table Row tableRow = new System.Web.UI.WebControls.TableRow(); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellTitleLabel = new System.Web.UI.WebControls.TableCell(); tableCellTitleLabel.Style["text-align"] = "right;"; System.Web.UI.WebControls.Label lblTitle = new System.Web.UI.WebControls.Label(); lblTitle.Text = "Title"; tableCellTitleLabel.Controls.Add(lblTitle); tableRow.Cells.Add(tableCellTitleLabel); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellTitleText = new System.Web.UI.WebControls.TableCell(); System.Web.UI.WebControls.TextBox txtTitle = new System.Web.UI.WebControls.TextBox(); txtTitle.Text = dataRow.Title.ToString(); tableCellTitleText.Controls.Add(txtTitle); tableRow.Cells.Add(tableCellTitleText); table.Rows.Add(tableRow); // Define a new Web Control Table Row tableRow = new System.Web.UI.WebControls.TableRow(); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellStatusTextEnLabel = new System.Web.UI.WebControls.TableCell(); tableCellStatusTextEnLabel.Style["text-align"] = "right;"; System.Web.UI.WebControls.Label lblStatusTextEn = new System.Web.UI.WebControls.Label(); lblStatusTextEn.Text = "StatusTextEn"; tableCellStatusTextEnLabel.Controls.Add(lblStatusTextEn); tableRow.Cells.Add(tableCellStatusTextEnLabel); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellStatusTextEnText = new System.Web.UI.WebControls.TableCell(); System.Web.UI.WebControls.TextBox txtStatusTextEn = new System.Web.UI.WebControls.TextBox(); if (!dataRow.IsStatusTextEnNull()) txtStatusTextEn.Text = dataRow.StatusTextEn.ToString(); else txtStatusTextEn.Text = ""; tableCellStatusTextEnText.Controls.Add(txtStatusTextEn); tableRow.Cells.Add(tableCellStatusTextEnText); table.Rows.Add(tableRow); // Define a new Web Control Table Row tableRow = new System.Web.UI.WebControls.TableRow(); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellFirstNameLabel = new System.Web.UI.WebControls.TableCell(); tableCellFirstNameLabel.Style["text-align"] = "right;"; System.Web.UI.WebControls.Label lblFirstName = new System.Web.UI.WebControls.Label(); lblFirstName.Text = "FirstName"; tableCellFirstNameLabel.Controls.Add(lblFirstName); tableRow.Cells.Add(tableCellFirstNameLabel); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellFirstNameText = new System.Web.UI.WebControls.TableCell(); System.Web.UI.WebControls.TextBox txtFirstName = new System.Web.UI.WebControls.TextBox(); if (!dataRow.IsFirstNameNull()) //if (!String.IsNullOrEmpty(dataRow.FirstName)) txtFirstName.Text = dataRow.FirstName; else txtFirstName.Text = ""; tableCellFirstNameText.Controls.Add(txtFirstName); tableRow.Cells.Add(tableCellFirstNameText); table.Rows.Add(tableRow); // Define a new Web Control Table Row tableRow = new System.Web.UI.WebControls.TableRow(); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellLastNameLabel = new System.Web.UI.WebControls.TableCell(); tableCellLastNameLabel.Style["text-align"] = "right;"; System.Web.UI.WebControls.Label lblLastName = new System.Web.UI.WebControls.Label(); lblLastName.Text = "LastName"; tableCellLastNameLabel.Controls.Add(lblLastName); tableRow.Cells.Add(tableCellLastNameLabel); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellLastNameText = new System.Web.UI.WebControls.TableCell(); System.Web.UI.WebControls.TextBox txtLastName = new System.Web.UI.WebControls.TextBox(); if (!dataRow.IsLastNameNull()) // if (String.IsNullOrEmpty(dataRow.LastName)) txtLastName.Text = dataRow.LastName; else txtLastName.Text = ""; tableCellLastNameText.Controls.Add(txtLastName); tableRow.Cells.Add(tableCellLastNameText); table.Rows.Add(tableRow); // Define a new Web Control Table Row tableRow = new System.Web.UI.WebControls.TableRow(); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellEmailLabel = new System.Web.UI.WebControls.TableCell(); tableCellEmailLabel.Style["text-align"] = "right;"; System.Web.UI.WebControls.Label lblEmail = new System.Web.UI.WebControls.Label(); lblEmail.Text = "Email"; tableCellEmailLabel.Controls.Add(lblEmail); tableRow.Cells.Add(tableCellEmailLabel); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellEmailText = new System.Web.UI.WebControls.TableCell(); System.Web.UI.WebControls.TextBox txtEmail = new System.Web.UI.WebControls.TextBox(); if (!dataRow.IsEmailNull()) // if (String.IsNullOrEmpty(dataRow.Email)) txtEmail.Text = dataRow.Email; else txtEmail.Text = ""; tableCellEmailText.Controls.Add(txtEmail); tableRow.Cells.Add(tableCellEmailText); table.Rows.Add(tableRow); // Define a new Web Control Table Row tableRow = new System.Web.UI.WebControls.TableRow(); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellClientFileNameLabel = new System.Web.UI.WebControls.TableCell(); tableCellClientFileNameLabel.Style["text-align"] = "right;"; System.Web.UI.WebControls.Label lblClientFileName = new System.Web.UI.WebControls.Label(); lblClientFileName.Text = "ClientFileName"; tableCellClientFileNameLabel.Controls.Add(lblClientFileName); tableRow.Cells.Add(tableCellClientFileNameLabel); // Define a new Web Control Table Cell System.Web.UI.WebControls.TableCell tableCellClientFileNameText = new System.Web.UI.WebControls.TableCell(); System.Web.UI.WebControls.TextBox txtClientFileName = new System.Web.UI.WebControls.TextBox(); if (!dataRow.IsClientFileNameNull()) // if (String.IsNullOrEmpty(dataRow.ClientFileName)) txtClientFileName.Text = dataRow.ClientFileName; else txtClientFileName.Text = ""; tableCellClientFileNameText.Controls.Add(txtClientFileName); tableRow.Cells.Add(tableCellClientFileNameText); table.Rows.Add(tableRow); /* System.Web.UI.WebControls.HyperLink hlnkBookName = new System.Web.UI.WebControls.HyperLink(); hlnkBookName.Text = dr["Title"].ToString(); hlnkBookName.NavigateUrl = "~/BookDetails.aspx?pBookID=" + System.Convert.ToString(dr["TitleID"].ToString()); cellProp.Controls.Add(hlnkBookName); cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />")); System.Web.UI.WebControls.Label lblAuthors = new System.Web.UI.WebControls.Label(); lblAuthors.Text = "Authors: "; cellProp.Controls.Add(lblAuthors); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); if (!(dr["Authors"] == null || dr.IsNull("Authors"))) { doc.LoadXml((string)dr["Authors"]); System.Xml.XmlElement root = doc.DocumentElement; // System.Xml.XmlNode root = doc.FirstChild; //Display the contents of the child nodes. if (root.HasChildNodes) for (int iIndex = 0; iIndex < root.ChildNodes.Count; iIndex++) { System.Xml.XmlNode xmlNodeAuthor = root.ChildNodes[iIndex]; System.Xml.XmlElement xmlElementAuthorID = xmlNodeAuthor["AuthorID"]; System.Xml.XmlElement xmlElementAuthorName = xmlNodeAuthor["AuthorName"]; System.Web.UI.WebControls.HyperLink hlnkAuthor = new System.Web.UI.WebControls.HyperLink(); hlnkAuthor.Text = xmlElementAuthorName.InnerText; hlnkAuthor.NavigateUrl = "~/Author.aspx?pAuthorID=" + xmlElementAuthorID.InnerText; cellProp.Controls.Add(hlnkAuthor); cellProp.Controls.Add(new System.Web.UI.LiteralControl(" ")); } } cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />")); System.Web.UI.WebControls.Label lblTrabslator = new System.Web.UI.WebControls.Label(); lblTrabslator.Text = "Translators: "; cellProp.Controls.Add(lblTrabslator); if (!(dr["Translators"] == null || dr.IsNull("Translators"))) { doc.LoadXml((string)dr["Translators"]); System.Xml.XmlElement root = doc.DocumentElement; // System.Xml.XmlNode root = doc.FirstChild; //Display the contents of the child nodes. if (root.HasChildNodes) for (int iIndex = 0; iIndex < root.ChildNodes.Count; iIndex++) { System.Xml.XmlNode xmlNodeAuthor = root.ChildNodes[iIndex]; System.Xml.XmlElement xmlElementAuthorID = xmlNodeAuthor["TranslatorID"]; System.Xml.XmlElement xmlElementAuthorName = xmlNodeAuthor["TranslatorName"]; System.Web.UI.WebControls.HyperLink hlnkAuthor = new System.Web.UI.WebControls.HyperLink(); hlnkAuthor.Text = xmlElementAuthorName.InnerText; hlnkAuthor.NavigateUrl = "~/Author.aspx?pAuthorID=" + xmlElementAuthorID.InnerText; cellProp.Controls.Add(hlnkAuthor); cellProp.Controls.Add(new System.Web.UI.LiteralControl(" ")); } } cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />")); System.Web.UI.WebControls.Label lblPublisher = new System.Web.UI.WebControls.Label(); lblPublisher.Text = "Publisher: " + dr["Publisher"].ToString(); cellProp.Controls.Add(lblPublisher); cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />")); System.Web.UI.WebControls.Label lblPublishedDate = new System.Web.UI.WebControls.Label(); lblPublishedDate.Text = "Published Date: " + dr["PublishedDate"].ToString(); cellProp.Controls.Add(lblPublishedDate); cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />")); System.Web.UI.WebControls.Label lblPrintingTimes = new System.Web.UI.WebControls.Label(); lblPrintingTimes.Text = "PrintingTimes: " + dr["PrintingTimes"].ToString(); cellProp.Controls.Add(lblPrintingTimes); cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />")); System.Web.UI.WebControls.Label lblPages = new System.Web.UI.WebControls.Label(); lblPages.Text = "Pages: " + dr["Pages"].ToString(); cellProp.Controls.Add(lblPages); cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />")); System.Web.UI.WebControls.Label lblDocumentSummary = new System.Web.UI.WebControls.Label(); lblDocumentSummary.Text = "DocumentSummary: " + dr["DocumentSummary"].ToString(); cellProp.Controls.Add(lblDocumentSummary); cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />")); cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />")); System.Web.UI.WebControls.HyperLink hlnkDownload = new System.Web.UI.WebControls.HyperLink(); hlnkDownload.Text = "Download"; if (!(dr["DocumentID"] == null || dr.IsNull("DocumentID"))) { string strDownloadPath = System.String.Format("~/FileDownloadHandler.ashx?FileID={0}", dr["DocumentID"].ToString()); hlnkDownload.NavigateUrl = strDownloadPath; } cellProp.Controls.Add(hlnkDownload); */ tableRow = new System.Web.UI.WebControls.TableRow(); System.Web.UI.WebControls.TableCell tableCellDownloadHyperLink = new System.Web.UI.WebControls.TableCell(); System.Web.UI.WebControls.HyperLink hlnkDownload = new System.Web.UI.WebControls.HyperLink(); hlnkDownload.Text = "Download"; if (/*dataRow.FileID != null &&*/ !dataRow.IsFileIDNull()) { string strDownloadPath = System.String.Format("~/FileDownloadHandler.ashx?FileID={0}", dataRow.FileID.ToString()); hlnkDownload.NavigateUrl = strDownloadPath; } tableCellDownloadHyperLink.Controls.Add(hlnkDownload); tableRow.Cells.Add(tableCellDownloadHyperLink); table.Rows.Add(tableRow); } pnlDocumentDetail.Controls.Add(table); pnlDocumentDetail.Controls.Add(new System.Web.UI.LiteralControl("<br />")); }
/// <summary> /// /// </summary> protected void mainInterface( anmar.SharpWebMail.CTNInbox inbox ) { this.newattachmentPH=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("newattachmentPH"); this.attachmentsPH=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("attachmentsPH"); this.confirmationPH=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("confirmationPH"); this.newMessagePH=(System.Web.UI.WebControls.PlaceHolder )this.SharpUI.FindControl("newMessagePH"); this.newMessageWindowAttachFile=( System.Web.UI.HtmlControls.HtmlInputFile )this.SharpUI.FindControl("newMessageWindowAttachFile"); this.newMessageWindowAttachmentsList=(System.Web.UI.WebControls.CheckBoxList )this.SharpUI.FindControl("newMessageWindowAttachmentsList"); this.newMessageWindowAttachmentsAddedList=(System.Web.UI.WebControls.DataList )this.SharpUI.FindControl("newMessageWindowAttachmentsAddedList"); this.FCKEditor = (FredCK.FCKeditorV2.FCKeditor)this.SharpUI.FindControl("FCKEditor"); this.fromname = (System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("fromname"); this.fromemail = (System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("fromemail"); this.subject = (System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("subject"); this.toemail = (System.Web.UI.HtmlControls.HtmlInputText)this.SharpUI.FindControl("toemail"); #if MONO System.Web.UI.WebControls.RequiredFieldValidator rfv = (System.Web.UI.WebControls.RequiredFieldValidator) this.SharpUI.FindControl("ReqbodyValidator"); rfv.Enabled=false; this.Validators.Remove(rfv); #endif this.newMessageWindowConfirmation = (System.Web.UI.WebControls.Label)this.SharpUI.FindControl("newMessageWindowConfirmation"); this.SharpUI.refreshPageImageButton.Click += new System.Web.UI.ImageClickEventHandler(refreshPageButton_Click); // Disable PlaceHolders this.attachmentsPH.Visible = false; this.confirmationPH.Visible = false; // Disable some things this.SharpUI.nextPageImageButton.Enabled = false; this.SharpUI.prevPageImageButton.Enabled = false; // Get mode if ( Page.Request.QueryString["mode"]!=null ) { try { this._message_mode = (anmar.SharpWebMail.UI.MessageMode)System.Enum.Parse(typeof(anmar.SharpWebMail.UI.MessageMode), Page.Request.QueryString["mode"], true); } catch ( System.Exception ){} } // Get message ID System.String msgid = System.Web.HttpUtility.HtmlEncode (Page.Request.QueryString["msgid"]); System.Guid guid = System.Guid.Empty; if ( msgid!=null ) guid = new System.Guid(msgid); if ( !this.IsPostBack && !guid.Equals( System.Guid.Empty) ) { System.Object[] details = inbox[ guid ]; if ( details!=null ) { if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.None) ) this._message_mode = anmar.SharpWebMail.UI.MessageMode.reply; this._headers = (anmar.SharpMimeTools.SharpMimeHeader) details[13]; if ( !this.IsPostBack ) { bool html_content = this.FCKEditor.CheckBrowserCompatibility(); this.subject.Value = System.String.Concat (this.SharpUI.LocalizedRS.GetString(System.String.Concat(this._message_mode, "Prefix")), ":"); if ( details[10].ToString().ToLower().IndexOf (this.subject.Value.ToLower())!=-1 ) { this.subject.Value = details[10].ToString().Trim(); } else { this.subject.Value = System.String.Concat (this.subject.Value, " ", details[10]).Trim(); } // Get the original message inbox.CurrentFolder = details[18].ToString(); System.IO.MemoryStream ms = inbox.GetMessage((int)details[1], msgid); anmar.SharpMimeTools.SharpMessage message = null; if ( ms!=null && ms.CanRead ) { System.String path = null; if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.forward) ) { path = Session["sharpwebmail/read/message/temppath"].ToString(); path = System.IO.Path.Combine (path, msgid); path = System.IO.Path.GetFullPath(path); } bool attachments = false; if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.forward) ) attachments = (bool)Application["sharpwebmail/send/message/forwardattachments"]; message = new anmar.SharpMimeTools.SharpMessage(ms, attachments, html_content, path); } if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.reply) ) { // From name if present on original message's To header // and we don't have it already if ( Session["DisplayName"]==null ) { foreach ( anmar.SharpMimeTools.SharpMimeAddress address in (System.Collections.IEnumerable) details[8] ) { if ( address["address"]!=null && address["address"].Equals( User.Identity.Name ) && address["name"].Length>0 && !address["address"].Equals(address["name"]) ) { this.fromname.Value = address["name"]; break; } } } // To addresses foreach ( anmar.SharpMimeTools.SharpMimeAddress address in (System.Collections.IEnumerable) details[9] ) { if ( address["address"]!=null && !address["address"].Equals( User.Identity.Name ) ) { if ( this.toemail.Value.Length >0 ) this.toemail.Value += ", "; this.toemail.Value += address["address"]; } } } else if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.forward) ) { // If the original message has attachments, preserve them if ( message!=null && message.Attachments!=null && message.Attachments.Count>0 ) { this.bindAttachments(); foreach ( anmar.SharpMimeTools.SharpAttachment attachment in message.Attachments ) { if ( attachment.SavedFile==null ) continue; this.AttachmentSelect(System.IO.Path.Combine(attachment.SavedFile.Directory.Name, attachment.SavedFile.Name)); } this.Attach_Click(this, null); } } // Preserve the original body and some properties if ( message!=null ) { System.Text.StringBuilder sb_body = new System.Text.StringBuilder(); System.String line_end = null; if ( html_content ) line_end = "<br />\r\n"; else line_end = "\r\n"; sb_body.Append(this.SharpUI.LocalizedRS.GetString(System.String.Concat(this._message_mode, "PrefixBody"))); sb_body.Append(line_end); sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowFromNameLabel")); sb_body.Append(" "); sb_body.Append(message.From); sb_body.Append(" [mailto:"); sb_body.Append(message.FromAddress); sb_body.Append("]"); sb_body.Append(line_end); sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowDateLabel")); sb_body.Append(" "); sb_body.Append(message.Date.ToString()); sb_body.Append(line_end); sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowToEmailLabel")); sb_body.Append(" "); if ( html_content ) sb_body.Append(System.Web.HttpUtility.HtmlEncode(message.To.ToString())); else sb_body.Append(message.To); sb_body.Append(line_end); sb_body.Append(this.SharpUI.LocalizedRS.GetString("newMessageWindowSubjectLabel")); sb_body.Append(" "); sb_body.Append(message.Subject); sb_body.Append(line_end); sb_body.Append(line_end); if ( !message.HasHtmlBody && html_content ) sb_body.Append("<pre>"); sb_body.Append(message.Body); if ( !message.HasHtmlBody && html_content ) sb_body.Append("</pre>"); if ( this._message_mode.Equals(anmar.SharpWebMail.UI.MessageMode.reply) ) { if ( html_content ) { sb_body.Insert(0, System.String.Concat("<blockquote style=\"", Application["sharpwebmail/send/message/replyquotestyle"] ,"\">")); sb_body.Append("</blockquote>"); } else { sb_body.Insert(0, Application["sharpwebmail/send/message/replyquotechar"].ToString()); sb_body.Replace("\n", System.String.Concat("\n", Application["sharpwebmail/send/message/replyquotechar"])); } } sb_body.Insert(0, line_end); sb_body.Insert(0, " "); this.FCKEditor.Value = sb_body.ToString(); } } details = null; } } else if ( !this.IsPostBack ) { System.String to = Page.Request.QueryString["to"]; if ( to!=null && to.Length>0 ) { this.toemail.Value = to; } } if ( this.fromname.Value.Length>0 || this.IsPostBack ) Session["DisplayName"] = this.fromname.Value; if ( this.fromname.Value.Length==0 && Session["DisplayName"]!=null ) this.fromname.Value = Session["DisplayName"].ToString(); if ( this.fromemail.Value.Length>0 || this.IsPostBack ) Session["DisplayEmail"] = this.fromemail.Value; }
private void GenValidateBoxTemplate(String ExtraName) { if (ExtraName == "") { System.Web.UI.WebControls.Label aLabel = new System.Web.UI.WebControls.Label(); aLabel.ID = "l" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; aLabel.ToolTip = FFieldItem.DataField; FContainer.Controls.Add(aLabel); Boolean Found = false; foreach (System.Web.UI.WebControls.Label bLabel in aLabelList) { if (String.Compare(aLabel.ID, bLabel.ID) == 0) { Found = true; break; } } if (!Found) { aLabelList.Add(aLabel); } } else { WebValidateBox aValidateBox = new WebValidateBox(); aValidateBox.ID = "wvb" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; aValidateBox.WebValidateID = aWebValidate.ID; aValidateBox.ValidateField = FFieldItem.DataField; FContainer.Controls.Add(aValidateBox); Boolean Found = false; foreach (WebValidateBox aBox in aWebValidateBoxList) { if (String.Compare(aBox.ID, aValidateBox.ID) == 0) { Found = true; break; } } if (!Found) { aWebValidateBoxList.Add(aValidateBox); } } }
private void GenTextBoxTemplate(String ExtraName) { if (ExtraName == "") { System.Web.UI.WebControls.Label aLabel = new System.Web.UI.WebControls.Label(); aLabel.ID = "l" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; aLabel.ToolTip = FFieldItem.DataField; FContainer.Controls.Add(aLabel); Boolean Found = false; foreach (System.Web.UI.WebControls.Label bLabel in aLabelList) { if (String.Compare(aLabel.ID, bLabel.ID) == 0) { Found = true; break; } } if (!Found) { aLabelList.Add(aLabel); } } else { System.Web.UI.WebControls.TextBox aTextBox = new System.Web.UI.WebControls.TextBox(); aTextBox.ID = "wdtp" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; aTextBox.ToolTip = FFieldItem.DataField; //aPicker.Text = String.Format("'<%# Bind(\"{0}\") %>'", FFieldItem.DataField); FContainer.Controls.Add(aTextBox); Boolean Found = false; foreach (System.Web.UI.WebControls.TextBox bWebPicker in aWebTextBoxList) { if (String.Compare(aTextBox.ID, bWebPicker.ID) == 0) { Found = true; break; } } if (!Found) { aWebTextBoxList.Add(aTextBox); //Add AddNewRowControlItem to WebGridView if (ExtraName == "F") { if (FWebGridView != null) { Found = false; foreach (AddNewRowControlItem aControlItem in FWebGridView.AddNewRowControls) { if (aControlItem.FieldName.CompareTo(FFieldItem.DataField) == 0) { Found = true; break; } } if (!Found) { AddNewRowControlItem aItem = new AddNewRowControlItem(); aItem.ControlID = "wdtp" + FTableName + FFieldItem.DataField + ExtraName; aItem.ControlType = WebGridView.AddNewRowControlType.TextBox; aItem.FieldName = FFieldItem.DataField; FWebGridView.AddNewRowControls.Add(aItem); } } } } } }
private void GenDateTimeTemplate(String ExtraName) { if (ExtraName == "") { System.Web.UI.WebControls.Label aLabel = new System.Web.UI.WebControls.Label(); aLabel.ID = "l" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; aLabel.ToolTip = FFieldItem.DataField; FContainer.Controls.Add(aLabel); Boolean Found = false; foreach (System.Web.UI.WebControls.Label bLabel in aLabelList) { if (String.Compare(aLabel.ID, bLabel.ID) == 0) { Found = true; break; } } if (!Found) { aLabelList.Add(aLabel); } } else { WebDateTimePicker aPicker = new WebDateTimePicker(); aPicker.ID = "wdtp" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; if (FFieldItem.DataType == typeof(DateTime)) aPicker.DateTimeType = dateTimeType.DateTime; else if (FFieldItem.DataType == typeof(String)) aPicker.DateTimeType = dateTimeType.VarChar; aPicker.ToolTip = FFieldItem.DataField; //aPicker.Text = String.Format("'<%# Bind(\"{0}\") %>'", FFieldItem.DataField); FContainer.Controls.Add(aPicker); Boolean Found = false; foreach (WebDateTimePicker aWebPicker in aWebDateTimePickerList) { if (String.Compare(aPicker.ID, aWebPicker.ID) == 0) { Found = true; break; } } if (!Found) { aWebDateTimePickerList.Add(aPicker); //Add AddNewRowControlItem to WebGridView if (ExtraName == "F") { if (FWebGridView != null) { Found = false; foreach (AddNewRowControlItem aControlItem in FWebGridView.AddNewRowControls) { if (aControlItem.FieldName.CompareTo(FFieldItem.DataField) == 0) { Found = true; break; } } if (!Found) { AddNewRowControlItem aItem = new AddNewRowControlItem(); aItem.ControlID = "wdtp" + FTableName + FFieldItem.DataField + ExtraName; aItem.ControlType = WebGridView.AddNewRowControlType.DateTimePicker; aItem.FieldName = FFieldItem.DataField; FWebGridView.AddNewRowControls.Add(aItem); } } } } } }
private void GenComboBoxTemplate(String ExtraName) { if (ExtraName == "") { System.Web.UI.WebControls.Label aLabel = new System.Web.UI.WebControls.Label(); aLabel.ID = "l" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; aLabel.ToolTip = FFieldItem.DataField; FContainer.Controls.Add(aLabel); Boolean Found = false; foreach (System.Web.UI.WebControls.Label bLabel in aLabelList) { if (String.Compare(aLabel.ID, bLabel.ID) == 0) { Found = true; break; } } if (!Found) { aLabelList.Add(aLabel); } } else { WebDropDownList aComboBox = new WebDropDownList(); aComboBox.ID = "wdd" + FTableName + FFieldItem.DataField + ExtraName + "GridView"; aComboBox.DataSourceID = FDataSourceID; aComboBox.DataMember = FFieldItem.ComboEntityName; aComboBox.DataTextField = FFieldItem.ComboTextField; aComboBox.DataValueField = FFieldItem.ComboValueField; aComboBox.Width = 130; FContainer.Controls.Add(aComboBox); Boolean Found = false; foreach (MyWebDropDownList aDropDownList in aWebDropDownList) { if (String.Compare(aComboBox.ID, aDropDownList.WebDropDownList.ID) == 0) { Found = true; break; } } if (!Found) { MyWebDropDownList aDropDown = new MyWebDropDownList(aComboBox, FFieldItem.DataField); aWebDropDownList.Add(aDropDown); //Add AddNewRowControlItem to WebGridView if (ExtraName == "F") { if (FWebGridView != null) { Found = false; foreach (AddNewRowControlItem aControlItem in FWebGridView.AddNewRowControls) { if (aControlItem.FieldName.CompareTo(FFieldItem.DataField) == 0) { Found = true; break; } } if (!Found) { AddNewRowControlItem aItem = new AddNewRowControlItem(); aItem.ControlID = "wdd" + FTableName + FFieldItem.DataField + ExtraName; aItem.ControlType = WebGridView.AddNewRowControlType.DropDownList; aItem.FieldName = FFieldItem.DataField; FWebGridView.AddNewRowControls.Add(aItem); } } } } } }