Beispiel #1
0
 protected void GvNoticias_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         GridViewRow row        = GvNoticias.SelectedRow;
         string      Id_Noticia = "";
         HiddenField cod        = default(HiddenField);
         cod        = (HiddenField)row.FindControl("Id_Noticia");
         Id_Noticia = cod.Value;
         ServicioCom21.ServicioCom21 _administrador = new ServicioCom21.ServicioCom21();
         DataSet ds = _administrador.Com21_consulta_noticias_id(int.Parse(Id_Noticia));
         if (ds.Tables[2].Rows.Count > 0)
         {
             foreach (DataRow dr in ds.Tables[2].Rows)
             {
                 //seteo todos los valores de la consulta especifica
                 this.hfIdNoticias.Value     = dr[0].ToString();
                 this.txtinfo.Text           = dr[2].ToString();
                 this.txttitulo.Text         = dr[1].ToString();
                 this.txtdescripcion.Content = dr[3].ToString();
                 if (Convert.ToBoolean(dr[8].ToString()) == true)
                 {
                     cbactivar.Checked = true;
                 }
                 else
                 {
                     cbactivar.Checked = false;
                 }
                 img.ImageUrl = dr[4].ToString();
             }
             btnedit.Visible   = true;
             btninsert.Visible = false;
         }
     }
     catch (Exception Ex)
     {
         Console.WriteLine(Ex.Message);
         ScriptManager.RegisterStartupScript(upMantenimiento, upMantenimiento.GetType(), "click", "alert('Error Tecnico por favor espere unos minutos');", true);
     }
 }
Beispiel #2
0
    private void cargarproducto()
    {
        if (Request.QueryString["NS"] != null)
        {
            string notser = Request.QueryString["NS"].ToString();
            if (notser == "S")
            {
                if (Request.QueryString["IDS"] != null)
                {
                    ServicioCom21.ServicioCom21 _consulta = new ServicioCom21.ServicioCom21();
                    DataSet _serv = _consulta.Com21_consulta_servicios_id(int.Parse(Request.QueryString["IDS"].ToString()));
                    if (_serv.Tables[1].Rows.Count > 0)
                    {
                        foreach (DataRow r in _serv.Tables[1].Rows)
                        {
                            String _head = "<meta property=\"og:title\" content=\"" + r["Titulo"].ToString() + "\"/><meta property=\"og:url\" content=\"" + r["Url"].ToString() + "\"/><meta property=\"og:image\" content=\"" + "http://com21.com.ec/" + r["Img"].ToString() + "\"/><meta property=\"og:site_name\" content=\"http://designsie.com/\"/><meta property=\"og:description\" content=\"" + HttpUtility.HtmlEncode(r["DescripcioCorta"].ToString()) + "\"/><meta property=\"og:image:type\" content=\"image/jpg\" />" +
                                           "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/><script type=\"text/javascript\">    var NREUMQ = NREUMQ || []; NREUMQ.push([\"mark\", \"firstbyte\", new Date().getTime()]);</script><title>" + r["Titulo"].ToString() + "</title><meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0\"><meta name=\"description\" content=\"Default Description\"/><meta name=\"keywords\" content=\"com21sa, com21, misión y visión de com21, misión, visión, nosotros, contactenos, quienes somos, telefonía, computo, servicios, catalogo de productos, catalogo de productos, suministros de impresión, registrate, inicio sesión, suministros de impresión guayaquil, suministros de impresión guayaquil ecuador,  ventas, venta online, electrico, pc, computadoras, cableado de red, cableado electrico, láptop, portátil, software, hardware, mouse, teclado, memorias, memoria, discos duros, disco duro, parlantes, línea blanca, refrigeradoras, neveras, tv, televisores, lcd, led, cocinas, aires acondicionados, cpu, programas, monitor, monitores, celulares, notebooks, table, cable de red, ups, tarjetas de red, tarjetas de video, mantenimiento, toner, cableado estructurado, suministros de oficina, suministros de computación, accesorios de computo, camaras de vigilancia, camaras digitales, camaras web, pen drive, flash memory, suministros xerox, hp, dell, toshiba, LG, samsung, acer, mabe, indurama, modem, coby\"/><meta name=\"robots\" content=\"INDEX,FOLLOW\"/><link rel=\"icon\" href=\"http://designsie.com/images/logocom21icon.png\" type=\"image/x-icon\"/>" +
                                           "<link href='css/css056a.css?family=Playfair+Display' rel='stylesheet' type='text/css'/><link href='css/css4fe8.css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'/><link href='css/cssaa4a.css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'/><script type=\"text/javascript\" src=\"js/jspagina/jquery-1.7.min.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.prettyPhoto.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/superfish.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.easing.1.3.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.mobile.customized.min.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/scripts.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/easyTooltip.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.jcarousel.min.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.iosslider.min.js\"></script><!--[if lt IE 9]><style>	body {min-width: 960px !important;}	</style><![endif]--><link rel=\"stylesheet\" type=\"text/css\" href=\"css/styles.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/responsive.css\" media=\"all\"/>" +
                                           "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/superfish.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/camera.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/widgets.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/cloud-zoom.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/print.css\" media=\"print\"/><script type=\"text/javascript\" src=\"js/jspagina/prototype.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/ccard.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/validation.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/builder.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/effects.js\"></script>" +
                                           "<script type=\"text/javascript\" src=\"js/jspagina/dragdrop.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/controls.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/slider.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/js.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/form.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/translate.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/cookies.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/cloud-zoom.1.0.2.min.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/bootstrap.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/msrp.js\"></script><!--[if lt IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"http://livedemo00.template-help.com/magento_42968/skin/frontend/default/theme451/css/styles-ie.css\" media=\"all\" /><![endif]--><!--[if lt IE 7]><script type=\"text/javascript\" src=\"http://livedemo00.template-help.com/magento_42968/js/lib/ds-sleight.js\"></script><script type=\"text/javascript\" src=\"http://livedemo00.template-help.com/magento_42968/skin/frontend/base/default/js/ie6.js\"></script><![endif]-->" +
                                           "<script type=\"text/javascript\">//<![CDATA[    var Translator = new Translate([]);        //]]></script>";
                            cabecera_esp.InnerHtml = _head;

                            lbltitulo.Text          = r["Titulo"].ToString();
                            productos_web.InnerHtml = r["Descripcion"].ToString();
                            img.ImageUrl            = r["Img"].ToString();

                            String _titulo_dinamico = GenerateURLProducto(r["Titulo"].ToString(), r["Id_Servicio"].ToString(), "S");
                            Face.InnerHtml = "<iframe src='//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdesignsie.com%2F" + _titulo_dinamico + "&amp;send=false&amp;layout=button_count&amp;width=150&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21' scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:150px; height:21px;\" allowTransparency=\"true\"></iframe>";
                        }
                    }
                }
            }
            else
            {
                if (Request.QueryString["IDS"] != null)
                {
                    ServicioCom21.ServicioCom21 _consulta = new ServicioCom21.ServicioCom21();
                    DataSet _serv = _consulta.Com21_consulta_noticias_id(int.Parse(Request.QueryString["IDS"].ToString()));
                    if (_serv.Tables[1].Rows.Count > 0)
                    {
                        foreach (DataRow r in _serv.Tables[1].Rows)
                        {
                            String _head = "<meta property=\"og:title\" content=\"" + r["Titulo"].ToString() + "\"/><meta property=\"og:url\" content=\"" + r["Url"].ToString() + "\"/><meta property=\"og:image\" content=\"" + "http://com21.com.ec/" + r["Img"].ToString() + "\"/><meta property=\"og:site_name\" content=\"http://designsie.com/\"/><meta property=\"og:description\" content=\"" + HttpUtility.HtmlEncode(r["DescripcionCorta"].ToString()) + "\"/><meta property=\"og:image:type\" content=\"image/jpg\" />" +
                                           "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/><script type=\"text/javascript\">    var NREUMQ = NREUMQ || []; NREUMQ.push([\"mark\", \"firstbyte\", new Date().getTime()]);</script><title>" + r["Titulo"].ToString() + "</title><meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0\"><meta name=\"description\" content=\"Default Description\"/><meta name=\"keywords\" content=\"com21sa, com21, misión y visión de com21, misión, visión, nosotros, contactenos, quienes somos, telefonía, computo, servicios, catalogo de productos, catalogo de productos, suministros de impresión, registrate, inicio sesión, suministros de impresión guayaquil, suministros de impresión guayaquil ecuador,  ventas, venta online, electrico, pc, computadoras, cableado de red, cableado electrico, láptop, portátil, software, hardware, mouse, teclado, memorias, memoria, discos duros, disco duro, parlantes, línea blanca, refrigeradoras, neveras, tv, televisores, lcd, led, cocinas, aires acondicionados, cpu, programas, monitor, monitores, celulares, notebooks, table, cable de red, ups, tarjetas de red, tarjetas de video, mantenimiento, toner, cableado estructurado, suministros de oficina, suministros de computación, accesorios de computo, camaras de vigilancia, camaras digitales, camaras web, pen drive, flash memory, suministros xerox, hp, dell, toshiba, LG, samsung, acer, mabe, indurama, modem, coby\"/><meta name=\"robots\" content=\"INDEX,FOLLOW\"/><link rel=\"icon\" href=\"http://designsie.com/images/logocom21icon.png\" type=\"image/x-icon\"/>" +
                                           "<link href='css/css056a.css?family=Playfair+Display' rel='stylesheet' type='text/css'/><link href='css/css4fe8.css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'/><link href='css/cssaa4a.css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'/><script type=\"text/javascript\" src=\"js/jspagina/jquery-1.7.min.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.prettyPhoto.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/superfish.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.easing.1.3.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.mobile.customized.min.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/scripts.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/easyTooltip.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.jcarousel.min.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/jquery.iosslider.min.js\"></script><!--[if lt IE 9]><style>	body {min-width: 960px !important;}	</style><![endif]--><link rel=\"stylesheet\" type=\"text/css\" href=\"css/styles.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/responsive.css\" media=\"all\"/>" +
                                           "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/superfish.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/camera.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/widgets.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/cloud-zoom.css\" media=\"all\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"css/print.css\" media=\"print\"/><script type=\"text/javascript\" src=\"js/jspagina/prototype.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/ccard.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/validation.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/builder.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/effects.js\"></script>" +
                                           "<script type=\"text/javascript\" src=\"js/jspagina/dragdrop.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/controls.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/slider.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/js.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/form.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/translate.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/cookies.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/cloud-zoom.1.0.2.min.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/bootstrap.js\"></script><script type=\"text/javascript\" src=\"js/jspagina/msrp.js\"></script><!--[if lt IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"http://livedemo00.template-help.com/magento_42968/skin/frontend/default/theme451/css/styles-ie.css\" media=\"all\" /><![endif]--><!--[if lt IE 7]><script type=\"text/javascript\" src=\"http://livedemo00.template-help.com/magento_42968/js/lib/ds-sleight.js\"></script><script type=\"text/javascript\" src=\"http://livedemo00.template-help.com/magento_42968/skin/frontend/base/default/js/ie6.js\"></script><![endif]-->" +
                                           "<script type=\"text/javascript\">//<![CDATA[    var Translator = new Translate([]);        //]]></script>";
                            cabecera_esp.InnerHtml = _head;

                            lbltitulo.Text          = r["Titulo"].ToString();
                            productos_web.InnerHtml = r["Descripcion"].ToString();
                            img.ImageUrl            = r["Img"].ToString();

                            String _titulo_dinamico = GenerateURLProducto(r["Titulo"].ToString(), r["Id_Noticia"].ToString(), "N");
                            Face.InnerHtml = "<iframe src='//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdesignsie.com%2F" + _titulo_dinamico + "&amp;send=false&amp;layout=button_count&amp;width=150&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21' scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:150px; height:21px;\" allowTransparency=\"true\"></iframe>";
                        }
                    }
                }
            }
        }
    }
    private void cargarHead()
    {
        String url = HttpContext.Current.Request.Url.Host;

        ServicioCom21.ServicioCom21 _consulta = new ServicioCom21.ServicioCom21();
        if (Request.QueryString["T"] != null)
        {
            string tipo = Request.QueryString["T"].ToString();
            switch (tipo)
            {
            case "P":
                if (Request.QueryString["ID"] != null)
                {
                    String  _idprod  = Request.QueryString["ID"].ToString();
                    DataSet _product = _consulta.Com21_consulta_productos_id_Web(int.Parse(_idprod));
                    if (_product.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow r in _product.Tables[0].Rows)
                        {
                            imgMeta.Content         = url + r["Imagen"].ToString();
                            titleMeta.Content       = r["Titulo"].ToString();
                            titlePage.Text          = r["Titulo"].ToString();
                            urlMeta.Content         = url + r["UrlProducto"].ToString();
                            linkUrl.Href            = url + r["UrlProducto"].ToString();
                            descripcionMeta.Content = HttpUtility.HtmlDecode(r["Descripcion"].ToString());
                            Desp.Content            = HttpUtility.HtmlDecode(r["Descripcion"].ToString());
                        }
                    }
                }
                break;

            case "S":
                if (Request.QueryString["ID"] != null)
                {
                    String  _idprod  = Request.QueryString["ID"].ToString();
                    DataSet _product = _consulta.Com21_consulta_servicios_id(int.Parse(_idprod));
                    if (_product.Tables[1].Rows.Count > 0)
                    {
                        foreach (DataRow r in _product.Tables[1].Rows)
                        {
                            imgMeta.Content         = url + r["Img"].ToString();
                            titleMeta.Content       = r["Titulo"].ToString();
                            titlePage.Text          = r["Titulo"].ToString();
                            urlMeta.Content         = url + r["Url"].ToString();
                            linkUrl.Href            = url + r["Url"].ToString();
                            descripcionMeta.Content = r["DescripcioCorta"].ToString();    //HttpUtility.HtmlEncode(r["Descripcion"].ToString());
                            Desp.Content            = HttpUtility.HtmlEncode(r["DescripcioCorta"].ToString());
                        }
                    }
                }
                break;

            case "N":
                if (Request.QueryString["ID"] != null)
                {
                    String  _idprod  = Request.QueryString["ID"].ToString();
                    DataSet _product = _consulta.Com21_consulta_noticias_id(int.Parse(_idprod));
                    if (_product.Tables[1].Rows.Count > 0)
                    {
                        foreach (DataRow r in _product.Tables[1].Rows)
                        {
                            imgMeta.Content         = url + r["Img"].ToString();
                            titleMeta.Content       = r["Titulo"].ToString();
                            titlePage.Text          = r["Titulo"].ToString();
                            urlMeta.Content         = url + r["Url"].ToString();
                            linkUrl.Href            = url + r["Url"].ToString();
                            descripcionMeta.Content = HttpUtility.HtmlEncode(r["DescripcionCorta"].ToString());
                            Desp.Content            = HttpUtility.HtmlEncode(r["DescripcionCorta"].ToString());
                        }
                    }
                }
                break;

            case "F":
                if (Request.QueryString["ID"] != null)
                {
                    String  _idprod  = Request.QueryString["ID"].ToString();
                    DataSet _product = _consulta.Com21_consulta_noticias_id(int.Parse(_idprod));
                    if (_product.Tables[3].Rows.Count > 0)
                    {
                        foreach (DataRow r in _product.Tables[3].Rows)
                        {
                            imgMeta.Content         = url + r["Img"].ToString();
                            titleMeta.Content       = r["Titulo"].ToString();
                            titlePage.Text          = r["Titulo"].ToString();
                            urlMeta.Content         = url + r["Url"].ToString();
                            linkUrl.Href            = url + r["Url"].ToString();
                            descripcionMeta.Content = HttpUtility.HtmlEncode(r["DescripcionCorta"].ToString());
                            Desp.Content            = HttpUtility.HtmlEncode(r["DescripcionCorta"].ToString());
                        }
                    }
                }
                break;
            }
        }
    }