private string CreateThumbHtml(string template) { StringBuilder sb = new StringBuilder(template); string imageUrl = Request.Url.Scheme + "://" + Request.Url.Host + "/bbimagehandler.ashx?placeholder=1&nocache=1"; if (template.IndexOf("[IMAGE:") > -1) { string imageDimText = VfpInterop.StrExtract(sb.ToString(), "[IMAGE:", "]", 1, 1); if (imageDimText != String.Empty) { int imageDim = 0; if (Int32.TryParse(imageDimText, out imageDim)) { imageUrl += string.Format("&width={0}&height={1}&text={0}", imageDim, (int)(imageDim * 2 / 3)); } sb.Replace("[IMAGE:" + imageDimText + "]", "<img src=\"" + imageUrl + "\" />"); } } else if (template.IndexOf("[IMAGE]") > -1) { imageUrl += "&width=200&height=150&text=Unresized+Image"; sb.Replace("[IMAGE]", "<img src=\"" + imageUrl + "\" />"); } sb.Replace("[TITLE]", "Product Title"); return(sb.ToString()); }
private string CreateThumbHtml(string template) { StringBuilder sb = new StringBuilder(template); string imageUrl = Request.Url.Scheme + "://" + Request.Url.Host + "/bbimagehandler.ashx?placeholder=1&nocache=1"; if (template.IndexOf("[IMAGE:") > -1) { string imageDimText = VfpInterop.StrExtract(sb.ToString(), "[IMAGE:", "]", 1, 1); if (imageDimText != String.Empty) { int imageDim = 0; if (Int32.TryParse(imageDimText, out imageDim)) { imageUrl += string.Format("&width={0}&height={1}&text={0}", imageDim, (int)(imageDim * 2 / 3)); } sb.Replace("[IMAGE:" + imageDimText + "]", "<img src=\"" + imageUrl + "\" />"); } } else if (template.IndexOf("[IMAGE]") > -1) { imageUrl += "&width=200&height=150&text=Unresized+Image"; sb.Replace("[IMAGE]", "<img src=\"" + imageUrl + "\" />"); } sb.Replace("[PRODUCTGROUPNAME]", "ProductGroup"); sb.Replace("[PRODUCTCOUNT]", "42"); sb.Replace("[ICON]", "<img src=\"file:///" + Server.MapPath("~/Images/icon_solutions_16px.gif") + "\" />"); return(sb.ToString()); }
public string ToHtml(string template, bool includeEmptyLines) { StringBuilder sb = new StringBuilder(); sb.Append(template); sb.Replace("\r\n", "\n"); // count Params in template int anzParams = VfpInterop.Occurs('[', template); for (int i = 0; i < anzParams; i++) { string[] param = VfpInterop.StrExtract(template, "[", "]", i + 1, 1).Split(':'); string search = "]"; if (param.Length > 1) { string width = param[1]; search = ":" + width + "]"; } sb.Replace("[COMPANY" + search, HttpUtility.HtmlEncode(Company)); sb.Replace("[PREFIX" + search, HttpUtility.HtmlEncode(Prefix)); sb.Replace("[FIRSTNAME" + search, HttpUtility.HtmlEncode(Firstname)); sb.Replace("[MIDDLENAME" + search, HttpUtility.HtmlEncode(Middlename)); sb.Replace("[LASTNAME" + search, HttpUtility.HtmlEncode(Lastname)); sb.Replace("[SUFFIX" + search, HttpUtility.HtmlEncode(Suffix)); sb.Replace("[STREET" + search, HttpUtility.HtmlEncode(Street)); sb.Replace("[UNIT" + search, HttpUtility.HtmlEncode(Unit)); sb.Replace("[REGION" + search, HttpUtility.HtmlEncode(Region)); sb.Replace("[POSTALCODE" + search, HttpUtility.HtmlEncode(PostalCode)); sb.Replace("[CITY" + search, HttpUtility.HtmlEncode(City)); sb.Replace("[SUBURB" + search, HttpUtility.HtmlEncode(Suburb)); sb.Replace("[COUNTRYCODE" + search, HttpUtility.HtmlEncode(CountryCode)); sb.Replace("[COUNTRY" + search, HttpUtility.HtmlEncode(Country)); sb.Replace("[PHONE" + search, HttpUtility.HtmlEncode(Telephone)); sb.Replace("[CELL" + search, HttpUtility.HtmlEncode(Cell)); sb.Replace("[FAX" + search, HttpUtility.HtmlEncode(Fax)); sb.Replace("[EMAIL" + search, HttpUtility.HtmlEncode(Email)); } string[] resultLines = sb.ToString().Split('\n'); string result = ""; for (int i = 0; i < resultLines.Length; i++) { if (!includeEmptyLines) { if (resultLines[i].Trim() != String.Empty) { result = result + resultLines[i] + "<br />"; } } else { result = result + resultLines[i] + "<br />"; } } return(result); }
private string CreateThumbHtml(string template) { StringBuilder sb = new StringBuilder(template); string imageUrl = Request.Url.Scheme + "://" + Request.Url.Host + "/bbimagehandler.ashx?placeholder=1&nocache=1"; if (template.IndexOf("[IMAGE:") > -1) { string imageDimText = VfpInterop.StrExtract(sb.ToString(), "[IMAGE:", "]", 1, 1); if (imageDimText != String.Empty) { int imageDim = 0; if (Int32.TryParse(imageDimText, out imageDim)) { imageUrl += string.Format("&width={0}&height={1}&text={0}", imageDim, (int)(imageDim * 2 / 3)); } sb.Replace("[IMAGE:" + imageDimText + "]", "<img src=\"" + imageUrl + "\" />"); } } else if (template.IndexOf("[IMAGE]") > -1) { imageUrl += "&width=200&height=150&text=Unresized+Image"; sb.Replace("[IMAGE]", "<img src=\"" + imageUrl + "\" />"); } sb.Replace("[TITLE]", "Product Title"); sb.Replace("[PRODUCTDESCRIPTION]", "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum ."); sb.Replace("[PRODUCTSHORTDESCRIPTION]", "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor."); sb.Replace("[PRODUCTOPTIONS]", "<span>ProductOption</span> <select name=\"Select1\"><option>Option1</option></select>"); sb.Replace("[MANDATORYERROR]", "Error Message"); sb.Replace("[PRICE]", "123.44"); sb.Replace("[CURRENCY]", PortalSettings.Currency); sb.Replace("[ADDCARTIMAGE]", "<img src=\"file:///" + Server.MapPath("~/images/cart.gif") + "\" />"); sb.Replace("[ADDCARTLINK]", "Add to cart"); sb.Replace("[TAX]", "includes tax (19%)"); sb.Replace("[UNIT]", "pcs."); sb.Replace("[AMOUNT]", "<input name=\"Text1\" type=\"text\" size=\"3\" value=\"1\"/>"); return(sb.ToString()); }
protected void ProductOptionListView_ItemDataBound(object sender, ListViewItemEventArgs e) { Label lblOption = (Label)e.Item.FindControl("lblOption"); lblOption.CssClass = "bbstore-product-option-label"; PlaceHolder phOptionValue = e.Item.FindControl("phOptionValue") as PlaceHolder; Label lblMandatory = (Label)e.Item.FindControl("lblMandatory"); Literal ltrCRLF = (Literal)e.Item.FindControl("ltrCRLF"); HtmlTableRow trLine = (HtmlTableRow)e.Item.FindControl("trLine"); HtmlTableRow trAddImage = (HtmlTableRow)e.Item.FindControl("trAddImage"); HtmlTableRow trAddDesc = (HtmlTableRow)e.Item.FindControl("trAddDesc"); Label lblImage = (Label)e.Item.FindControl("lblImage"); lblImage.Text = Localization.GetString("lblImage.Text", this.LocalResourceFile); Label lblDesc = (Label)e.Item.FindControl("lblDesc"); lblDesc.Text = Localization.GetString("lblDesc.Text", this.LocalResourceFile); if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem currentItem = (ListViewDataItem)e.Item; lblOption.Text = currentItem.DataItem.ToString(); int anzOption = 0; List <OptionListInfo> options = (from p in ProductOptions where p.OptionName == lblOption.Text select p).ToList(); if (options.Count > 0) { string control = options[0].Control; switch (control) { case "dropdown": case "colorbox": DropDownList cboOptionValue = new DropDownList(); cboOptionValue.CssClass = "bbstore-product-option-dropdown"; cboOptionValue.ID = "cboOptionValue"; cboOptionValue.Items.Clear(); cboOptionValue.Items.Add(new ListItem(Localization.GetString("SelectOption.Text", ProductModule.LocalResourceFile), "")); if (control == "colorbox") { cboOptionValue.Items[0].Attributes.Add("style", "background-color:#FFFFFF"); } foreach (OptionListInfo lid in options) { if (lid.OptionValue != String.Empty) { anzOption++; string optionDisplayvalue = lid.OptionValue; string optionColor = ""; if (control == "colorbox") { optionColor = VfpInterop.StrExtract(optionDisplayvalue, "(", ")", 1, 1); optionDisplayvalue = optionDisplayvalue.Substring(0, optionDisplayvalue.IndexOf("(")).Trim(); lid.OptionValue = optionDisplayvalue; } if (lid.PriceAlteration != 0.00m) { string sign = (lid.PriceAlteration > 0 ? "+" : "-"); decimal alteration = ShowNetPrice ? lid.PriceAlteration : lid.PriceAlteration * (1 + Product.TaxPercent / 100); string format = ShowNetPrice ? "0.0000" : "0.00"; if (lid.ShowDiff) { optionDisplayvalue += " (" + sign + Math.Abs(alteration).ToString(format).Trim() + " " + ProductModule.Currency + ")"; } } cboOptionValue.Items.Add(new ListItem(optionDisplayvalue, lid.OptionValue)); if (control == "colorbox") { cboOptionValue.Items[cboOptionValue.Items.Count - 1].Attributes.Add("style", "background-color:" + optionColor); } if (lid.IsDefault) { cboOptionValue.SelectedValue = lid.OptionValue; // If Mandatory and Default, we delete the "(Select option)" if (lid.IsMandatory) { cboOptionValue.Items.RemoveAt(0); } } if (lid.PriceAlteration != 0.00m) { cboOptionValue.SelectedIndexChanged += cboOptionValue_SelectedIndexChanged; cboOptionValue.AutoPostBack = true; } } lblMandatory.Visible = lid.IsMandatory; if (lid.OptionDim != String.Empty) { string[] dimen = lid.OptionDim.Split(','); if (dimen.Length > 0) { cboOptionValue.Width = new Unit(dimen[0]); } } trAddImage.Visible = lid.AskImage; trAddDesc.Visible = lid.AskDescription; trLine.Visible = lid.AskImage || lid.AskDescription; } phOptionValue.Controls.Add(cboOptionValue); break; case "textbox": TextBox txtOptionValue = new TextBox(); txtOptionValue.CssClass = "bbstore-product-option-textbox"; txtOptionValue.ID = "txtOptionValue"; OptionListInfo lit = options[0]; if (lit.OptionValue != String.Empty) { if (lit.PriceAlteration != 0.00m) { txtOptionValue.TextChanged += txtOptionValue_TextChanged; } } lblMandatory.Visible = lit.IsMandatory; if (lit.OptionDim != String.Empty) { string[] dimen = lit.OptionDim.Split(','); if (dimen.Length == 1) { txtOptionValue.Width = new Unit(dimen[0]); } if (dimen.Length == 2) { txtOptionValue.Width = new Unit(dimen[0]); txtOptionValue.TextMode = TextBoxMode.MultiLine; txtOptionValue.Height = new Unit(dimen[1]); } } trAddImage.Visible = lit.AskImage; trAddDesc.Visible = lit.AskDescription; trLine.Visible = lit.AskImage || lit.AskDescription; phOptionValue.Controls.Add(txtOptionValue); break; case "header": lblOption.CssClass = "bbstore-product-option-header"; ltrCRLF.Visible = true; break; case "area": OptionListInfo lia = options[0]; // Breite[50.0cm-270.00cm],Länge[50cm-180cm],Fläche[0.01qm] string controlProps = lia.ControlProps; var areaProps = ParseAreaProps(controlProps); HtmlTable table = new HtmlTable(); HtmlTableRow rowDimen1 = new HtmlTableRow(); HtmlTableRow rowDimen2 = new HtmlTableRow(); HtmlTableCell cell = new HtmlTableCell(); Label lblDimen1 = new Label(); lblDimen1.CssClass = "bbstore-product-option-label"; lblDimen1.ID = "lblDimen1"; lblDimen1.Text = areaProps.Dimension1Name + " (" + areaProps.Dimension1Unit + ")"; cell.Controls.Add(lblDimen1); rowDimen1.Controls.Add(cell); cell = new HtmlTableCell(); TextBox txtDimen1 = new TextBox(); txtDimen1.ID = "txtDimen1"; txtDimen1.CssClass = "bbstore-product-option-textbox"; txtDimen1.Width = 50; //txtDimen1.AutoPostBack = true; txtDimen1.CausesValidation = true; cell.Controls.Add(txtDimen1); rowDimen1.Controls.Add(cell); cell = new HtmlTableCell(); RangeValidator valDimen1Range = new RangeValidator(); valDimen1Range.ID = "valDimen1Range"; valDimen1Range.CssClass = "bbstore-product-option-error"; valDimen1Range.Display = ValidatorDisplay.Dynamic; valDimen1Range.Type = ValidationDataType.Double; valDimen1Range.MinimumValue = ((double)areaProps.Dimension1Min).ToString(); valDimen1Range.MaximumValue = ((double)areaProps.Dimension1Max).ToString(); valDimen1Range.ControlToValidate = "txtDimen1"; valDimen1Range.ErrorMessage = " (" + areaProps.Dimension1Min.ToString() + ".." + areaProps.Dimension1Max.ToString() + ")"; cell.Controls.Add(valDimen1Range); rowDimen1.Controls.Add(cell); cell = new HtmlTableCell(); Label lblDimen2 = new Label(); lblDimen2.CssClass = "bbstore-product-option-label"; lblDimen2.ID = "lblDimen2"; lblDimen2.Text = areaProps.Dimension2Name + " (" + areaProps.Dimension2Unit + ")"; cell.Controls.Add(lblDimen2); rowDimen2.Controls.Add(cell); cell = new HtmlTableCell(); TextBox txtDimen2 = new TextBox(); txtDimen1.CssClass = "bbstore-product-option-textbox"; txtDimen2.ID = "txtDimen2"; txtDimen2.Width = 50; txtDimen2.AutoPostBack = true; txtDimen2.CausesValidation = true; cell.Controls.Add(txtDimen2); rowDimen2.Controls.Add(cell); cell = new HtmlTableCell(); RangeValidator valDimen2Range = new RangeValidator(); valDimen2Range.CssClass = "bbstore-product-option-error"; valDimen2Range.ID = "valDimen2Range"; valDimen2Range.Display = ValidatorDisplay.Dynamic; valDimen2Range.Type = ValidationDataType.Double; valDimen2Range.MinimumValue = ((double)areaProps.Dimension2Min).ToString(); valDimen2Range.MaximumValue = ((double)areaProps.Dimension2Max).ToString(); valDimen2Range.ControlToValidate = "txtDimen2"; valDimen2Range.ErrorMessage = " (" + areaProps.Dimension2Min.ToString() + ".." + areaProps.Dimension2Max.ToString() + ")"; cell.Controls.Add(valDimen2Range); rowDimen2.Controls.Add(cell); table.Controls.Add(rowDimen1); table.Controls.Add(rowDimen2); phOptionValue.Controls.Add(table); break; } } } }
protected void ReadCss() { string[] colors = new string[5] { "", "", "", "", "" }; string moduleCssFile = MapPath(ControlPath + "module.css"); if (File.Exists(moduleCssFile)) { string cssContent = File.ReadAllText(moduleCssFile); if (cssContent.Contains("COLORBORDER :")) { colors[0] = VfpInterop.StrExtract(cssContent, "COLORBORDER : #", ";", 1, 1).Trim(); colors[1] = VfpInterop.StrExtract(cssContent, "COLORROW : #", ";", 1, 1).Trim(); colors[2] = VfpInterop.StrExtract(cssContent, "COLORALT : #", ";", 1, 1).Trim(); colors[3] = VfpInterop.StrExtract(cssContent, "COLORSUM : #", ";", 1, 1).Trim(); colors[4] = VfpInterop.StrExtract(cssContent, "COLORHEAD : #", ";", 1, 1).Trim(); } else { string tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid,", "}", 1, 1); colors[0] = VfpInterop.StrExtract(tmp, "border-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid-row,", "}", 1, 1); colors[1] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid-alternaterow,", "}", 1, 1); colors[2] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid-sumrow,", "}", 1, 1); colors[3] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid-summary,", "}", 1, 1); colors[4] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); } } string portalCssFile = this.PortalSettings.HomeDirectoryMapPath + "portal.css"; if (File.Exists(portalCssFile)) { string cssContent = File.ReadAllText(portalCssFile); if (cssContent.Contains("COLORBORDER :")) { colors[0] = VfpInterop.StrExtract(cssContent, "COLORBORDER : #", ";", 1, 1).Trim(); colors[1] = VfpInterop.StrExtract(cssContent, "COLORROW : #", ";", 1, 1).Trim(); colors[2] = VfpInterop.StrExtract(cssContent, "COLORALT : #", ";", 1, 1).Trim(); colors[3] = VfpInterop.StrExtract(cssContent, "COLORSUM : #", ";", 1, 1).Trim(); colors[4] = VfpInterop.StrExtract(cssContent, "COLORHEAD : #", ";", 1, 1).Trim(); } else if (cssContent.IndexOf(".bbstore-grid,") > -1) { string tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid,", "}", 1, 1); colors[0] = VfpInterop.StrExtract(tmp, "border-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid-row,", "}", 1, 1); colors[1] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid-alternaterow,", "}", 1, 1); colors[2] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid-sumrow,", "}", 1, 1); colors[3] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".bbstore-grid-summary,", "}", 1, 1); colors[4] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); } else if (cssContent.IndexOf(".grdCart,") > -1) { string tmp = VfpInterop.StrExtract(cssContent, ".grdCart,", "}", 1, 1); colors[0] = VfpInterop.StrExtract(tmp, "border-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".grdCartRow,", "}", 1, 1); colors[1] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".grdCartAlternatingRow,", "}", 1, 1); colors[2] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".grdCartSumRow,", "}", 1, 1); colors[3] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); tmp = VfpInterop.StrExtract(cssContent, ".grdCartSummary,", "}", 1, 1); colors[4] = VfpInterop.StrExtract(tmp, "background-color:#", ";", 1, 1); } } txtColorBorder.Text = colors[0]; txtColorRow.Text = colors[1]; txtColorAlt.Text = colors[2]; txtColorSum.Text = colors[3]; txtColorHead.Text = colors[4]; }
private string GenerateForm() { string template = Localization.GetString("AddressTemplate.Text", this.LocalResourceFile.Replace("ViewCartAddressEdit", "ViewCart")); bool mandCompany = Settings["MandCompany"] != null && Convert.ToBoolean(Settings["MandCompany"]); bool mandPrefix = Settings["MandPrefix"] != null && Convert.ToBoolean(Settings["MandPrefix"]); bool mandFirstname = Settings["MandFirstname"] != null && Convert.ToBoolean(Settings["MandFirstname"]); bool mandMiddlename = Settings["MandMiddlename"] != null && Convert.ToBoolean(Settings["MandMiddlename"]); bool mandLastname = Settings["MandLastname"] != null && Convert.ToBoolean(Settings["MandLastname"]); bool mandSuffix = Settings["MandSuffix"] != null && Convert.ToBoolean(Settings["MandSuffix"]); bool mandStreet = Settings["MandStreet"] != null && Convert.ToBoolean(Settings["MandStreet"]); bool mandUnit = Settings["MandUnit"] != null && Convert.ToBoolean(Settings["MandUnit"]); bool mandRegion = Settings["MandRegion"] != null && Convert.ToBoolean(Settings["MandRegion"]); bool mandPostalCode = Settings["MandPostalCode"] != null && Convert.ToBoolean(Settings["MandPostalCode"]); bool mandCity = Settings["MandCity"] != null && Convert.ToBoolean(Settings["MandCity"]); bool mandSuburb = Settings["MandSuburb"] != null && Convert.ToBoolean(Settings["MandSuburb"]); bool mandCountry = Settings["MandCountry"] != null && Convert.ToBoolean(Settings["MandCountry"]); bool mandPhone = Settings["MandPhone"] != null && Convert.ToBoolean(Settings["MandPhone"]); bool mandCell = Settings["MandCell"] != null && Convert.ToBoolean(Settings["MandCell"]); bool mandFax = Settings["MandFax"] != null && Convert.ToBoolean(Settings["MandFax"]); bool mandEmail = Settings["MandEmail"] != null && Convert.ToBoolean(Settings["MandEmail"]); string[] lines = template.Replace("\r", "").Split('\n'); StringBuilder sb = new StringBuilder(); foreach (string line in lines) { string caption = "", input = "", validator = ""; sb.Append("<div class=\"dnnFormItem\">"); int anzParams = VfpInterop.Occurs('[', line); for (int i = 0; i < anzParams; i++) { string[] param = VfpInterop.StrExtract(line, "[", "]", i + 1, 1).Split(':'); string paraName = param[0]; string width = "50"; if (param.Length > 1) { width = param[1]; } string mandChar = " *"; if (paraName == "COMPANY") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditCompany.Text", this.LocalResourceFile) + (mandCompany ? mandChar : ""); input = input + "<asp:Textbox runat=\"server\" ID=\"txtAdrEditCompany\" EnableViewState=\"True\" MaxLength=\"50\" Style=\"width:" + width + "px;min-width:10px\" " + (mandCompany ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandCompany ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valCompany\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditCompany\" />" : ""); } if (paraName == "PREFIX") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditPrefix.Text", this.LocalResourceFile) + (mandPrefix ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditPrefix\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"20\" Style=\"width:" + width + "px;min-width:10px\" " + (mandPrefix ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandPrefix ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valPrefix\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditPrefix\" />" : ""); } if (paraName == "FIRSTNAME") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditFirstname.Text", this.LocalResourceFile) + (mandFirstname ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditFirstname\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"50\" Style=\"width:" + width + "px;min-width:10px\" " + (mandFirstname ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandFirstname ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valFirstname\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditFirstname\" />" : ""); } if (paraName == "MIDDLENAME") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditMiddlename.Text", this.LocalResourceFile) + (mandMiddlename ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditMiddlename\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"50\" Style=\"width:" + width + "px;min-width:10px\" " + (mandMiddlename ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandMiddlename ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valMiddlename\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditMiddlename\" />" : ""); } if (paraName == "LASTNAME") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditLastname.Text", this.LocalResourceFile) + (mandLastname ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditLastname\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"50\" Style=\"width:" + width + "px;min-width:10px\" " + (mandLastname ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandLastname ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valLastname\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditLastname\" />" : ""); } if (paraName == "SUFFIX") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditSuffix.Text", this.LocalResourceFile) + (mandSuffix ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditSuffix\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"50\" Style=\"width:" + width + "px;min-width:10px\" " + (mandSuffix ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandSuffix ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valSuffix\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditSuffix\" />" : ""); } if (paraName == "STREET") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditStreet.Text", this.LocalResourceFile) + (mandStreet ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditStreet\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"100\" Style=\"width:" + width + "px;min-width:10px\" " + (mandStreet ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandStreet ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valStreet\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditStreet\" />" : ""); } if (paraName == "UNIT") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditUnit.Text", this.LocalResourceFile) + (mandUnit ? mandChar : ""); input = input + "<asp:TextBox ID=\"txtAdrEditUnit\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"50\" Style=\"width:" + width + "px;min-width:10px\" " + (mandUnit ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandUnit ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valUnit\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditUnit\" />" : ""); } if (paraName == "REGION") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditRegion.Text", this.LocalResourceFile) + (mandRegion ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditRegion\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"50\" Style=\"width:" + width + "px;min-width:10px\" " + (mandRegion ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandRegion ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valRegion\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditRegion\" />" : ""); } if (paraName == "POSTALCODE") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditPostalCode.Text", this.LocalResourceFile) + (mandPostalCode ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditPostalCode\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"10\" Style=\"width:" + width + "px;min-width:10px\" " + (mandPostalCode ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandPostalCode ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valPostalCode\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditPostalCode\" />" : ""); } if (paraName == "CITY") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditCity.Text", this.LocalResourceFile) + (mandCity ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditCity\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"100\" Style=\"width:" + width + "px;min-width:10px\" " + (mandCity ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandCity ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valCity\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditCity\" />" : ""); } if (paraName == "SUBURB") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditSuburb.Text", this.LocalResourceFile) + (mandSuburb ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditSuburb\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"100\" Style=\"width:" + width + "px;min-width:10px\" " + (mandSuburb ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandSuburb ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valSuburb\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditSuburb\" />" : ""); } if (paraName == "COUNTRY") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditCountry.Text", this.LocalResourceFile) + (mandCountry ? mandChar : ""); input = input + "<asp:DropDownList id=\"ddlCountry\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"100\" Style=\"width:" + width + "px;min-width:10px\" " + (mandCountry ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandCountry ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valCountry\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"ddlCountry\" />" : ""); } if (paraName == "PHONE") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditPhone.Text", this.LocalResourceFile) + (mandPhone ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditPhone\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"20\" Style=\"width:" + width + "px;min-width:10px\" " + (mandPhone ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandPhone ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valPhone\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditPhone\" />" : ""); } if (paraName == "CELL") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditCell.Text", this.LocalResourceFile) + (mandCell ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditCell\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"20\" Style=\"width:" + width + "px;min-width:10px\" " + (mandCell ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandCell ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valCell\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditFax\" />" : ""); } if (paraName == "FAX") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditFax.Text", this.LocalResourceFile) + (mandFax ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditFax\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"20\" Style=\"width:" + width + "px;min-width:10px\" " + (mandFax ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandFax ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valFax\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditCell\" />" : ""); } if (paraName == "EMAIL") { caption = caption + (String.IsNullOrEmpty(caption) ? "" : " / ") + Localization.GetString("lblAdrEditEmail.Text", this.LocalResourceFile) + (mandEmail ? mandChar : ""); input = input + "<asp:TextBox id=\"txtAdrEditEmail\" runat=\"server\" EnableViewState=\"True\" MaxLength=\"120\" Style=\"width:" + width + "px;min-width:10px\" " + (mandEmail ? "CssClass=\"dnnFormRequired\"" : "") + " />"; validator = validator + (mandEmail ? "<asp:RequiredFieldValidator runat=\"server\" ID=\"valEmail\" CssClass=\"dnnFormMessage dnnFormError\" Display=\"Dynamic\" style=\"left:inherit\" Text=\"«\" ControlToValidate=\"txtAdrEditEmail\" />" : ""); } } if (!String.IsNullOrEmpty(caption)) { sb.Append("<span class=\"dnnFormLabel dnnLabel\">"); sb.Append(caption); sb.Append("</span>"); sb.Append("<div class=\"dnnLeft\">"); sb.Append(input); sb.Append(validator); sb.Append("</div>"); } sb.Append("</div>"); } return(sb.ToString()); }