protected void btnSeleccion_Click(object sender, EventArgs e)
        {
            foreach (GridDataItem item in grdNotificacionEmpleado.SelectedItems)
            {
                vIdPuesto = item.GetDataKeyValue("ID_PUESTO").ToString();

                vEmpleadosSeleccionados.Add(new E_OBTIENE_PUESTO_EMPLEADOS
                {
                    ID_PUESTO = vIdPuesto,
                    FG_ACTIVO = true,
                });

                var vXelements = vEmpleadosSeleccionados.Select(x =>
                                                                new XElement("PUESTO",
                                                                             new XAttribute("ID_PUESTO", x.ID_PUESTO),
                                                                             new XAttribute("FG_ACTIVO", x.FG_ACTIVO)
                                                                             ));
                SELECCIONEMPLEADOS =
                    new XElement("SELECCION", vXelements
                                 );
            }

            if (SELECCIONEMPLEADOS != null)
            {
                ConfiguracionNotificacionNegocio puesto = new ConfiguracionNotificacionNegocio();
                E_RESULTADO vResultado = puesto.SPE_INSERTA_ACTUALIZA_EMPLEADO_NOTIFICACION_PUESTO_PDE(SELECCIONEMPLEADOS.ToString(), vClUsuario, vNbPrograma);
                string      vMensaje   = vResultado.MENSAJE.Where(w => w.CL_IDIOMA.Equals(vClIdioma.ToString())).FirstOrDefault().DS_MENSAJE;
                UtilMensajes.MensajeResultadoDB(rnMensaje, vMensaje, E_TIPO_RESPUESTA_DB.SUCCESSFUL, pCallBackFunction: "onCloseWindow");
            }
            else
            {
                UtilMensajes.MensajeResultadoDB(rnMensaje, "Selecciona a quién enviar la notificación", E_TIPO_RESPUESTA_DB.WARNING, pCallBackFunction: "");
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vClUsuario  = ContextoUsuario.oUsuario.CL_USUARIO;
            vNbPrograma = ContextoUsuario.nbPrograma;

            if (!IsPostBack)
            {
                ConfiguracionNotificacionNegocio nConfiguracionNotificacion = new ConfiguracionNotificacionNegocio();
                var notificacion = nConfiguracionNotificacion.ObtenerNotificaciones();
                if (notificacion.Count > 0)
                {
                    parseNotificarConfiguracion(notificacion);
                    if (vConfiguracionesNotificacion != null)
                    {
                        XElement notificaciones = XElement.Parse(vConfiguracionesNotificacion.FirstOrDefault().XML_INSTRUCCION);
                        DeserializarDocumentoAutorizar(notificaciones);
                        if (vNotificacionRegistrar != null)
                        {
                            txtDsNotas.Content = vNotificacionRegistrar.DS_INSTRUCCION.ToString();
                        }

                        if (vNotificacionAdministrar != null)
                        {
                            txtDsNotas2.Content = vNotificacionAdministrar.DS_INSTRUCCION.ToString();
                        }
                        if (vComunicado != null)
                        {
                            txtDsNotas3.Content = vComunicado.DS_INSTRUCCION.ToString();
                        }
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            vUsuarioSeleccion       = "";
            vNbPrograma             = ContextoUsuario.nbPrograma;
            vClUsuario              = ContextoUsuario.oUsuario.CL_USUARIO;
            vEmpleadosSeleccionados = new List <E_OBTIENE_PUESTO_EMPLEADOS>();
            if (!IsPostBack)
            {
                ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();
                ListaEmpleados    = new List <E_EMPLEADO_PDE>();
                xmlPuestoEmpleado = negocio.ObtienePuestoEmpleado(null, null);
                XElement root = XElement.Parse(xmlPuestoEmpleado);
                foreach (XElement name in root.Elements("EMPLEADO"))
                {
                    E_EMPLEADO_PDE em = new E_EMPLEADO_PDE
                    {
                        ID_EMPLEADO  = name.Attribute("ID_EMPLEADO").Value,
                        ID_PUESTO    = name.Attribute("ID_PUESTO").Value,
                        NB_PUESTO    = name.Attribute("NB_PUESTO").Value,
                        NB_EMPLEADO  = name.Attribute("NB_EMPLEADO").Value,
                        M_CL_USUARIO = name.Attribute("CL_USUARIO").Value,
                    };
                    ListaEmpleados.Add(em);
                }
            }

            grdEmpleadosSeleccionados.DataSource = ListaEmpleados;
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AdscripcionesNegocio negocioa = new AdscripcionesNegocio();
            string adscripcionVisible     = negocioa.SeleccionaAdscripcion().ToString();

            if (adscripcionVisible != "No")
            {
                vTipoTransaccion = "49";
            }
            else
            {
                vTipoTransaccion = "50";
            }

            // vServidor = HttpContext.Current.Request.Url.Authority;
            //  UtilMensajes.MensajeResultadoDB(rnMensaje, "direccion: " + url, E_TIPO_RESPUESTA_DB.WARNING, pCallBackFunction: "");
            url = Request.Url.GetLeftPart(UriPartial.Authority) + Page.ResolveUrl("VisorComunicados.aspx");
            // urlrel = "~/VisorComunicados.aspx";
            //vServidor = Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath;
            vNotificacionAdministrar = new E_OBTIENE_PUESTO_EMPLEADOS();
            vIdEmpleado = ContextoUsuario.oUsuario.CL_USUARIO;
            vClUsuario  = ContextoUsuario.oUsuario.CL_USUARIO;
            vNbPrograma = ContextoUsuario.nbPrograma;
            ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();

            Nombre.InnerText  = " " + ContextoUsuario.oUsuario.NB_USUARIO;
            xmlPuestoEmpleado = negocio.ObtienePuestoEmpleado(null, vClUsuario);
            XElement root        = null;
            XElement vXmlUsuario = null;

            if (xmlPuestoEmpleado != null)
            {
                root = XElement.Parse(xmlPuestoEmpleado);
            }
            if (root != null)
            {
                vXmlUsuario = root.Elements("EMPLEADO").Where(t => t.Attribute("CL_USUARIO").Value == (vClUsuario != null ? vClUsuario.ToString() : "")).FirstOrDefault();
            }
            if (vXmlUsuario != null)
            {
                vEsDeRRHH = true;
            }
            else
            {
                vEsDeRRHH = false;
            }
            if (!IsPostBack)
            {
                if (vEsDeRRHH == true)
                {
                    ModificacionesNotificaciones.Visible = true;
                    pendientes.Visible = true;
                }
                else
                {
                    ModificacionesNotificaciones.Visible = false;
                    pendientes.Visible = false;
                }
            }
        }
예제 #5
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            String vTipoTransaccion = "";

            if (vNotificacionRegistrar != null && vNotificacionAdministrar != null)
            {
                vTipoTransaccion = E_TIPO_OPERACION_DB.A.ToString();
            }
            else
            {
                vTipoTransaccion = E_TIPO_OPERACION_DB.I.ToString();
            }
            var vXelementNotificacionRegistrar =
                new XElement("INSTRUCCION",
                             new XAttribute("DS_INSTRUCCION", txtDsNotas.Content)
                             );

            var vXelementNotificacionAdministrar =
                new XElement("INSTRUCCION",
                             new XAttribute("DS_INSTRUCCION", txtDsNotas2.Content)
                             );

            var vXelementComunicados =
                new XElement("INSTRUCCION",
                             new XAttribute("DS_INSTRUCCION", txtDsNotas3.Content)
                             );

            XElement vXelementCompleto =
                new XElement("CONFIGURACIONES",
                             new XElement("REGISTRAR", vXelementNotificacionRegistrar),
                             new XElement("ADMINISTRAR", vXelementNotificacionAdministrar),
                             new XElement("COMUNICADOS", vXelementComunicados));

            if (vConfiguracionesNotificacion == null)
            {
                vConfiguracionesNotificacion = new List <E_CONFIGURACION_NOTIFICACION>();
                vConfiguracionesNotificacion.Add(new E_CONFIGURACION_NOTIFICACION {
                    ID_CONFIGURACION_NOTIFICACION = 1, XML_INSTRUCCION = vXelementCompleto.ToString()
                });
            }

            if (vConfiguracionesNotificacion.Count > 0)
            {
                vConfiguracionesNotificacion.FirstOrDefault().XML_INSTRUCCION = vXelementCompleto.ToString();
                ConfiguracionNotificacionNegocio nConfiguracion = new ConfiguracionNotificacionNegocio();
                E_RESULTADO vResultado = nConfiguracion.INSERTA_ACTUALIZA_CONFIGURACION_NOTIFICACION(vTipoTransaccion, vConfiguracionesNotificacion.FirstOrDefault(), vClUsuario, vNbPrograma);
                string      vMensaje   = vResultado.MENSAJE.Where(w => w.CL_IDIOMA.Equals(vClIdioma.ToString())).FirstOrDefault().DS_MENSAJE;
                UtilMensajes.MensajeResultadoDB(rwmMensaje, vMensaje, vResultado.CL_TIPO_ERROR, 400, 150);
            }
        }
        protected void btnSeleccion_Click(object sender, EventArgs e)
        {
            string vIDUsuario;
            string vIDEmpleado;
            string vIdPuesto;

            vEmpleadosSeleccionados = new List <E_OBTIENE_PUESTO_EMPLEADOS>();

            foreach (GridDataItem item in grdEmpleadosSeleccionados.MasterTableView.Items)
            {
                vIDEmpleado = (item.GetDataKeyValue("ID_EMPLEADO").ToString());
                vIDUsuario  = item.GetDataKeyValue("M_CL_USUARIO") == null ? "" : (item.GetDataKeyValue("M_CL_USUARIO").ToString());
                vIdPuesto   = item.GetDataKeyValue("ID_PUESTO") == null ? "" : (item.GetDataKeyValue("ID_PUESTO").ToString());
                vNbPuesto   = item.GetDataKeyValue("NB_PUESTO") == null ? "" : (item.GetDataKeyValue("NB_PUESTO").ToString());

                vEmpleadosSeleccionados.Add(new E_OBTIENE_PUESTO_EMPLEADOS
                {
                    ID_EMPLEADO = vIDEmpleado,
                    CL_USUARIO  = vIDUsuario,
                    ID_PUESTO   = vIdPuesto,
                    NB_PUESTO   = vNbPuesto
                });

                var vXelements = vEmpleadosSeleccionados.Select(x =>
                                                                new XElement("EMPLEADO",
                                                                             new XAttribute("ID_EMPLEADO", x.ID_EMPLEADO),
                                                                             new XAttribute("CL_USUARIO", x.CL_USUARIO),
                                                                             new XAttribute("ID_PUESTO", x.ID_PUESTO),
                                                                             new XAttribute("NB_PUESTO", x.NB_PUESTO)
                                                                             ));
                SELECCIONEMPLEADOS =
                    new XElement("SELECCION", vXelements
                                 );
            }

            if (SELECCIONEMPLEADOS != null)
            {
                ConfiguracionNotificacionNegocio puesto = new ConfiguracionNotificacionNegocio();
                E_RESULTADO vResultado = puesto.INSERTA_ACTUALIZA_EMPLEADO_PUESTO_PDE(SELECCIONEMPLEADOS.ToString(), vClUsuario, vNbPrograma);
                string      vMensaje   = vResultado.MENSAJE.Where(w => w.CL_IDIOMA.Equals(vClIdioma.ToString())).FirstOrDefault().DS_MENSAJE;
                UtilMensajes.MensajeResultadoDB(rwmMensaje, vMensaje, E_TIPO_RESPUESTA_DB.SUCCESSFUL, pCallBackFunction: "onCloseWindow");
            }
            else
            {
                UtilMensajes.MensajeResultadoDB(rwmMensaje, "Selecciona un puesto", E_TIPO_RESPUESTA_DB.WARNING, pCallBackFunction: "");
            }
        }
예제 #7
0
        protected void bntEnviar_Click(object sender, EventArgs e)
        {
            var correos = "";
            ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();

            xmlPuestoEmpleado = negocio.ObtienePuestoEmpleadoNotificacion(null, vClUsuario);
            XElement root = XElement.Parse(xmlPuestoEmpleado);

            foreach (XElement name in root.Elements("EMPLEADO"))
            {
                correos = name.Attribute("NB_CORREO").Value;
                builder.Append(correos.ToString() + ";");
            }

            Email = builder.ToString();
            //if (String.IsNullOrEmpty(Email))
            //{
            //    UtilMensajes.MensajeResultadoDB(rnMensaje, "No cuentas con dirección de correo electrónico.", E_TIPO_RESPUESTA_DB.WARNING, pCallBackFunction: "");
            //}
            string Nombre  = ContextoUsuario.oUsuario.NB_USUARIO;
            string Asunto  = txtAsunto.Text;
            string Titulo  = txtAsunto.Text + ", " + Nombre;
            string Msj     = txtDsNotas.Content;
            string Mensaje = txtDsNotas.Content + " " + "Hay una nueva notificación en su bandeja.";

            if ((Mensaje.Length > 0 && rauArchivo.UploadedFiles.Count > 0 && Asunto.Length > 0) ||
                (Mensaje.Length > 0 && rauArchivo.UploadedFiles.Count == 0 && Asunto.Length > 0) ||
                (Mensaje.Length >= 0 && rauArchivo.UploadedFiles.Count > 0 && Asunto.Length > 0))
            {
                btnEnviar.Enabled = true;
                EnvioCorreo(Email, Nombre, Titulo, Mensaje, Msj, Asunto);
                txtDsNotas.Content = "";
                txtAsunto.Text     = "";
                rcbCerrar.Checked  = false;
            }
            else
            {
                UtilMensajes.MensajeResultadoDB(rnMensaje, "Escribe tu notificacion", E_TIPO_RESPUESTA_DB.WARNING, pCallBackFunction: "");
            }
        }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vIdEmpleado = ContextoUsuario.oUsuario.CL_USUARIO.ToString();
            vNbPrograma = ContextoUsuario.nbPrograma;
            vClUsuario  = ContextoUsuario.oUsuario.CL_USUARIO;

            if (!IsPostBack)
            {
                ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();
                var notificacion = negocio.ObtenerNotificaciones();
                parseNotificarConfiguracion(notificacion);
                if (vConfiguracionesNotificacion != null)
                {
                    XElement notificaciones = XElement.Parse(vConfiguracionesNotificacion.FirstOrDefault().XML_INSTRUCCION);
                    DeserializarDocumentoAutorizar(notificaciones);
                    if (vNotificacionRegistrar != null)
                    {
                        //pIns.InnerHtml = vNotificacionRegistrar.DS_INSTRUCCION.ToString();
                        pIns.Text = vNotificacionRegistrar.DS_INSTRUCCION.ToString();
                    }
                }
            }
        }
        protected void grdNotificacionEmpleado_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();
            List <E_EMPLEADO_PDE>            lista   = new List <E_EMPLEADO_PDE>();

            xmlPuestoEmpleado = negocio.ObtienePuestoEmpleado(null, null);
            XElement root = XElement.Parse(xmlPuestoEmpleado);

            foreach (XElement name in root.Elements("EMPLEADO"))
            {
                E_EMPLEADO_PDE em = new E_EMPLEADO_PDE
                {
                    ID_EMPLEADO = name.Attribute("ID_EMPLEADO").Value,
                    ID_PUESTO   = name.Attribute("ID_PUESTO").Value,
                    NB_PUESTO   = name.Attribute("NB_PUESTO").Value,
                    NB_EMPLEADO = name.Attribute("NB_EMPLEADO").Value
                };
                lista.Add(em);
                var pue = lista.Where(t => t.ID_PUESTO == "0").FirstOrDefault();
                lista.Remove(pue);
            }

            grdNotificacionEmpleado.DataSource = lista;
        }
예제 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vIdEmpleado = ContextoUsuario.oUsuario.ID_EMPLEADO_PDE.ToString();
            vNbPrograma = ContextoUsuario.nbPrograma;
            vClUsuario  = ContextoUsuario.oUsuario.CL_USUARIO;

            if (!IsPostBack)
            {
                ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();
                if (Request.Params["IdArchivo"] != null || Request.Params["IdArchivo"] != "")
                {
                    vIdArchivos = int.Parse(Request.Params["IdArchivo"]);
                    List <SPE_OBTIENE_ARCHIVOS_PDE_Result> ListaArchivos = new List <SPE_OBTIENE_ARCHIVOS_PDE_Result>();
                    MenuNegocio nego = new MenuNegocio();
                    ListaArchivos = nego.ObtenerArchivos(vIdArchivos);
                    foreach (SPE_OBTIENE_ARCHIVOS_PDE_Result item in ListaArchivos)
                    {
                        vNombreArchivo = item.NB_ARCHIVO;
                        archivo        = item.FI_ARCHIVO;
                    }

                    MemoryStream memoryStream = new MemoryStream();
                    string       tipo;
                    if (vNombreArchivo.Contains(".pdf"))
                    {
                        ArchivoAdjunto.Visible = false;
                        tipo = Response.ContentType = "application/pdf";
                        Response.ClearHeaders();
                        Response.ClearContent();
                        Response.Charset = "";
                        Response.AddHeader("Content-Type", tipo);
                        memoryStream.Write(archivo, 0, archivo.Length);
                        memoryStream.WriteTo(Response.OutputStream);
                        Response.Flush();
                        Response.Close();
                        Response.End();
                    }
                    else if (vNombreArchivo.Contains(".jpg"))
                    {
                        ArchivoAdjunto.Visible = true;
                        Response.ContentType   = "image/jpg";
                        memoryStream.Write(archivo, 0, archivo.Length);
                        Bitmap bit = new Bitmap(memoryStream);
                        bit.Save(Response.OutputStream, ImageFormat.Jpeg);
                    }
                    else if (vNombreArchivo.Contains(".png"))
                    {
                        ArchivoAdjunto.Visible = true;
                        Response.ContentType   = "image/png";
                        memoryStream.Write(archivo, 0, archivo.Length);
                        Bitmap bit = new Bitmap(memoryStream);
                        bit.Save(Response.OutputStream, ImageFormat.Jpeg);
                    }
                    else if (vNombreArchivo.Contains(".jpeg"))
                    {
                        ArchivoAdjunto.Visible = true;
                        Response.ContentType   = "image/jpeg"; memoryStream.Write(archivo, 0, archivo.Length);
                        Bitmap bit = new Bitmap(memoryStream);
                        bit.Save(Response.OutputStream, ImageFormat.Jpeg);
                    }
                    else
                    {
                        Response.ContentType = "application/octet-stream";
                        Response.AddHeader("Content-Length", archivo.Length.ToString());
                        Response.AddHeader("Content-Disposition", String.Format("filename={0}", vNombreArchivo));
                        Response.BinaryWrite(archivo);
                        Response.Flush();
                        Response.End();
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            vIdEmpleado     = ContextoUsuario.oUsuario.ID_EMPLEADO_PDE.ToString();
            vNbPrograma     = ContextoUsuario.nbPrograma;
            vClUsuario      = ContextoUsuario.oUsuario.CL_USUARIO;
            FechaHoraActual = DateTime.Now;
            string fecha_corta             = string.Format("{0:d}", FechaHoraActual);                // d: fecha corta  "12/02/2013"
            string fecha_larga             = string.Format("{0:D}", FechaHoraActual);                // D: fecha larga  "martes, 12 de febrero de 2013"
            string mes_dia                 = string.Format("{0:M}", FechaHoraActual);                // m,M: Mes y día  "12 febrero"
            string mes_ano                 = string.Format("{0:Y}", FechaHoraActual);                // y,Y: Mes y año  "febrero de 2013"
            string hora_corta              = string.Format("{0:t}", FechaHoraActual);                // t: hora corta "22:48"
            string hora_larga              = string.Format("{0:T}", FechaHoraActual);                // T: hora larga "22:48:02"
            string dia_fecha_hora_seg      = string.Format("{0:f}", FechaHoraActual);                // f:D+t "martes, 12 de febrero de 2013 22:48"
            string dia_fecha_hora          = string.Format("{0:F}", FechaHoraActual);                // F:D+T "martes, 12 de febrero de 2013 22:48:02"
            string fecha_diagonal_hora     = string.Format("{0:g}", FechaHoraActual);                // g:d+t "12/02/2013 22:48"
            string fecha_diagonal_hora_seg = string.Format("{0:G}", FechaHoraActual);                // G:d+T "12/02/2013 22:48:02"
            string dia_mes_año_parentesis  = string.Format("{0:dddd (MMMM yyyy)}", FechaHoraActual); //"martes (febrero 2013)"
            string dia_fecha_parentesis    = string.Format("{0:ddd (MMM yy)}", FechaHoraActual);     //"mar (feb 13)"
            string fecha_diagonal          = string.Format("{0:dd/MM/yy}", FechaHoraActual);         //"12/02/13"

            if (!IsPostBack)
            {
                List <E_FORMATO_FECHA> ListaFechasCampo = new List <E_FORMATO_FECHA>();
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 1, NB_FECHA = "Fecha corta (12/02/2013)", CL_FECHA = "fecha_corta", FORMATO_FECHA = fecha_corta
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 2, NB_FECHA = "Fecha larga (martes, 12 de febrero de 2013)", CL_FECHA = "fecha_larga", FORMATO_FECHA = fecha_larga
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 3, NB_FECHA = "Día mes (12 febrero)", CL_FECHA = "mes_dia", FORMATO_FECHA = mes_dia
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 4, NB_FECHA = "Mes año (febrero de 2013)", CL_FECHA = "mes_ano", FORMATO_FECHA = mes_ano
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 5, NB_FECHA = "Dia Fecha Hora (martes, 12 de febrero de 2013 22:48)", CL_FECHA = "dia_fecha_hora", FORMATO_FECHA = dia_fecha_hora
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 6, NB_FECHA = "Dia Fecha Hora Segundos (martes, 12 de febrero de 2013 22:48:02)", CL_FECHA = "fecha_diagonal_hora_seg", FORMATO_FECHA = fecha_diagonal_hora_seg
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 7, NB_FECHA = "Fecha diagonal hora (12/02/2013 22:48)", CL_FECHA = "fecha_diagonal_hora", FORMATO_FECHA = fecha_diagonal_hora
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 8, NB_FECHA = "Fecha diagonal hora completa (12/02/2013 22:48:02)", CL_FECHA = "dia_mes_año_parentesis", FORMATO_FECHA = dia_mes_año_parentesis
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 9, NB_FECHA = "Fecha paréntesis (martes (febrero 2013))", CL_FECHA = "dia_fecha_parentesis", FORMATO_FECHA = dia_fecha_parentesis
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 10, NB_FECHA = "Dia Mes corto año (feb 13)", CL_FECHA = "fecha_diagonal", FORMATO_FECHA = fecha_diagonal
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 11, NB_FECHA = "Fecha completa diagonal (12/02/13)", CL_FECHA = "fecha_diagonal", FORMATO_FECHA = fecha_diagonal
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 12, NB_FECHA = "Hora corta (22:48)", CL_FECHA = "hora_corta", FORMATO_FECHA = hora_corta
                });
                ListaFechasCampo.Add(new E_FORMATO_FECHA {
                    ID_FECHA = 13, NB_FECHA = "Hora larga (22:48:02)", CL_FECHA = "hora_larga", FORMATO_FECHA = hora_larga
                });
                List <E_FORMATO_FECHA>           ListaFechas = new List <E_FORMATO_FECHA>();
                ConfiguracionNotificacionNegocio negocio     = new ConfiguracionNotificacionNegocio();

                if (Request.Params["IdArchivo"] != null)
                {
                    vIdArchivos    = int.Parse(Request.Params["IdArchivo"]);
                    vNombreArchivo = Request.Params["NbArchivo"];
                    List <SPE_OBTIENE_FORMATOS_Y_TRAMITES_Result> ListaArchivo = new List <SPE_OBTIENE_FORMATOS_Y_TRAMITES_Result>();
                    FormatosYTramitesNegocio nego = new FormatosYTramitesNegocio();
                    ListaArchivo = nego.OBTENER_FORMATOS_Y_TRAMITES(vIdArchivos);

                    // xml del empleado

                    SPE_OBTIENE_EMPLEADO_FORMATO_TRAMITE_Result vSolicitud = nego.ObtenerPlantilla(null, vIdEmpleado, "I");
                    vXmlDocumentos = vSolicitud.XML_VALORES;

                    foreach (SPE_OBTIENE_FORMATOS_Y_TRAMITES_Result item in ListaArchivo)
                    {
                        List <SPE_OBTIENE_CAMPO_FORMULARIO_Result> ListaCampos = new List <SPE_OBTIENE_CAMPO_FORMULARIO_Result>();
                        CampoFormularioNegocio negocioCampo = new CampoFormularioNegocio();
                        ListaCampos = negocioCampo.ObtieneCamposFormularios(null, null, null, null, "FORMATO_TRAMITE_PDE", true, null);

                        XElement formato = XElement.Parse(item.XML_FORMATO_TRAMITE);
                        DeserializarDocumentoAutorizar(formato);
                        if (vFormato.Count > 0)
                        {
                            string a = "";
                            foreach (var campo in ListaCampos)
                            {
                                if (vFormato.FirstOrDefault().XML_FORMATO_TRAMITE.ToString().Contains(campo.CL_CAMPO_FORMULARIO))
                                {
                                    a = vFormato.FirstOrDefault().XML_FORMATO_TRAMITE.ToString().Replace("{" + campo.CL_CAMPO_FORMULARIO + "}", ObtenerDatoEmpleado(campo.CL_CAMPO_FORMULARIO)); //, vSolicitud.NB_EVALUADOR//
                                    vFormato.FirstOrDefault().XML_FORMATO_TRAMITE = a;
                                }
                            }
                            foreach (var fecha in ListaFechasCampo)
                            {
                                if (vFormato.FirstOrDefault().XML_FORMATO_TRAMITE.ToString().Contains(fecha.CL_FECHA))
                                {
                                    a = vFormato.FirstOrDefault().XML_FORMATO_TRAMITE.ToString().Replace("'" + fecha.CL_FECHA + "'", (fecha.FORMATO_FECHA)); //, vSolicitud.NB_EVALUADOR//
                                    vFormato.FirstOrDefault().XML_FORMATO_TRAMITE = a;
                                }
                            }
                            reTramite.Content = vFormato.FirstOrDefault().XML_FORMATO_TRAMITE.ToString();
                            reTramite.ExportToPdf();
                        }
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ListaEmpleados    = new List <E_EMPLEADO_PDE>();
                ListaEmpleadosInf = new List <E_EMPLEADO_PDE>();
                rbLectura.Checked = true;
                if (Request.Params["IdComunicado"] != null)
                {
                    vTipoComunicado  = Request.Params["TipoComunicado"];
                    vTipoAccion      = Request.Params["Tipo"];
                    vIdComunicado    = int.Parse((Request.Params["IdComunicado"]));
                    vTipoTransaccion = E_TIPO_OPERACION_DB.A.ToString();
                    ListaComunicadosNegocio nComunicado = new ListaComunicadosNegocio();

                    vEmpleadosSeleccionados = nComunicado.ObtenerEmpleadosComunicado(vIdComunicado).ToList();
                    grdEmpleadosSeleccionados.DataSource = vEmpleadosSeleccionados;

                    VisorComunicadoNegocio nLista = new VisorComunicadoNegocio();
                    List <SPE_OBTIENE_LISTA_EMPLEADOS_INFORMACION_Result> ListaEmp = new List <SPE_OBTIENE_LISTA_EMPLEADOS_INFORMACION_Result>();
                    ListaEmp = nLista.ObtenerListaEmpleadosInformacion((int)vIdComunicado);
                    RadGridSeleccion.DataSource = ListaEmp;

                    foreach (E_OBTIENE_EMPLEADOS_COMUNICADO item in vEmpleadosSeleccionados)
                    {
                        E_EMPLEADO_PDE f = new E_EMPLEADO_PDE
                        {
                            ID_EMPLEADO  = item.ID_EMPLEADO,
                            NB_EMPLEADO  = item.NB_EMPLEADO,
                            NB_PUESTO    = item.NB_PUESTO,
                            M_CL_USUARIO = item.M_CL_USUARIO
                        };

                        ListaEmpleados.Add(f);
                    }

                    var vObtieneComunicado = nComunicado.ObtenerComunicados(vIdComunicado).ToList().FirstOrDefault();
                    txtTituloComunicado.Text     = vObtieneComunicado.NB_COMUNICADO;
                    txtContenido.Content         = vObtieneComunicado.DS_COMUNICADO;
                    rdtiIniciofecha.SelectedDate = vObtieneComunicado.FE_VISIBLE_DEL;
                    rdtFinfecha.MaxDate          = new DateTime(2200, 12, 20);
                    rdtFinfecha.SelectedDate     = vObtieneComunicado.FE_VISIBLE_AL;
                    vIdArchivo     = vObtieneComunicado.ID_ARCHIVO_PDE;
                    vNombreArchivo = vObtieneComunicado.NB_ARCHIVO;


                    if (vObtieneComunicado.FG_PRIVADO == "Privado")
                    {
                        rcbprivado.Checked = true;
                    }
                    if (vIdArchivo != null)
                    {
                        rcbEliminarAdjunto.Visible = true;
                        ArchivosAdjuntos.Visible   = true;
                    }
                    else
                    {
                        vIdArchivo = 0;
                    }



                    if (vTipoComunicado != "null")
                    {
                        if (vTipoAccion == "E")
                        {
                            rbEditar.Checked = true;
                        }
                        else
                        {
                            rbLectura.Checked = true;
                        }

                        rbLectura.Visible                 = true;
                        rbEditar.Visible                  = true;
                        rbLectura.Enabled                 = false;
                        rbEditar.Enabled                  = false;
                        RadGridSeleccion.Visible          = true;
                        rcbAuto.Visible                   = true;
                        rbHabilitar.Visible               = true;
                        rbAgregar2.Visible                = false;
                        rbAgregar.Visible                 = true;
                        RadGridSeleccion.Enabled          = false;
                        rcbAuto.Enabled                   = true;
                        rbHabilitar.Enabled               = false;
                        rbAgregar.Enabled                 = true;
                        rcbprivado.Enabled                = false;
                        grdEmpleadosSeleccionados.Enabled = false;
                        btnSeleccionarAdscripcion.Enabled = false;
                        btnSeleccionarAreas.Enabled       = false;
                        btnSeleccionarEmpleados.Enabled   = false;
                        btnSeleccionarPuestos.Enabled     = false;
                        btnSeleccionUsuario.Enabled       = false;


                        if (vTipoComunicado == "I")
                        {
                            Tipo3.Checked        = true;
                            Tipo1.Checked        = false;
                            Tipo2.Checked        = false;
                            Tipo1.Enabled        = false;
                            Tipo2.Enabled        = false;
                            Tipo3.Enabled        = false;
                            btnPuestos.Visible   = false;
                            btnSeleccion.Visible = true;
                            btnSeleccion.Enabled = false;
                        }
                        else if (vTipoComunicado == "D")
                        {
                            Tipo3.Checked        = false;
                            Tipo1.Checked        = false;
                            Tipo2.Checked        = true;
                            Tipo1.Enabled        = false;
                            Tipo2.Enabled        = false;
                            Tipo3.Enabled        = false;
                            btnPuestos.Visible   = true;
                            btnSeleccion.Visible = false;
                            btnPuestos.Enabled   = false;
                            RadGridSeleccion.MasterTableView.Columns.FindByUniqueName("NB_EMPLEADO").Visible = false;
                        }
                    }
                    else
                    {
                        Tipo3.Checked        = false;
                        Tipo1.Checked        = true;
                        Tipo2.Checked        = false;
                        Tipo1.Enabled        = false;
                        Tipo2.Enabled        = false;
                        Tipo3.Enabled        = false;
                        btnPuestos.Visible   = false;
                        btnSeleccion.Visible = false;
                    }
                }
                else
                {
                    vIdArchivo                   = 0;
                    vIdComunicado                = 0;
                    vTipoTransaccion             = E_TIPO_OPERACION_DB.I.ToString();
                    rdtiIniciofecha.SelectedDate = DateTime.Now.Date;
                    rdtFinfecha.SelectedDate     = DateTime.Now.AddDays(1);
                }

                ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();
                var notificacion = negocio.ObtenerNotificaciones();
                parseNotificarConfiguracion(notificacion);
                if (vConfiguracionesNotificacion != null)
                {
                    XElement notificaciones = XElement.Parse(vConfiguracionesNotificacion.FirstOrDefault().XML_INSTRUCCION);
                    DeserializarDocumentoAutorizar(notificaciones);
                    if (vNotificacionRegistrar != null)
                    {
                        //pIns.Text = vNotificacionRegistrar.DS_INSTRUCCION.ToString();
                        pIns.Text = vNotificacionRegistrar.DS_INSTRUCCION.ToString();
                    }
                }

                AdscripcionesNegocio negocioa = new AdscripcionesNegocio();
                string adscripcionVisible     = negocioa.SeleccionaAdscripcion().ToString();
                if (adscripcionVisible != "No")
                {
                    btnSeleccionarAdscripcion.Visible = true;
                }
                else
                {
                    btnSeleccionarAdscripcion.Visible = false;
                }

                vUsuarioSeleccion = "";
            }
        }
예제 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vIdEmpleado = ContextoUsuario.oUsuario.CL_USUARIO.ToString();
            vNbPrograma = ContextoUsuario.nbPrograma;
            vClUsuario  = ContextoUsuario.oUsuario.CL_USUARIO;

            if (!IsPostBack)
            {
                ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();
                var notificacion = negocio.ObtenerNotificaciones();
                parseNotificarConfiguracion(notificacion);
                if (vConfiguracionesNotificacion != null)
                {
                    XElement notificaciones = XElement.Parse(vConfiguracionesNotificacion.FirstOrDefault().XML_INSTRUCCION);
                    DeserializarDocumentoAutorizar(notificaciones);
                    if (vNotificacionAdministrar != null)
                    {
                        //pIns.InnerHtml = vNotificacionAdministrar.DS_INSTRUCCION.ToString();
                        pIns.Text = vNotificacionAdministrar.DS_INSTRUCCION.ToString();
                    }
                }


                if (Request.Params["pIdNotificacion"] != null)
                {
                    vIdNotificacion  = int.Parse(Request.Params["pIdNotificacion"]);
                    vBotonesVisibles = (Request.Params["pBotonesVisbles"]);
                    List <SPE_OBTIENE_NOTIFICACIONES_PENDIENTES_Result> ListaNotificacionesPendientes = new List <SPE_OBTIENE_NOTIFICACIONES_PENDIENTES_Result>();
                    MenuNegocio nego = new MenuNegocio();
                    vIdArchivo = 0;
                    ListaNotificacionesPendientes = nego.ObtenerNotificacionesPendientes(ContextoUsuario.oUsuario.CL_USUARIO, vIdNotificacion, null);
                    foreach (SPE_OBTIENE_NOTIFICACIONES_PENDIENTES_Result item in ListaNotificacionesPendientes)
                    {
                        txtAsunto.Text            = item.NB_ASUNTO;
                        lblNotificacion.InnerHtml = item.DS_NOTIFICACION;
                        archivo             = item.FI_ARCHIVO;
                        vTipoArchivo        = item.NB_ARCHIVO;
                        vStatusNotificacion = item.CL_ESTADO;
                        vComentario         = item.DS_COMENTARIO;
                        if (item.ID_ARCHIVO_PDE != null)
                        {
                            vIdArchivo = (int)item.ID_ARCHIVO_PDE;
                        }
                        else
                        {
                            vIdArchivo = (int)0;
                        }
                    }

                    if (archivo == null)
                    {
                        ArchivoAdjunto.Visible = false;
                    }
                    else
                    {
                        ArchivoAdjunto.Visible = true;
                    }

                    if (vBotonesVisibles == "true")
                    {
                        btnAutorizar.Visible = true;
                        btnRechazar.Visible  = true;
                        rcbleido.Visible     = true;
                        if (vStatusNotificacion == "En revisión")
                        {
                            rcbleido.Checked = true;
                        }
                    }
                    else
                    {
                        if (vStatusNotificacion == "Autorizada")
                        {
                            btnRerponder.Visible     = false;
                            lblFinComentario.Visible = true;
                            lblFinComentario.Text    = "Petición autorizada: " + vComentario;
                        }
                        else if (vStatusNotificacion == "Rechazada")
                        {
                            btnRerponder.Visible     = false;
                            lblFinComentario.Visible = true;
                            lblFinComentario.Text    = "Peticion rechazada: " + vComentario;
                        }

                        btnAutorizar.Visible = false;
                        btnRechazar.Visible  = false;
                        rcbleido.Visible     = false;
                    }

                    rlvComentarios.Rebind();
                }
            }
        }
예제 #14
0
        public bool EnvioCorreo(string Email, string Nombre, string Titulo, string Mensaje, string Msj, string Asunto)
        {
            bool resultado;

            byte[] data = null;
            String name = "";
            string tipo = "";
            Mail   mail = new Mail(ContextoApp.mailConfiguration);

            try
            {
                //envio correo
                mail.addToAddress(Email, Nombre);

                RadProgressContext progress = RadProgressContext.Current;
                if (rauArchivo.UploadedFiles.Count > 0)
                {
                    data = new byte[rauArchivo.UploadedFiles[0].ContentLength];
                    rauArchivo.UploadedFiles[0].InputStream.Read(data, 0, int.Parse(rauArchivo.UploadedFiles[0].ContentLength.ToString()));
                    name = rauArchivo.UploadedFiles[0].FileName.ToString();
                    string extension = Path.GetExtension(name).ToLowerInvariant();

                    if (extension.Length > 0 &&
                        mail.MIMETypesDictionary.ContainsKey(extension.Remove(0, 1)))
                    {
                        tipo = mail.MIMETypesDictionary[extension.Remove(0, 1)];
                    }
                    if (tipo == "image/png" || tipo == "image/jpg" || tipo == "image/jpeg" || tipo == "application/pdf")
                    {
                        mail.addAttachment(data, name, tipo);
                    }
                }
                else
                {
                    // UtilMensajes.MensajeResultadoDB(rnMensaje, "No tienes dirección de correo electrónico, no se enviará ", E_TIPO_RESPUESTA_DB.WARNING,pCallBackFunction:"");
                    data = null;
                }
                //Insertar

                NotificacionNegocio nConfiguracion = new NotificacionNegocio();

                ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();
                xmlPuestoEmpleado = negocio.ObtienePuestoEmpleadoNotificacion(null, vClUsuario);
                XElement root        = XElement.Parse(xmlPuestoEmpleado);
                var      id_empleado = "";
                foreach (XElement id in root.Elements("EMPLEADO"))
                {
                    id_empleado = id.Attribute("ID_EMPLEADO").Value;
                    if (id_empleado == "")
                    {
                        vId_Empleado = id_empleado;
                    }
                }
                if (vId_Empleado == null)
                {
                    E_RESULTADO vResultado = nConfiguracion.INSERTA_ACTUALIZA_NOTIFICACION_EMPLEADO(0, Asunto, Msj,
                                                                                                    vIdEmpleado, "Pendiente", vClUsuario, vNbPrograma, null, name, data, "I");
                    rauArchivo.UploadedFiles.Clear();
                    if (Email == ";")
                    {
                        UtilMensajes.MensajeResultadoDB(rnMensaje, "No hay dirección de correo electrónico para recursos humanos.", E_TIPO_RESPUESTA_DB.WARNING, pCallBackFunction: "");
                    }
                    else
                    {
                        string body = ContextoCorreo.CuerpoMensaje;
                        mail.Send("Buen día" + " " + Titulo, String.Format(body, ContextoCorreo.encabezado, "Estimado(a): ", " " + Mensaje, " No olvides imprimir en hojas recicladas!! Cuidemos el medio ambiente", ContextoCorreo.pie));


                        //  mail.Send(Titulo, Mensaje);
                    }

                    string vMensaje = vResultado.MENSAJE.Where(w => w.CL_IDIOMA.Equals(vClIdioma.ToString())).FirstOrDefault().DS_MENSAJE;

                    if (vCerrarPantalla == false)
                    {
                        UtilMensajes.MensajeResultadoDB(rnMensaje, vMensaje, E_TIPO_RESPUESTA_DB.SUCCESSFUL);
                    }
                    else
                    {
                        UtilMensajes.MensajeResultadoDB(rnMensaje, vMensaje, E_TIPO_RESPUESTA_DB.SUCCESSFUL, pCallBackFunction: "");
                    }
                }
                else
                {
                    UtilMensajes.MensajeResultadoDB(rnMensaje, "Seleccione a quién será enviada la notificación", E_TIPO_RESPUESTA_DB.WARNING, pCallBackFunction: "");
                }
                resultado = true;
            }
            catch (Exception)
            {  //  UtilMensajes.MensajeResultadoDB(rnMensaje, vMensaje, vResultado.CL_TIPO_ERROR);
                resultado = false;
            }

            return(resultado);
        }
예제 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vIdEmpleado = ContextoUsuario.oUsuario.ID_EMPLEADO_PDE.ToString();
            vNbPrograma = ContextoUsuario.nbPrograma;
            vClUsuario  = ContextoUsuario.oUsuario.CL_USUARIO;

            if (!IsPostBack)
            {
                ConfiguracionNotificacionNegocio negocio = new ConfiguracionNotificacionNegocio();
                if (Request.Params["IdArchivo"] != null)
                {
                    vIdArchivos = int.Parse(Request.Params["IdArchivo"]);
                    List <SPE_OBTIENE_ARCHIVOS_PDE_Result> ListaArchivos = new List <SPE_OBTIENE_ARCHIVOS_PDE_Result>();
                    MenuNegocio nego = new MenuNegocio();
                    ListaArchivos = nego.ObtenerArchivos(vIdArchivos);
                    foreach (SPE_OBTIENE_ARCHIVOS_PDE_Result item in ListaArchivos)
                    {
                        vNombreArchivo = item.NB_ARCHIVO;
                        archivo        = item.FI_ARCHIVO;
                    }


                    MemoryStream memoryStream = new MemoryStream();


                    if (vNombreArchivo.Contains(".mp3"))
                    {
                        rmpVideo.Visible = true;
                        var          url      = HttpContext.Current.Server.MapPath("~") + "\\App_Data\\RadUploadTemp\\";
                        var          filename = vNombreArchivo;
                        var          urlfile  = Path.Combine(url, filename);
                        MemoryStream ms       = new MemoryStream(archivo);
                        FileStream   file     = new FileStream(urlfile, FileMode.Create, FileAccess.Write);
                        ms.WriteTo(file);
                        file.Close();
                        ms.Close();
                        rmpVideo.Source = "../App_Data/RadUploadTemp/" + filename;
                    }
                    else if (vNombreArchivo.Contains(".mp4"))
                    {
                        //RadMediaPlayer player = new RadMediaPlayer();
                        rmpVideo.Visible = true;
                        // ArchivoAdjunto.Visible = false;
                        // var url = HttpContext.Current.Request.Url.Authority;
                        var url = HttpContext.Current.Server.MapPath("~") + "\\App_Data\\RadUploadTemp\\";
                        // string ruta = url + "\\App_Data\\" + vNombreArchivo + DateTime.Now;
                        //var result = Path.GetTempPath();
                        // var url = HttpContext.Current.Request.Url.Authority;
                        //var filename = vNombreArchivo;
                        //var urlfile = Path.Combine(result, filename);
                        var          filename = vNombreArchivo;
                        var          urlfile  = Path.Combine(url, filename);
                        MemoryStream ms       = new MemoryStream(archivo);
                        FileStream   file     = new FileStream(urlfile, FileMode.Create, FileAccess.Write);
                        ms.WriteTo(file);
                        file.Close();
                        ms.Close();
                        rmpVideo.Source = "../App_Data/RadUploadTemp/" + filename;
                        //MediaPlayerSource mpSource = new MediaPlayerSource();
                        //mpSource.Path = urlfile;
                        //player.Sources.Add(mpSource);
                        //player.StartVolume = 90;
                        //player.OnClientReady = "playerReady";
                        ////player.FullScreen = true;
                        //player.HDActive = true;
                        //player.VolumeButtonToolTip = "Zvuk";
                        //player.FullScreenButtonToolTip = "Veći ekran";
                        //player.Skin = "Metro";
                        //FileStream fileStream = File.Create("C:\\", (int)archivo.Length);
                        //// Initialize the bytes array with the stream length and then fill it with data
                        // byte[] bytesInStream = new byte[archivo.Length];
                        //archivo.Read(bytesInStream, 0, bytesInStream.Length);
                        //// Use write method to write to the file specified above
                        //fileStream.Write(bytesInStream, 0, bytesInStream.Length);
                    }
                    else if (vNombreArchivo.Contains(".avi"))
                    {
                        rmpVideo.Visible = true;
                        var          url      = HttpContext.Current.Server.MapPath("~") + "\\App_Data\\RadUploadTemp\\";
                        var          filename = vNombreArchivo;
                        var          urlfile  = Path.Combine(url, filename);
                        MemoryStream ms       = new MemoryStream(archivo);
                        FileStream   file     = new FileStream(urlfile, FileMode.Create, FileAccess.Write);
                        ms.WriteTo(file);
                        file.Close();
                        ms.Close();
                        rmpVideo.Source = "../App_Data/RadUploadTemp/" + filename;
                    }
                    else if (vNombreArchivo.Contains(".mov"))
                    {
                        rmpVideo.Visible = true;
                        var          url      = HttpContext.Current.Server.MapPath("~") + "\\App_Data\\RadUploadTemp\\";
                        var          filename = vNombreArchivo;
                        var          urlfile  = Path.Combine(url, filename);
                        MemoryStream ms       = new MemoryStream(archivo);
                        FileStream   file     = new FileStream(urlfile, FileMode.Create, FileAccess.Write);
                        ms.WriteTo(file);
                        file.Close();
                        ms.Close();
                        rmpVideo.Source = "../App_Data/RadUploadTemp/" + filename;
                    }

                    //memoryStream.Write(archivo, 0, archivo.Length);
                    //Bitmap bit = new Bitmap(memoryStream);
                    //bit.Save(Response.OutputStream, ImageFormat.Jpeg);
                }
            }
        }