public static T Create <T>(HtmlForm form) where T : class, IPostModel, new() { CreateLocker(); T model = new T(); lock (_locker) { foreach (var prop in typeof(T).GetProperties()) { if (form.FindControl(prop.Name) is TextBox controlTb) { prop.SetValue(model, Convert.ChangeType(controlTb.Text.Trim(), prop.PropertyType)); } else if (form.FindControl(prop.Name) is DropDownList controlDBox) { prop.SetValue(model, Convert.ChangeType(controlDBox.SelectedValue.Trim(), prop.PropertyType)); } else if (form.FindControl(prop.Name) is UserControl controlUser) { UserControlProperty(model, controlUser); } } } return(model); }
public static void LoadDataFromCookie(string currPageName, HtmlForm frmCurrForm) { if (HttpContext.Current.Request.Cookies[currPageName] != null) { string searchFields = HttpContext.Current.Request.Cookies[currPageName].Value; if (searchFields.Trim() != "") { Array arrFlds = searchFields.Split(','); if (arrFlds.Length > 0) { for (int cntr = 0; cntr < arrFlds.Length; cntr++) { Array arrFldsWithValue = arrFlds.GetValue(cntr).ToString().Split(':'); if (arrFldsWithValue.Length > 0) { if (arrFldsWithValue.GetValue(0).ToString().StartsWith("txt")) { //*- text box ((TextBox)frmCurrForm.FindControl(arrFldsWithValue.GetValue(0).ToString())).Text = (arrFldsWithValue.GetValue(1) == null)? "":arrFldsWithValue.GetValue(1).ToString().Trim(); } else if ((arrFldsWithValue.GetValue(0).ToString().StartsWith("dbl")) || (arrFldsWithValue.GetValue(0).ToString().StartsWith("ddl")) || (arrFldsWithValue.GetValue(0).ToString().StartsWith("lst"))) { // list box ((DropDownList)frmCurrForm.FindControl(arrFldsWithValue.GetValue(0).ToString())).SelectedValue = (arrFldsWithValue.GetValue(1) == null)? "":arrFldsWithValue.GetValue(1).ToString().Trim(); //(arrFldsWithValue.GetValue(0).ToString())).SelectedValue = (arrFldsWithValue.GetValue(1)==null)? "":arrFldsWithValue.GetValue(0).ToString(); } } } } } } }
private string GetStyleUpdateData(long DocID) { string mySql = ""; HtmlForm FrmNewDocument = (HtmlForm)this.Page.FindControl("NewDocument"); if (FieldNum > 0) { mySql += "update UDS_Flow_Style_Data set "; for (int i = 0; i < FieldNum; i++) { mySql += al[i].ToString() + "=" + "'" + ((TextBox)FrmNewDocument.FindControl("txt" + al[i].ToString())).Text.Replace("'", "''") + "'"; if (i != (FieldNum - 1)) { mySql += ","; } } mySql += " where Doc_ID = " + DocID.ToString(); return(mySql); } else { return("Select 1"); } }
private void cmdBack_Click(object sender, System.EventArgs e) { UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow(); HtmlForm FrmNewDocument = (HtmlForm)this.Page.FindControl("PostilDocument"); TextBox tmpText; tmpText = (TextBox)FrmNewDocument.FindControl("txtPostil"); long PostilID; try { PostilID = df.AddPostil(UserName, DocID, tmpText.Text, 4, ProjectID, 2); df.BackDocument(DocID); UploadFile(PostilID); } catch (Exception ex) { UDS.Components.Error.Log(ex.ToString()); } finally { df = null; } Response.AddHeader("Refresh", "1"); }
public string UploadFile() { HtmlForm FrmCompose = (HtmlForm)this.Page.FindControl("EditStyle"); HtmlInputFile hif = (HtmlInputFile)(FrmCompose.FindControl("fileTemplate")); if (hif.PostedFile.FileName.Trim() != "") { string FileName; FileName = System.IO.Path.GetFileName(hif.PostedFile.FileName); //生成模板目录 if (!System.IO.Directory.Exists(Server.MapPath(".") + "\\Template")) { System.IO.Directory.CreateDirectory(Server.MapPath(".") + "\\Template"); } //保存文件 hif.PostedFile.SaveAs(Server.MapPath(".") + "\\Template\\" + FileName); hif = null; return(FileName); } else { return(""); } }
protected override void CreateChildControls() { //if (!shouldContinue) // return; try { HtmlForm frm = (HtmlForm)Page.FindControl("form1"); Table tblHeader = (Table)frm.FindControl("tblHeader"); TableRow rowHeader = (TableRow)tblHeader.FindControl("HeaderRow"); TableCell cellHeader = (TableCell)rowHeader.FindControl("HeaderCell"); cellHeader.Controls.Add(lblTitle); Table table = (Table)frm.FindControl("tbl"); TableRow rowValidation = (TableRow)table.FindControl("ValidationRow"); TableCell validationCell = (TableCell)rowValidation.FindControl("ValidationCell"); Table tableFooter = (Table)frm.FindControl("tblFooter"); TableRow rowFooter = (TableRow)tableFooter.FindControl("FooterRow"); TableCell footerCell = (TableCell)rowFooter.FindControl("FooterCell"); IndValidationSummary validationSummary = new IndValidationSummary(); validationSummary.DisplayMode = ValidationSummaryDisplayMode.BulletList; validationCell.Controls.Add(validationSummary); footerCell.Controls.Add(btnSave); footerCell.Controls.Add(btnCancel); footerCell.Controls.Add(AjaxManager); base.CreateChildControls(); } catch (IndException exc) { ShouldContinue = false; _ParentGenericUserControl.ReportControlError(exc); return; } catch (Exception ex) { ShouldContinue = false; _ParentGenericUserControl.ReportControlError(new IndException(ex)); return; } }
protected void btnAplicarHost_Click(object sender, EventArgs e) { try { //obtengo referencia a mi pagina host (donde se coloco el control) HtmlForm _paginaHost = (HtmlForm)this.Parent; //busco los tres controles que voy a modificar Label _lblPrueba = (Label)_paginaHost.FindControl("lblPrueba"); TextBox _txtPrueba = (TextBox)_paginaHost.FindControl("txtPrueba"); Button _btnPrueba = (Button)_paginaHost.FindControl("btnPrueba"); //modifico el color de despligue de dichos controles _lblPrueba.ForeColor = System.Drawing.Color.FromName(_colores[_indiceActualColor]); _btnPrueba.ForeColor = System.Drawing.Color.FromName(_colores[_indiceActualColor]); _txtPrueba.ForeColor = System.Drawing.Color.FromName(_colores[_indiceActualColor]); } catch (Exception) { throw; } }
/// <summary> /// Checks if the inheriting page requires a script manager declared and creates the necessary scripts /// </summary> private void CheckIfRequireScriptManager() { if (!this.RequireScriptManager) { return; } HtmlForm frm = ThisForm; if (frm != null && frm.FindControl("ScriptManager") == null) { var pnlScriptManager = new Panel { ID = "pnlScriptManager" }; var manager = new ScriptManager { ID = "ScriptManager", EnablePartialRendering = this.EnablePartialRendering, EnableScriptGlobalization = this.EnableScriptGlobalization, LoadScriptsBeforeUI = false, ScriptMode = ScriptMode.Release }; if (CurrentContext.IsRequestingFromMobileMode(ThisCustomer)) { manager.Scripts.Add(new ScriptReference("~/mobile/js/base_ajax.js")); manager.Scripts.Add(new ScriptReference("~/mobile/js/system/config-loader.js")); } else { manager.Scripts.Add(new ScriptReference("~/jscripts/base_ajax.js")); manager.Scripts.Add(new ScriptReference("~/jscripts/system/config-loader.js")); //load here the tiny mce when editing mode for the topic //since it cannot be loaded using getscript of jquery if (ThisCustomer.IsInEditingMode() && Security.IsAdminCurrentlyLoggedIn()) { manager.Scripts.Add(new ScriptReference("~/jscripts/tiny_mce/tiny_mce.js")); } } frm.Controls.AddAt(0, manager); // allow page to register scripts and web services RegisterScriptsAndServices(manager); } }
private string GetStyleInsertData() { string mySql = ""; HtmlForm FrmNewDocument = (HtmlForm)this.Page.FindControl("NewDocument"); mySql += "insert into UDS_Flow_Style_Data ("; for (int i = 0; i < FieldNum; i++) { mySql += al[i].ToString() + ","; } mySql = mySql.Substring(0, mySql.Length - 1) + ") values("; for (int i = 0; i < FieldNum; i++) { mySql += "'" + ((TextBox)FrmNewDocument.FindControl("txt" + al[i].ToString())).Text.Replace("'", "''") + "',"; } mySql = mySql.Substring(0, mySql.Length - 1) + ")"; return(mySql); }
private void cmdPostilNext_Click(object sender, System.EventArgs e) { UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow(); HtmlForm FrmNewDocument = (HtmlForm)this.Page.FindControl("PostilDocument"); TextBox tmpText; tmpText = (TextBox)FrmNewDocument.FindControl("txtPostil"); long PostilID; try { if (ProjectID >= 0) { PostilID = df.AddPostil(UserName, DocID, tmpText.Text, 1, ProjectID, 2); int iResult; iResult = df.PostDocument(UserName, DocID, ProjectID); if (iResult == 0) { UploadFile(PostilID); } else { Response.Write("<script lanuage='javascript'>alert('" + df.DoMessage(iResult, DocID, false) + "');</script>"); } } else { Response.Write("<script lanuage='javascript'>alert('没有上级项目!');</script>"); } } catch (Exception ex) { UDS.Components.Error.Log(ex.ToString()); } finally { df = null; } Response.AddHeader("Refresh", "1"); }
public static void FillForm <T>(HtmlForm form, T nesne) where T : EditModel, new() { foreach (var prop in typeof(T).GetProperties()) { var control = form.FindControl(prop.Name); if (control is TextBox) { ((TextBox)control).Text = prop.GetValue(nesne) != null?prop.GetValue(nesne).ToString() : ""; } if (control is DropDownList) { ((DropDownList)control).SelectedValue = prop.GetValue(nesne).ToString(); } if (control is Label) { ((Label)control).Text = prop.GetValue(nesne).ToString(); } } }
private void UploadFile(long DocID) { string FileName = ""; HtmlForm FrmCompose = (HtmlForm)this.Page.FindControl("NewDocument"); //生成附件目录 if (!System.IO.Directory.Exists(Server.MapPath(".") + "\\AttachFiles")) { System.IO.Directory.CreateDirectory(Server.MapPath(".") + "\\AttachFiles"); } try { HtmlInputFile hif = ((HtmlInputFile)(FrmCompose.FindControl("fileTemplate"))); if (hif.PostedFile != null) { if (hif.PostedFile.FileName.Trim() != "") { FileName = System.IO.Path.GetFileName(hif.PostedFile.FileName); //生成用户目录 if (!System.IO.Directory.Exists(Server.MapPath(".") + "\\AttachFiles\\" + UserName)) { System.IO.Directory.CreateDirectory(Server.MapPath(".") + "\\AttachFiles\\" + UserName); } Random TempNameInt = new Random(); string NewDocDirName = TempNameInt.Next(100000000).ToString(); //生成随机目录 if (!System.IO.Directory.Exists(Server.MapPath(".") + "\\AttachFiles\\" + UserName + "\\" + NewDocDirName)) { System.IO.Directory.CreateDirectory(Server.MapPath(".") + "\\AttachFiles\\" + UserName + "\\" + NewDocDirName); } TempNameInt = null; //保存文件 hif.PostedFile.SaveAs(Server.MapPath(".") + "\\AttachFiles\\" + UserName + "\\" + NewDocDirName + "\\" + FileName); UDS.Components.DocAttachFile att = new UDS.Components.DocAttachFile(); UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow(); // 初始化 att.FileAttribute = 0; att.FileSize = hif.PostedFile.ContentLength; att.FileName = FileName; att.FileAuthor = UserName; att.FileCatlog = "公文"; att.FileVisualPath = "\\AttachFiles\\" + UserName + "\\" + NewDocDirName + "\\"; att.FileAddedDate = DateTime.Now.ToString();; df.AddAttach(att, DocID); df = null; att = null; } hif = null; } } catch (Exception ex) { UDS.Components.Error.Log(ex.ToString()); } finally { } }
public static void LoadDataFromCookie(string currPageName,HtmlForm frmCurrForm ) { if (HttpContext.Current.Request.Cookies[currPageName]!=null) { string searchFields = HttpContext.Current.Request.Cookies[currPageName].Value; if (searchFields.Trim()!="") { Array arrFlds = searchFields.Split(','); if (arrFlds.Length>0) { for(int cntr=0;cntr<arrFlds.Length;cntr++) { Array arrFldsWithValue = arrFlds.GetValue(cntr).ToString().Split(':'); if (arrFldsWithValue.Length>0) { if (arrFldsWithValue.GetValue(0).ToString().StartsWith("txt")) { //*- text box ((TextBox) frmCurrForm.FindControl(arrFldsWithValue.GetValue(0).ToString())).Text=(arrFldsWithValue.GetValue(1)==null)? "":arrFldsWithValue.GetValue(1).ToString().Trim(); } else if ((arrFldsWithValue.GetValue(0).ToString().StartsWith("dbl"))|| (arrFldsWithValue.GetValue(0).ToString().StartsWith("ddl"))|| (arrFldsWithValue.GetValue(0).ToString().StartsWith("lst"))) { // list box ((DropDownList)frmCurrForm.FindControl(arrFldsWithValue.GetValue(0).ToString())).SelectedValue = (arrFldsWithValue.GetValue(1)==null)? "":arrFldsWithValue.GetValue(1).ToString().Trim(); //(arrFldsWithValue.GetValue(0).ToString())).SelectedValue = (arrFldsWithValue.GetValue(1)==null)? "":arrFldsWithValue.GetValue(0).ToString(); } } } } } } }
protected void ButtonExportarPdf_Click(object sender, EventArgs e) { AcuseFolio objAcuseOpinionFolio; strTipoArrendamiento = Request.QueryString["TipoArrto"]; int intFolio; bool ConversionOK; //esta nos dice si es un número válido try { StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter htw = new HtmlTextWriter(sw); Page page = new Page(); HtmlForm form = new HtmlForm(); page.EnableEventValidation = false; page.DesignerInitialize(); form = this.form1; form.FindControl("ButtonExportarPdf").Visible = false; page.Controls.Add(form); page.RenderControl(htw); //string strCabecero ="<!DOCTYPE html> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/><title></title><meta charset='utf-8' /></head><body>"; string strCabecero = "<!DOCTYPE html> <html xmlns='http://www.w3.org/1999/xhtml'> <head runat='server'> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <title></title> <link href='https://framework-gb.cdn.gob.mx/assets/styles/main.css' rel='stylesheet'/> <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300' rel='stylesheet' type='text/css'/> <link href='https://framework-gb.cdn.gob.mx/favicon.ico' rel='shortcut icon'/> <style> @media print { #ZonaNoImrpimible {display:none;} } nav,aside { display: none; } .auto-style1 { height: 119px; } </style> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'></script> </head> <body>"; string strPie = "</body> </html>"; string strBotonExportar = "<asp:Button ID=\"ButtonExportarPdf\" runat=\"server\" CssClass=\"btn btn-default\" OnClick=\"ButtonExportarPdf_Click\" Text=\"Exportar a PDF\" ToolTip=\"Exportar a PDF.\" />"; string strBotonImprimir = "<input type=\"button\" id=\"ButtonImprimir\" value=\"Imprimir\" onclick=\"javascript: window.print()\" class=\"btn\" />"; string strBrakePage = "page-break-before: always;"; string strCuerpoOriginal = sb.ToString(); string strPaginaConCuerpo = strCabecero + strCuerpoOriginal + strPie; //string strCuerpoFormateado = especialesHTML(strPaginaConCuerpo).Replace(strImagenLogoIndaabinHtml, strImagenLogoIndaabinFisica).Replace(strImagenEscudoNacionalHtml, strImagenEscudoNacionalFisica).Replace(strBotonImprimir, "").Replace(strBotonExportar, "").Replace(strBrakePage, ""); string strCuerpoFormateado = especialesHTML(strPaginaConCuerpo); //poner la url del nuevo logo si pasa del 1 de diciembre de 2018 ConversionOK = int.TryParse(Request.QueryString["IdFolio"].ToString(), out intFolio); if (ConversionOK) { objAcuseOpinionFolio = new NGConceptoRespValor().ObtenerAcuseSolicitudOpinionConInmueble(intFolio, strTipoArrendamiento); string fecha = objAcuseOpinionFolio.FechaAutorizacion.ToString(); string[] nuevafecha = fecha.Split('/'); string[] ano = nuevafecha[2].Split(' '); string dia = nuevafecha[0]; string mes = nuevafecha[1]; string year = ano[0]; strCuerpoFormateado = strCuerpoFormateado.Replace("src=\"http://sistemas.indaabin.gob.mx/ImagenesComunes/INDAABIN_01.jpg\"", "src=\"https://sistemas.indaabin.gob.mx/ImagenesComunes/SHCP-INDAABINREDUCIDO.PNG"); strCuerpoFormateado = strCuerpoFormateado.Replace("url(http://sistemas.indaabin.gob.mx/ImagenesComunes/aguila.png);", "url(https://sistemas.indaabin.gob.mx/ImagenesComunes/nuevoescudo.png);"); strCuerpoFormateado = strCuerpoFormateado.Replace("background-position: center;", "background-position: left;"); strCuerpoFormateado = strCuerpoFormateado.Replace("##font##", "font-family: Montserrat;"); strCuerpoFormateado = strCuerpoFormateado.Replace("##Viejo##", "display:none;"); //if (Convert.ToInt32(year) >= 2018) //{ // if (Convert.ToInt32(mes) >= 12) // { // if (Convert.ToInt32(dia) >= 1) // { // strCuerpoFormateado = strCuerpoFormateado.Replace("src=\"http://sistemas.indaabin.gob.mx/ImagenesComunes/INDAABIN_01.jpg\"", "src=\"https://sistemas.indaabin.gob.mx/ImagenesComunes/SHCP-INDAABINREDUCIDO.PNG"); // strCuerpoFormateado = strCuerpoFormateado.Replace("url(http://sistemas.indaabin.gob.mx/ImagenesComunes/aguila.png);", "url(https://sistemas.indaabin.gob.mx/ImagenesComunes/nuevoescudo.png);"); // strCuerpoFormateado = strCuerpoFormateado.Replace("background-position: center;", "background-position: left;"); // strCuerpoFormateado = strCuerpoFormateado.Replace("##font##", "font-family: Montserrat;"); // strCuerpoFormateado = strCuerpoFormateado.Replace("##Viejo##", "display:none;"); // } // else // { // strCuerpoFormateado = strCuerpoFormateado.Replace("##Nuevo##", "display:none;"); // } // } // else // { // strCuerpoFormateado = strCuerpoFormateado.Replace("##Nuevo##", "display:none;"); // } //} //else //{ // strCuerpoFormateado = strCuerpoFormateado.Replace("##Nuevo##", "display:none;"); //} } ExportHTML exportar = new ExportHTML(); exportar.CanPrint = true; //RCA 10/18/2017 exportar.GenerarPDF(strCuerpoFormateado); //exportar.GenerarPDF(strCuerpoFormateado, Server.MapPath("~")); } catch (Exception ex) { Msj = "Ha ocurrido un error al exportar a PDF. Contacta al área de sistemas."; this.LabelInfo.Text = "<div class='alert alert-danger'><strong> Error </strong>" + Msj + "</div>"; MostrarMensajeJavaScript(Msj); BitacoraExcepcion BitacoraExcepcionAplictivo = new BitacoraExcepcion { CadenaconexionBD = System.Configuration.ConfigurationManager.ConnectionStrings["cnArrendamientoInmueble"].ConnectionString, Aplicacion = "ContratosArrto", Modulo = MethodInfo.GetCurrentMethod().DeclaringType.ToString() + ".aspx", Funcion = MethodBase.GetCurrentMethod().Name + "()", DescExcepcion = ex.InnerException == null ? ex.Message : ex.InnerException.Message, Usr = ((SSO)Session["Contexto"]).UserName.ToString() }; BitacoraExcepcionAplictivo.RegistrarBitacoraExcepcion(); BitacoraExcepcionAplictivo = null; } }
protected void ButtonExportarPdf_Click(object sender, EventArgs e) { ModeloNegocios.AcuseContrato objAcuseContrato; int intFolio; bool ConversionOK; //esta nos dice si es un número válido ConversionOK = int.TryParse(Request.QueryString["IdFolio"], out intFolio); StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter htw = new HtmlTextWriter(sw); Page page = new Page(); HtmlForm form = new HtmlForm(); page.EnableEventValidation = false; page.DesignerInitialize(); form = this.form1; form.FindControl("ButtonExportarPdf").Visible = false; page.Controls.Add(form); page.RenderControl(htw); string strCabecero = "<!DOCTYPE html> <html xmlns='http://www.w3.org/1999/xhtml'> <head runat='server'> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <title></title> <link href='https://framework-gb.cdn.gob.mx/assets/styles/main.css' rel='stylesheet'/> <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300' rel='stylesheet' type='text/css'/> <link href='https://framework-gb.cdn.gob.mx/favicon.ico' rel='shortcut icon'/> <style> @media print { #ZonaNoImrpimible {display:none;} } nav,aside { display: none; } .auto-style1 { height: 119px; } </style> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'></script> </head> <body>"; string strPie = "</body> </html>"; string strBotonExportar = "<asp:Button ID=\"ButtonExportarPdf\" runat=\"server\" CssClass=\"btn btn-default\" OnClick=\"ButtonExportarPdf_Click\" Text=\"Exportar a PDF\" ToolTip=\"Exportar a PDF.\" />"; string strBotonImprimir = "<input type=\"button\" id=\"ButtonImprimir\" value=\"Imprimir\" onclick=\"javascript: window.print()\" class=\"btn\" />"; //RCA 10/08/2017 string strImagenLogoIndaabinHtml = "url('http://sistemas.indaabin.gob.mx/ImagenesComunes/INDAABIN_01.jpg')"; string strImagenLogoIndaabinFisica = "../Imagenes/logoindaabin.jpg"; string strBrakePage = "page-break-before: always;"; //RCA 10/08/2017 //cambio de ruta a rutas relativas string strImagenEscudoNacionalHtml = "url('http://sistemas.indaabin.gob.mx/ImagenesComunes/aguila.png')"; string strImagenEscudoNacionalFisica = "../Imagenes/EscudoNacional.png"; string strCuerpoOriginal = sb.ToString(); string strPaginaConCuerpo = strCabecero + strCuerpoOriginal + strPie; string strCuerpoFormateado = especialesHTML(strPaginaConCuerpo).Replace(strImagenLogoIndaabinHtml, strImagenLogoIndaabinFisica).Replace(strImagenEscudoNacionalHtml, strImagenEscudoNacionalFisica).Replace(strBotonImprimir, "").Replace(strBotonExportar, "").Replace(strBrakePage, ""); //cambiamos formato si pasa del 1/12/2018 //poner la url del nuevo logo si pasa del 1 de diciembre de 2018 if (ConversionOK) { objAcuseContrato = new NG_ContratoArrto().ObtenerAcuseContrato(intFolio); string fecha = objAcuseContrato.FechaAutorizacion.ToString(); string[] nuevafecha = fecha.Split('/'); string[] ano = nuevafecha[2].Split(' '); string dia = nuevafecha[0]; string mes = nuevafecha[1]; string year = ano[0]; if (Convert.ToInt32(year) >= 2018) { if (Convert.ToInt32(mes) >= 12) { if (Convert.ToInt32(dia) >= 1) { strCuerpoFormateado = strCuerpoFormateado.Replace("src=\"http://sistemas.indaabin.gob.mx/ImagenesComunes/INDAABIN_01.jpg\"", "src=\"https://sistemas.indaabin.gob.mx/ImagenesComunes/SHCP-INDAABINREDUCIDO.PNG\""); strCuerpoFormateado = strCuerpoFormateado.Replace("url(http://sistemas.indaabin.gob.mx/ImagenesComunes/aguila.png);", "url(https://sistemas.indaabin.gob.mx/ImagenesComunes/nuevoescudo.png);"); strCuerpoFormateado = strCuerpoFormateado.Replace("background-position: center;", "background-position: left;"); strCuerpoFormateado = strCuerpoFormateado.Replace("##font##", "font-family: Montserrat;"); strCuerpoFormateado = strCuerpoFormateado.Replace("##Viejo##", "display:none;"); } else { strCuerpoFormateado = strCuerpoFormateado.Replace("##Nuevo##", "display:none;"); } } else { strCuerpoFormateado = strCuerpoFormateado.Replace("##Nuevo##", "display:none;"); } } else { strCuerpoFormateado = strCuerpoFormateado.Replace("##Nuevo##", "display:none;"); } } ExportHTML exportar = new ExportHTML(); exportar.CanPrint = true; //RCA 10/18/2017 exportar.GenerarPDF(strCuerpoFormateado); }