Example #1
0
        public frmReasignarCategoriaTicketAgente(TicketWS.ticket tck)
        {
            ticket          = tck;
            agente.agenteId = frmLogin.agenteLogueado.agenteId;

            InitializeComponent();

            var cats = categoriaDAO.listarCategorias();

            if (cats == null)
            {
                categorias = new BindingList <CategoriaWS.categoria>();
            }
            else
            {
                categorias = new BindingList <CategoriaWS.categoria>(cats.ToList());
            }

            foreach (var cat in categorias)
            {
                if (cat.categoriaId == ticket.categoria.categoriaId)
                {
                    categorias.Remove(cat);
                    break;
                }
            }

            dgvCategoria.AutoGenerateColumns = false;
            dgvCategoria.DataSource          = categorias;
        }
Example #2
0
        public frmCerrarTicketAgente(TicketWS.ticket tick)
        {
            InitializeComponent();

            ticket               = tick;
            estResuelto          = new TicketWS.estadoTicket();
            estResuelto.estadoId = (int)Estado.Cerrado;
            estResuelto.nombre   = "CERRADO";
        }
Example #3
0
        private void dgvTicketsEspera_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            TicketWS.ticket data = dgvTicketsEspera.Rows[e.RowIndex].DataBoundItem as TicketWS.ticket;

            dgvTicketsEspera.Rows[e.RowIndex].Cells["AbreviaturaBiblioteca"].Value = data.biblioteca.abreviatura;
            dgvTicketsEspera.Rows[e.RowIndex].Cells["NombreEmpleado"].Value        = data.empleado.apellidoPaterno + " " + data.empleado.apellidoMaterno + ", " + data.empleado.nombre;
            //dgvTicketsEspera.Rows[e.RowIndex].Cells["FechaApertura"].Value = data.fechaEnvio.Replace("T", " ");
            dgvTicketsEspera.Rows[e.RowIndex].Cells["NombreCategoria"].Value = data.categoria.nombre;
            dgvTicketsEspera.Rows[e.RowIndex].Cells["NombreUrgencia"].Value  = data.urgencia.nombre;
        }
Example #4
0
 private void EnviarEmailNotificacion(TicketWS.ticket tick, TicketWS.cambioEstadoTicket cambio)
 {
     if (tick.alumnoEmail != null)
     {
         if (EnvioCorreoNotificacion.NuevoCambioEstado(tick, cambio) == false)
         {
             MessageBox.Show(
                 "Ha ocurrido un error al enviar el correo de notificación al alumno",
                 "Correo no enviado",
                 MessageBoxButtons.OK, MessageBoxIcon.Information
                 );
         }
     }
 }
        private void dgvHistorial_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            TicketWS.ticket data = dgvHistorial.Rows[e.RowIndex].DataBoundItem as TicketWS.ticket;

            //dgvHistorial.Rows[e.RowIndex].Cells["FechaEnvio"].Value = data.fechaEnvio.Replace("T", " ");
            if (data.fechaCierre == null)
            {
                dgvHistorial.Rows[e.RowIndex].Cells["FechaCierre"].Value = "---";
            }
            dgvHistorial.Rows[e.RowIndex].Cells["Empleado"].Value  = data.empleado.nombre + " " + data.empleado.apellidoPaterno + " " + data.empleado.apellidoMaterno;
            dgvHistorial.Rows[e.RowIndex].Cells["Estado"].Value    = data.estado.nombre;
            dgvHistorial.Rows[e.RowIndex].Cells["Urgencia"].Value  = data.urgencia.nombre;
            dgvHistorial.Rows[e.RowIndex].Cells["Categoria"].Value = data.categoria.nombre;
        }
Example #6
0
        public static bool NuevoTicketEnviado(TicketWS.ticket ticket)
        {
            StreamReader streamReader = new StreamReader("../../emails/EmailTicketEnviado.html", System.Text.Encoding.UTF8);
            string       body         = streamReader.ReadToEnd();

            body = body.Replace("*TICKETIDPH*", ticket.ticketId.ToString());
            body = body.Replace("*ASUNTOPH*", ticket.asunto);

            EmailWS.YanapayEmail correo = new EmailWS.YanapayEmail();
            correo.FromAddress  = "*****@*****.**";
            correo.ToRecipients = ticket.alumnoEmail;
            correo.Subject      = "Yanapay - Nuevo ticket enviado";
            correo.Body         = body;
            correo.IsHtml       = true;

            return(servicioEmail.EnviarCorreo(correo));
        }
        private void btnSeleccionar_Click(object sender, EventArgs e)
        {
            TicketWS.ticket       tic = (TicketWS.ticket)dgvHistorial.CurrentRow.DataBoundItem;
            frmInfoTicketEmpleado frm = new frmInfoTicketEmpleado(tic);


            frm.StartPosition = FormStartPosition.Manual;
            frm.Location      = this.Location;
            frm.FormClosing  += delegate
            {
                Refrescar();
                dgvHistorial.DataSource = tickets;
                this.Show();
            };

            frm.Show();
            this.Hide();
        }
Example #8
0
        public frmCrearNuevoTicket()
        {
            ticket = new TicketWS.ticket();
            InitializeComponent();
            var bibl = bibliotecaDAO.listarBibliotecas();
            var cate = categoriaDAO.listarCategorias();
            var urge = urgenciaDAO.listarUrgencias();

            if (bibl == null)
            {
                bibliotecas = new BindingList <BibliotecaWS.biblioteca>();
            }
            else
            {
                bibliotecas = new BindingList <BibliotecaWS.biblioteca>(bibl);
            }
            if (cate == null)
            {
                categorias = new BindingList <CategoriaWS.categoria>();
            }
            else
            {
                categorias = new BindingList <CategoriaWS.categoria>(cate);
            }
            if (urge == null)
            {
                urgencias = new BindingList <UrgenciaWS.urgencia>();
            }
            else
            {
                urgencias = new BindingList <UrgenciaWS.urgencia>(urge);
            }

            cboBiblioteca.DataSource    = bibliotecas;
            cboBiblioteca.DisplayMember = "nombre";

            cboCategoria.DataSource    = categorias;
            cboCategoria.DisplayMember = "nombre";

            cboUrgencia.DataSource    = urgencias;
            cboUrgencia.DisplayMember = "nombre";

            limpiarComponentes();
        }
Example #9
0
        public static bool NuevoCambioEstado(TicketWS.ticket ticket, TicketWS.cambioEstadoTicket update)
        {
            StreamReader streamReader = new StreamReader("../../emails/EmailNotificacionEstado.html", System.Text.Encoding.UTF8);
            string       body         = streamReader.ReadToEnd();

            body = body.Replace("*ROLPH*", frmLogin.agenteLogueado.rol.nombre.ToLower());
            body = body.Replace("*TICKETIDPH*", ticket.ticketId.ToString());
            body = body.Replace("*ASUNTOPH*", ticket.asunto);
            body = body.Replace("*ESTADOPH*", update.estadoTo.nombre);
            body = body.Replace("*COMENTARIOPH*", update.comentario);

            EmailWS.YanapayEmail correo = new EmailWS.YanapayEmail();
            correo.FromAddress  = "*****@*****.**";
            correo.ToRecipients = ticket.alumnoEmail;
            correo.Subject      = "Yanapay - Nueva actualización";
            correo.Body         = body;
            correo.IsHtml       = true;

            return(servicioEmail.EnviarCorreo(correo));
        }
Example #10
0
        public static bool NuevoComentario(TicketWS.ticket ticket, TicketWS.agente age)
        {
            StreamReader streamReader = new StreamReader("../../emails/EmailNotificacionComentario.html", System.Text.Encoding.UTF8);
            string       body         = streamReader.ReadToEnd();

            body = body.Replace("*NOMBREPH*", age.nombre);
            body = body.Replace("*APELLIDOPH*", age.apellidoPaterno);
            body = body.Replace("*TIPOPH*", "empleado");
            body = body.Replace("*TICKETIDPH*", ticket.ticketId.ToString());
            body = body.Replace("*ASUNTOPH*", ticket.asunto);

            EmailWS.YanapayEmail correo = new EmailWS.YanapayEmail();
            correo.FromAddress  = "*****@*****.**";
            correo.ToRecipients = age.personaEmail;
            correo.Subject      = "Yanapay - Nuevo comentario";
            correo.Body         = body;
            correo.IsHtml       = true;

            return(servicioEmail.EnviarCorreo(correo));
        }
        public frmSeleccionarTareasTicket(TicketWS.ticket tick)
        {
            InitializeComponent();

            ticket.ticketId = tick.ticketId;
            agente.agenteId = frmLogin.agenteLogueado.agenteId;

            TareaWS.tarea[] arrTareas = tareaDAO.listarTareasPorTicket(ticket);

            if (arrTareas != null)
            {
                tareas = new BindingList <TareaWS.tarea>(arrTareas.ToList());
            }
            else
            {
                tareas = new BindingList <TareaWS.tarea>();
            }

            dgvLista.AutoGenerateColumns = false;
            dgvLista.DataSource          = tareas;
        }
Example #12
0
        public frmInfoTicketAgente(TicketWS.ticket tick)
        {
            ticket   = tick;
            ticketId = ticket.ticketId;

            InitializeComponent();
            LlenarComentarios();
            CrearPaneles();

            Refrescar(ticketId);

            if (frmLogin.agenteLogueado.rol.nombre.Contains("ADMIN"))
            {
                this.Width         = 1343;
                btnVolver.Location = new System.Drawing.Point(1207, 21);
            }
            else
            {
                this.Width         = 1068;
                btnVolver.Location = new System.Drawing.Point(933, 21);
            }
        }
        public frmInfoTicketEmpleado(TicketWS.ticket tick)
        {
            ticket = tick;

            InitializeComponent();
            LlenarComentarios();
            CrearPaneles();

            lblAsunto.Text = ticket.asunto;
            lblId.Text     = "# " + ticket.ticketId.ToString();
            lblFecIni.Text = ticket.fechaEnvio.Replace('-', '/').Replace("T", " - ");
            if (ticket.fechaCierreMaximo != null)
            {
                lblFecCieEst.Text = ticket.fechaCierreMaximo.Replace('-', '/').Replace("T", " - ");
            }
            else
            {
                lblFecCieEst.Text = "Error en la fecha";
            }
            lblEstado.Text = ticket.estado.nombre;
            lblBib.Text    = ticket.biblioteca.nombre;
            lblCat.Text    = ticket.categoria.nombre;
            lblUrg.Text    = ticket.urgencia.nombre;
            if (ticket.activoFijo.activoFijoId > 0)
            {
                lblActFij.Text = tick.activoFijo.codigo;
            }
            else
            {
                lblTituloActFij.Text = "";
            }

            if (ticket.estado.estadoId == (int)Estado.Cerrado)
            {
                btnResponder.Enabled = false;
            }
        }
Example #14
0
        private void btnSeleccionar_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("¿Desea atender este ticket?", "Seleccionar ticket", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                TicketWS.ticket tck = (TicketWS.ticket)dgvTicketsEspera.CurrentRow.DataBoundItem;

                // Verificar que el ticket no ha sido asignado
                TicketWS.ticket tckBD = ticketDAO.buscarTicketPorId(tck.ticketId);
                if (tckBD.agente.agenteId != 0)
                {
                    MessageBox.Show(
                        "Este ticket ya ha sido asignado a otro agente",
                        "Asignación no realizada",
                        MessageBoxButtons.OK, MessageBoxIcon.Information
                        );
                    Refrescar();
                    dgvTicketsEspera.AutoGenerateColumns = false;
                    dgvTicketsEspera.DataSource          = ticketsEnEspera;
                    return;
                }

                TicketWS.estadoTicket estAsignado = new TicketWS.estadoTicket();
                estAsignado.estadoId = (int)Estado.Asignado;
                estAsignado.nombre   = "ASIGNADO";

                tck.estado = estAsignado;

                // Registrar el cambio de estado
                var historialEstados = new BindingList <TicketWS.cambioEstadoTicket>();

                var cambioEstado = new TicketWS.cambioEstadoTicket();
                cambioEstado.comentario = "El ticket fue asignado a un " + agente.rol.nombre.ToLower() + ".";
                var ag = new TicketWS.agente();
                ag.agenteId = agente.agenteId;
                cambioEstado.agenteResponsable = ag;
                cambioEstado.estadoTo          = estAsignado;

                historialEstados.Add(cambioEstado);

                tck.agente.agenteId = agente.agenteId;
                // Asignar la lista de cambios de estado
                tck.historialEstado = historialEstados.ToArray();

                if (ticketDAO.actualizarTicket(tck) > -1)
                {
                    MessageBox.Show(
                        "Se te ha asignado el ticket correctamente",
                        "Asignación exitosa",
                        MessageBoxButtons.OK, MessageBoxIcon.Information
                        );

                    // Enviar correo al alumno
                    EnviarEmailNotificacion(tck, cambioEstado);
                }
                else
                {
                    MessageBox.Show(
                        "Ha ocurrido un error con la asignación",
                        "Asginación no realizada",
                        MessageBoxButtons.OK, MessageBoxIcon.Information
                        );
                }
                Refrescar();
                dgvTicketsEspera.AutoGenerateColumns = false;
                dgvTicketsEspera.DataSource          = ticketsEnEspera;
            }
        }
Example #15
0
        private void Refrescar(int ticketId)
        {
            ticket = ticketDAO.buscarTicketPorId(ticketId);

            lblAsunto.Text = ticket.asunto;
            lblId.Text     = "# " + ticket.ticketId.ToString();
            lblFecIni.Text = ticket.fechaEnvio.Replace('-', '/').Replace("T", " - ");
            if (ticket.fechaCierreMaximo != null)
            {
                lblFecCieEst.Text = ticket.fechaCierreMaximo.Replace('-', '/').Replace("T", " - ");
            }
            else
            {
                lblFecCieEst.Text = "Error en la fecha";
            }
            lblEstado.Text = ticket.estado.nombre;
            lblBib.Text    = ticket.biblioteca.nombre;
            lblCat.Text    = ticket.categoria.nombre;
            lblUrg.Text    = ticket.urgencia.nombre;
            if (ticket.activoFijo.activoFijoId > 0)
            {
                lblActFij.Text = ticket.activoFijo.codigo;
            }
            else
            {
                lblTituloActFij.Text = "";
            }

            // Segun el estado del ticket

            if (ticket.estado.estadoId == (int)Estado.Cerrado)
            {
                DisableButton(btnCambiarCategoria);
                DisableButton(btnCerrarTicket);
                DisableButton(btnEscalar);
                DisableButton(btnVerTareas);
                DisableButton(btnResponder);
            }
            if (ticket.estado.estadoId == (int)Estado.Escalado)
            {
                DisableButton(btnCambiarCategoria);
            }
            if (ticket.estado.estadoId == (int)Estado.Recategorizado)
            {
                DisableButton(btnCambiarCategoria);
                DisableButton(btnCerrarTicket);
                DisableButton(btnEscalar);
                DisableButton(btnVerTareas);
                DisableButton(btnResponder);
            }
            if (ticket.estado.estadoId == (int)Estado.Activo)
            {
                DisableButton(btnCambiarCategoria);
                DisableButton(btnCerrarTicket);
                DisableButton(btnEscalar);
                DisableButton(btnVerTareas);
                DisableButton(btnResponder);
            }

            if (ticket.historialEstado == null)
            {
                cambiosEstado = new BindingList <TicketWS.cambioEstadoTicket>();
            }
            else
            {
                cambiosEstado = new BindingList <TicketWS.cambioEstadoTicket>(ticket.historialEstado);
            }
            dgvHistorial.AutoGenerateColumns = false;
            dgvHistorial.DataSource          = cambiosEstado;
        }