protected void Load_ListBox()
        {
            DBConn oConn = new DBConn();

            if (oConn.Open())
            {
                cAppVistasCliente oAppVistasCliente = new cAppVistasCliente(ref oConn);
                oAppVistasCliente.CodCliente = CodCliente.Value;
                oAppVistasCliente.NotIn      = true;
                DataTable dtVistaCliente = oAppVistasCliente.Get();
                if (dtVistaCliente != null)
                {
                    foreach (DataRow oRow in dtVistaCliente.Rows)
                    {
                        ListBox1.Items.Add(new ListItem(oRow["desc_monitor_view"].ToString(), oRow["cod_monitor"].ToString()));
                    }
                }
                dtVistaCliente = null;

                oAppVistasCliente.NotIn = false;
                dtVistaCliente          = oAppVistasCliente.Get();
                if (dtVistaCliente != null)
                {
                    foreach (DataRow oRow in dtVistaCliente.Rows)
                    {
                        ListBox2.Items.Add(new ListItem(oRow["desc_monitor_view"].ToString(), oRow["cod_monitor"].ToString()));
                    }
                }
                dtVistaCliente = null;
                oConn.Close();
            }
        }
        protected void LoadGrid()
        {
            DBConn oConn = new DBConn();

            if (oConn.Open())
            {
                cAppVistasCliente oAppVistasCliente = new cAppVistasCliente(ref oConn);
                oAppVistasCliente.CodCliente = CodCliente.Value;
                oAppVistasCliente.NotIn      = false;
                gridVistas.DataSource        = oAppVistasCliente.Get();
                gridVistas.DataBind();

                oConn.Close();
            }
        }
Esempio n. 3
0
        protected void getMonitores()
        {
            StringBuilder sUrlPage;
            StringBuilder sHtml = new StringBuilder();

            dcControlPanel.Conn.DBConn oConn = new dcControlPanel.Conn.DBConn();

            if (oConn.Open())
            {
                cAppVistasCliente oAppVistasCliente = new cAppVistasCliente(ref oConn);
                oAppVistasCliente.CodCliente = oIsUsuario.CodUsuario;
                oAppVistasCliente.NotIn      = false;
                DataTable DataVista = oAppVistasCliente.Get();

                foreach (DataRow oRow in DataVista.Rows)
                {
                    cAptMonitorPages oAptMonitorPages = new cAptMonitorPages(ref oConn);
                    oAptMonitorPages.CodMonitor = oRow["cod_monitor"].ToString();
                    DataTable dtmPage = oAptMonitorPages.Get();
                    if (dtmPage != null)
                    {
                        if (dtmPage.Rows.Count > 0)
                        {
                            string indexToken = string.Empty;
                            if (string.IsNullOrEmpty(dtmPage.Rows[0]["cod_cliente"].ToString()))
                            {
                                indexToken          = oRow["cod_monitor"].ToString() + DateTime.Now.ToString("yyyyMMdd");
                                Session[indexToken] = 0;
                            }
                            sUrlPage = new StringBuilder();
                            sUrlPage.Append(dtmPage.Rows[0]["url_page"].ToString());
                            sUrlPage.Append("?codmonitor=").Append(oRow["cod_monitor"].ToString());
                            sUrlPage.Append("&codusuario=").Append(oIsUsuario.CodUsuario);
                            sUrlPage.Append("&authuser="******"&indexToken=").Append(indexToken);
                            sUrlPage.Append("&order=").Append(dtmPage.Rows[0]["order_page"].ToString());

                            sHtml.Append("<div class=\"col-md-6 wow fadeInUp\" data-wow-duration=\"4s\" data-wow-delay=\"1s\">");
                            sHtml.Append("<iframe src =\"/PaneldeControl/" + sUrlPage.ToString() + "\" width=\"600px\" height=\"300px\" scrolling=\"no\"></iframe>");
                            sHtml.Append("</div>");
                        }
                    }
                }
                idpanel.Controls.Add(new LiteralControl(sHtml.ToString()));
            }
            oConn.Close();
        }