예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null || Session["UserName"].ToString() == "")
            {
                Response.Redirect("~/Default.aspx");
            }
            List <THE_SesionUsuario> existeSesion = MngNegocioUsuarioSesion.VerExisteSesionUsuario(Int32.Parse(Session["numeroUsuario"].ToString()), Session["UserIP"].ToString());

            if (existeSesion.Count == 0)
            {
                return;
            }

            try
            {
                if (!IsPostBack)
                {
                    TDI_LogPaginas logPaginas = new TDI_LogPaginas();
                    logPaginas.LogFecha              = DateTime.Now;
                    logPaginas.LogIp                 = Session["UserIP"].ToString();
                    logPaginas.LogUrlPagina          = Request.RawUrl;
                    logPaginas.EmpleadoLlavePrimaria = new THE_Empleado {
                        EmpleadoLlavePrimaria = int.Parse(Session["numeroUsuario"].ToString())
                    };
                    MngNegocioLogPaginas.GuardarLogPaginas(logPaginas);
                }

                string IdUsuario     = Request.QueryString["data"];
                string IdDispositivo = Request.QueryString["guid"];
                if (IdDispositivo != "NO")
                {
                    List <TDI_UsuarioDispositivo> usuaDis = MngNegocioUsuarioDispositivo.ObtieneDispoUsuarioPorIdDispo(int.Parse(IdDispositivo));
                    if (usuaDis.Count > 0)
                    {
                        lblNombreUsua.Text = usuaDis[0].UsuarioLlavePrimaria.UsuarioNombre;
                        lblDispoNum.Text   = usuaDis[0].IdDispositivo.NumerodelTelefono;
                        lblEstado.Text     = usuaDis[0].UsuarioLlavePrimaria.EstadoInfo.EstadoNombre;
                    }
                }
                else
                {
                    List <TDI_UsuarioDispositivo> usuDispo = MngNegocioUsuarioDispositivo.ObtieneDispositivoPorUsuario(int.Parse(IdUsuario));
                    if (usuDispo.Count > 0)
                    {
                        lblNombreUsua.Text = usuDispo[0].UsuarioLlavePrimaria.UsuarioNombre;
                        lblDispoNum.Text   = usuDispo[0].IdDispositivo.NumerodelTelefono;
                        lblEstado.Text     = usuDispo[0].UsuarioLlavePrimaria.EstadoInfo.EstadoNombre;
                    }
                    else
                    {
                    }
                }
            }
            catch (Exception ex)
            {
                EncuestasMoviles.Clases.Error.ManejadorErrores(ex, Session["numeroUsuario"].ToString(), Session["UserDomain"].ToString(), Session["userMachineName"].ToString(), Session["UserIP"].ToString(), "DispositivoInfo", int.Parse(Session["numeroUsuario"].ToString()));
            }
            finally {
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.AddHeader("Cache-Control", "no-store");
            Response.AddHeader("Pragma", "no-cache");
            Response.AddHeader("Cache-Control", "no-cache, must-revalidate");
            Response.Expires = -1;
            if (Session["UserName"] == null || Session["UserName"].ToString() == "")
            {
                Response.Redirect("~/Default.aspx");
            }

            List <THE_SesionUsuario> existeSesion = MngNegocioUsuarioSesion.VerExisteSesionUsuario(Int32.Parse(Session["numeroUsuario"].ToString()), Session["UserIP"].ToString());

            if (existeSesion.Count == 0)
            {
                Session["nombreUsuario"] = null;
                Session["numeroUsuario"] = null;
                Session["UserName"]      = null;
                Session["UserDomain"]    = null;
                Session["UserIP"]        = null;
                Session["UserPuesto"]    = null;
                Session["NomPuesto"]     = null;
                ctrlMessageBox.AddMessage("Su sesion ha expirado", MessageBox.enmMessageType.Info, true, false, "Sesion", "Sesion Expirada");
            }


            if (!Page.IsPostBack)
            {
                LlenaMenu();
            }
        }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (Session["UserName"] == null || Session["UserName"].ToString() == "")
         {
             Response.Redirect("~/Default.aspx");
         }
         else
         {
             List <THE_SesionUsuario> existeSesion = MngNegocioUsuarioSesion.VerExisteSesionUsuario(Int32.Parse(Session["numeroUsuario"].ToString()), (Session["UserIP"].ToString()));
             if (existeSesion.Count == 0)
             {
                 Session["nombreUsuario"] = null;
                 Session["numeroUsuario"] = null;
                 Session["UserName"]      = null;
                 Session["UserDomain"]    = null;
                 Session["UserIP"]        = null;
                 Session["UserPuesto"]    = null;
                 Session["NomPuesto"]     = null;
                 Response.Redirect("~/Default.aspx");
             }
         }
     }
     catch
     {
     }
     finally {
     }
 }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null || Session["UserName"].ToString() == "")
            {
                Response.Redirect("~/Default.aspx");
            }

            List <THE_SesionUsuario> existeSesion = MngNegocioUsuarioSesion.VerExisteSesionUsuario(Int32.Parse(Session["numeroUsuario"].ToString()), Session["UserIP"].ToString());

            if (existeSesion.Count == 0)
            {
                return;
            }

            try
            {
                if (!IsPostBack)
                {
                    List <TDI_BaseRespuestas> empl2 = MngNegocioBaseRespuestas.ObtenerRespFrecuentes();

                    TDI_LogPaginas logPaginas = new TDI_LogPaginas();
                    logPaginas.LogFecha              = DateTime.Now;
                    logPaginas.LogIp                 = Session["UserIP"].ToString();
                    logPaginas.LogUrlPagina          = Request.RawUrl;
                    logPaginas.EmpleadoLlavePrimaria = new THE_Empleado {
                        EmpleadoLlavePrimaria = int.Parse(Session["numeroUsuario"].ToString())
                    };
                    MngNegocioLogPaginas.GuardarLogPaginas(logPaginas);

                    List <THE_Encuesta> encuGra = MngNegocioEncuesta.ObtieneEncuestasActivas();

                    if (encuGra.Count > 0)
                    {
                        RadComboBox1.DataSource     = encuGra;
                        RadComboBox1.DataTextField  = "Nombreencuesta";
                        RadComboBox1.DataValueField = "IdEncuesta";
                        RadComboBox1.DataBind();

                        //List<THE_Usuario> Usuario = MngNegocioUsuario.ObtieneTodosUsuarios();

                        //foreach (var us in Usuario)
                        //{
                        //    us.UsuarioNombre = us.UsuarioNombre + " " + us.UsuarioApellPaterno + " " + us.UsuarioApellMaterno;
                        //}

                        //if (Usuario.Count > 0)
                        //{
                        //    RadComboBox2.DataSource = Usuario;
                        //    RadComboBox2.DataTextField = "UsuarioNombre";
                        //    RadComboBox2.DataValueField = "UsuarioLlavePrimaria";
                        //    RadComboBox2.DataBind();
                        //}
                    }
                }
            }
            catch (Exception msException)
            {
            }
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["UserName"] == null || Session["UserName"].ToString() == "")
                {
                    Response.Redirect("~/Default.aspx");
                }

                List <THE_SesionUsuario> existeSesion = MngNegocioUsuarioSesion.VerExisteSesionUsuario(Int32.Parse(Session["numeroUsuario"].ToString()), Session["UserIP"].ToString());
                if (existeSesion.Count == 0)
                {
                    return;
                }

                if (!IsPostBack)
                {
                    TDI_LogPaginas logPaginas = new TDI_LogPaginas();
                    logPaginas.LogFecha              = DateTime.Now;
                    logPaginas.LogIp                 = Session["UserIP"].ToString();
                    logPaginas.LogUrlPagina          = Request.RawUrl;
                    logPaginas.EmpleadoLlavePrimaria = new THE_Empleado {
                        EmpleadoLlavePrimaria = int.Parse(Session["numeroUsuario"].ToString())
                    };
                    MngNegocioLogPaginas.GuardarLogPaginas(logPaginas);
                }

                try
                {
                    CargaDatos();
                    ctrlMessageBox.MsgBoxAnswered += new MessageBox.MsgBoxEventHandler(ctrlMessageBox_MsgBoxAnswered);
                }
                catch (Exception ex)
                {
                    EncuestasMoviles.Clases.Error.ManejadorErrores(ex, Session["UserName"].ToString(), Session["UserDomain"].ToString(), Session["userMachineName"].ToString(), Session["UserIP"].ToString(), "frmCatalogos", int.Parse(Session["numeroUsuario"].ToString()));
                }
            }
            catch (Exception ms)
            {
            }
            finally {
            }
        }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null || Session["UserName"].ToString() == "")
            {
                Response.Redirect("~/Default.aspx");
            }

            List <THE_SesionUsuario> existeSesion = MngNegocioUsuarioSesion.VerExisteSesionUsuario(Int32.Parse(Session["numeroUsuario"].ToString()), Session["UserIP"].ToString());

            if (existeSesion.Count == 0)
            {
                return;
            }

            try {
                if (!IsPostBack)
                {
                    TDI_LogPaginas logPaginas = new TDI_LogPaginas();
                    logPaginas.LogFecha              = DateTime.Now;
                    logPaginas.LogIp                 = Session["UserIP"].ToString();
                    logPaginas.LogUrlPagina          = Request.RawUrl;
                    logPaginas.EmpleadoLlavePrimaria = new THE_Empleado {
                        EmpleadoLlavePrimaria = int.Parse(Session["numeroUsuario"].ToString())
                    };
                    MngNegocioLogPaginas.GuardarLogPaginas(logPaginas);

                    //List<THE_Encuesta> encuGra = MngNegocioEncuesta.ObtieneEncuestasActivas();

                    //if (encuGra.Count > 0)
                    //{
                    //    cbEncuestas.DataSource = encuGra;
                    //    cbEncuestas.DataTextField = "Nombreencuesta";
                    //    cbEncuestas.DataValueField = "IdEncuesta";
                    //    cbEncuestas.DataBind();
                    //}
                }
            }
            catch (Exception ms)
            {
            }
        }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["UserName"] == null || Session["UserName"].ToString() == "")
                {
                    Response.Redirect("~/Default.aspx");
                }

                List <THE_SesionUsuario> existeSesion = MngNegocioUsuarioSesion.VerExisteSesionUsuario(Int32.Parse(Session["numeroUsuario"].ToString()), Session["UserIP"].ToString());
                if (existeSesion.Count == 0)
                {
                    return;
                }

                if (!IsPostBack)
                {
                    using (MemoryStream myMemoryStream = new MemoryStream())
                    {
                        Document              document   = new Document(iTextSharp.text.PageSize.LEGAL.Rotate());
                        PdfWriter             PDFWriter  = PdfWriter.GetInstance(document, myMemoryStream);
                        string                map        = Server.MapPath("~/Images/Header.png");
                        iTextSharp.text.Image encabezado = iTextSharp.text.Image.GetInstance(map);
                        encabezado.ScaleAbsoluteWidth(document.PageSize.Width - 70);
                        encabezado.ScaleAbsoluteHeight(80);
                        var mySize = document.PageSize;
                        document.AddHeader("Content-Disposition", "attachment; filename=wissalReport.pdf");

                        document.Open();
                        int recorre = Convert.ToInt32(HttpContext.Current.Application.Get("contador").ToString());

                        for (int i = 0; i < recorre; i++)
                        {
                            Chunk chunk = new Chunk(DateTime.Now.ToString(), FontFactory.GetFont("ARIAL", 12, iTextSharp.text.Font.NORMAL));
                            document.Add(new Paragraph(chunk));

                            document.Add(encabezado);

                            Byte[] imagebyte = Convert.FromBase64String(HttpContext.Current.Application.Get(i.ToString()).ToString());
                            iTextSharp.text.Image myImage = iTextSharp.text.Image.GetInstance(imagebyte);
                            float wid = 700;
                            float heg = 420;
                            myImage.ScaleAbsolute(wid, heg);
                            myImage.Alignment = Element.ALIGN_CENTER;
                            document.Add(myImage);
                        }

                        document.Close();
                        byte[] content = myMemoryStream.ToArray();
                        HttpContext.Current.Response.Buffer = false;
                        HttpContext.Current.Response.Clear();
                        HttpContext.Current.Response.ClearContent();
                        HttpContext.Current.Response.ClearHeaders();
                        HttpContext.Current.Response.AppendHeader("content-disposition", "attachment;filename=" + "my_report.pdf");
                        HttpContext.Current.Response.ContentType = "Application/pdf";
                        HttpContext.Current.Response.BinaryWrite(content);
                        HttpContext.Current.Response.Flush();
                        HttpContext.Current.Response.End();
                    }
                }
            }catch (Exception ms) {
            }finally{}
        }