コード例 #1
0
        private void btnGuardaHistorial_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txbDescripcion.Text))
            {
                MensajeError.Clear();

                int iResultado = new CasoHistorial().AddHistorial(new CasoHistorial()
                {
                    iIdCaso            = int.Parse(lblFolio.Text),
                    iIdUsuarioRegistra = int.Parse(AUsuarioData.sIdusuario),
                    sComentario        = txbDescripcion.Text
                });

                if (iResultado > 0)
                {
                    frmTelefono _frmTelefono = Application.OpenForms["frmTelefono"] as frmTelefono;

                    _frmTelefono.bSeguimiento        = true;
                    _frmTelefono.iIdFolioSeguimiento = int.Parse(lblFolio.Text);
                    _frmTelefono.iIdHistorialFolio   = iResultado;

                    _DialogResult = DialogResult.Yes;
                    _RegistrarLlamadaModal.Close();
                }
                else
                {
                    FlatMessageBox.Show("No se pudo agregar el comentario", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
                }
            }
            else
            {
                this.MensajeError.SetError(txbDescripcion, "Debe anotar una descripción.");
            }
        }
コード例 #2
0
        private void btnCerrarFolio_Click(object sender, EventArgs e)
        {
            if (new Caso().bCerrarCaso(new Caso()
            {
                iIdCaso = _ComentarioCerrarFolio.iNoFolio,
                iIdUsuarioModifica = int.Parse(AUsuarioData.sIdusuario)
            }) == true)
            {
                //bool bAlta = new CasoHistorial().Agregar(new CasoHistorial()
                //{
                //    iIdCaso     = _ComentarioCerrarFolio.iNoFolio,
                //    sComentario = txbDescripcion.Text
                //});

                int iResultado = new CasoHistorial().AddHistorial(new CasoHistorial()
                {
                    iIdCaso            = _ComentarioCerrarFolio.iNoFolio,
                    iIdUsuarioRegistra = int.Parse(AUsuarioData.sIdusuario),
                    sComentario        = txbDescripcion.Text
                });


                _DialogResult = DialogResult.Yes;
                _ComentarioCerrarFolio.Close();

                foreach (Form frm in Application.OpenForms)
                {
                    if (frm.Name == "FSeguimientoFolios")
                    {
                        FSeguimientoFolios _FSeguimientoFolios = frm as FSeguimientoFolios;
                        btnCerrar.Visible = false;
                        _FSeguimientoFolios.cargarFoliosBusqueda(0, 40, 230);
                        break;
                    }
                }
            }
            else
            {
                FlatMessageBox.Show("No se pudo cerrar el folio", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private void btnGuardaHistorial_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txbDescripcion.Text))
            {
                MensajeError.Clear();
                int iResultado = new CasoHistorial().AddHistorial(new CasoHistorial()
                {
                    iIdCaso            = int.Parse(txbFolioLlamada.Text),
                    iIdUsuarioRegistra = int.Parse(AUsuarioData.sIdusuario),
                    sComentario        = txbDescripcion.Text
                });

                if (iResultado > 0)
                {
                    LimpiarControles();
                    txbBuscarCliente.Text               = "";
                    gbLlamada.Visible                   = false;
                    btnRegLlamada.Visible               = true;
                    btnRegLlamada.Enabled               = false;
                    txbBuscarCliente.Enabled            = true;
                    btnBuscarCliente.Enabled            = true;
                    _frmPrincipal.btnRegLlamada.Enabled = false;
                    cbTipoLlamada.Enabled               = true;
                    btnNuevoTipoLlamada.Enabled         = true;
                    btnRegistrar.Visible                = true;
                    btnGuardaHistorial.Location         = new Point(756, 264);
                    btnGuardaHistorial.Visible          = false;
                    txbBuscarCliente.Focus();
                }
                else
                {
                    FlatMessageBox.Show("No se pudo agregar el comentario", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
                }
            }
            else
            {
                this.MensajeError.SetError(txbDescripcion, "Debe anotar una descripción.");
            }
        }
コード例 #4
0
        private void BtnFolio_Click(object sender, EventArgs e)
        {
            Button btnFolio = sender as Button;

            StopPlayer();
            scFoliosAbiertos.Panel2.Controls.Clear();

            Caso caso = new Caso().InformacionCaso(int.Parse(btnFolio.Name));

            Panel pnlTitulo = new Panel();

            pnlTitulo.Height    = 2;
            pnlTitulo.Dock      = DockStyle.Top;
            pnlTitulo.BackColor = Color.FromArgb(174, 213, 129);

            PictureBox pctInfo = new PictureBox();

            pctInfo.BackgroundImage       = Properties.Resources.info_25px;
            pctInfo.Location              = new Point(30, 17);
            pctInfo.BackgroundImageLayout = ImageLayout.None;
            pctInfo.Height = 26;
            pctInfo.Width  = 26;

            Label lblTitulo = new Label();

            lblTitulo.Text      = "Detalles Folio " + caso.iIdCaso;
            lblTitulo.Location  = new Point(53, 18);             //29, 8
            lblTitulo.Font      = new Font("Calibri Light", 14); //122,23
            lblTitulo.Anchor    = AnchorStyles.Left | AnchorStyles.Top;
            lblTitulo.TextAlign = ContentAlignment.TopLeft;
            lblTitulo.Width     = 220;
            lblTitulo.ForeColor = Color.FromArgb(7, 22, 127);

            Label lblMotivo = new Label();

            lblMotivo.Text      = string.Format("Tipo de Llamada{0}{1}", Environment.NewLine, caso.sMotivo);
            lblMotivo.Location  = new Point(30, 55);             //480, 8
            lblMotivo.Font      = new Font("Calibri Light", 13); //122,23
            lblMotivo.Anchor    = AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Left;
            lblMotivo.TextAlign = ContentAlignment.TopLeft;
            lblMotivo.Width     = 150;
            lblMotivo.Height    = 45;

            Label lblFechaCreacion = new Label();

            lblFechaCreacion.Text      = string.Format("Fecha Solicitud{0}{1}", Environment.NewLine, caso.dtFechaCreacion);
            lblFechaCreacion.Location  = new Point(570, 55);            //30, 44 657, 55
            lblFechaCreacion.Font      = new Font("Calibri Light", 12); //122,23
            lblFechaCreacion.Anchor    = AnchorStyles.Left | AnchorStyles.Top;
            lblFechaCreacion.TextAlign = ContentAlignment.TopLeft;
            lblFechaCreacion.Width     = 220;
            lblFechaCreacion.Height    = 45;

            Label lblContador = new Label();

            lblContador.Text      = string.Format("Contador{0}{1} {2} {3}", Environment.NewLine, caso.sContadorNombre, caso.sContadorAPaterno, caso.sContadorAMaterno);
            lblContador.Location  = new Point(260, 55);            //29, 8
            lblContador.Font      = new Font("Calibri Light", 13); //122,23
            lblContador.Anchor    = AnchorStyles.Left | AnchorStyles.Top;
            lblContador.TextAlign = ContentAlignment.TopLeft;
            lblContador.Width     = 320;
            lblContador.Height    = 45;

            LollipopTextBox txtComentario = new LollipopTextBox();

            txtComentario.Multiline    = true;
            txtComentario.Text         = string.Format("Comentario{0}{1}", Environment.NewLine, caso.sDescripcion);
            txtComentario.Location     = new Point(33, 120);            //29, 8
            txtComentario.Font         = new Font("Calibri Light", 13); //122,23
            txtComentario.Width        = 750;                           //845
            txtComentario.Height       = 65;
            txtComentario.Anchor       = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
            txtComentario.FocusedColor = "#FFA300";
            txtComentario.ReadOnly     = true;


            SplitContainer sCHistorial = new SplitContainer();

            sCHistorial.Location         = new Point(30, 200); //162
            sCHistorial.Width            = 385;                //450
            sCHistorial.Height           = 120;                //120
            sCHistorial.Anchor           = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;
            sCHistorial.BackColor        = Color.FromArgb(227, 227, 227);
            sCHistorial.Panel1.BackColor = Color.FromArgb(236, 240, 241);   // Color.White;
            sCHistorial.Panel2.BackColor = Color.White;
            sCHistorial.SplitterWidth    = 1;
            sCHistorial.SplitterDistance = 180;


            //CONTROL SPLITCONTAINER DONDE SE MOSTRARAN LAS GRABACIONES
            SplitContainer sCGrabaciones = new SplitContainer();

            sCGrabaciones.Name             = "sCGrabaciones";
            sCGrabaciones.Location         = new Point(430, 200); //490, 200
            sCGrabaciones.Width            = 385;                 //385
            sCGrabaciones.Height           = 120;                 //94
            sCGrabaciones.Anchor           = AnchorStyles.Right | AnchorStyles.Bottom;
            sCGrabaciones.BackColor        = Color.FromArgb(236, 240, 241);
            sCGrabaciones.Panel1.BackColor = Color.FromArgb(236, 240, 241);
            sCGrabaciones.Panel2.BackColor = Color.White;
            sCGrabaciones.SplitterWidth    = 2;
            sCGrabaciones.SplitterDistance = 180; //170



            CasoHistorial casoHistorial = new CasoHistorial();

            LCasoHistorial = casoHistorial.GetListCasoHistorial(caso.iIdCaso);
            for (int i = 0; i < LCasoHistorial.Count; i++)
            {
                Button btnHistorial = new Button();
                btnHistorial.Location  = new Point(0, 24 * i + 0);                 //new Point(12, 24 * i + 0);
                btnHistorial.Name      = LCasoHistorial[i].iIdCasoHistorial.ToString();
                btnHistorial.Text      = "  " + LCasoHistorial[i].dtFechaCreacion.ToString();
                btnHistorial.Font      = new Font("Segoe UI", 9);
                btnHistorial.ForeColor = Color.FromArgb(105, 105, 105);
                btnHistorial.Width     = 180;                 //225//160
                btnHistorial.Height    = 24;
                btnHistorial.FlatStyle = FlatStyle.Flat;
                btnHistorial.FlatAppearance.BorderSize = 0;
                btnHistorial.Anchor            = AnchorStyles.Left | AnchorStyles.Right;
                btnHistorial.TextAlign         = ContentAlignment.MiddleLeft;
                btnHistorial.Cursor            = Cursors.Hand;
                btnHistorial.Image             = Properties.Resources.clock_16px1;
                btnHistorial.ImageAlign        = ContentAlignment.TopLeft;
                btnHistorial.TextImageRelation = TextImageRelation.ImageBeforeText;

                btnHistorial.Click += (s, ev) =>
                {
                    sCHistorial.Panel2.Controls.Clear();
                    CasoHistorial casoH             = new CasoHistorial().GetInfoCasoHistorial(int.Parse(btnHistorial.Name));
                    Label         lblFechaCreacionH = new Label();
                    lblFechaCreacionH.Width    = 200;
                    lblFechaCreacionH.Height   = 45;
                    lblFechaCreacionH.Location = new Point(10, 5);
                    lblFechaCreacionH.Text     = string.Format("Por: {0}{1}Fecha {2}", casoH.sUsuario, Environment.NewLine, casoH.dtFechaCreacion);

                    RichTextBox txtComentarioH = new RichTextBox();
                    txtComentarioH.Text        = string.Format("Comentario{0}{1}", Environment.NewLine, casoH.sComentario);
                    txtComentarioH.Location    = new Point(10, 65);             //29, 8//10, 35
                    txtComentarioH.Font        = new Font("Calibri Light", 11); //122,23
                    txtComentarioH.Width       = 180;                           //270
                    txtComentarioH.Height      = 58;
                    txtComentarioH.Anchor      = AnchorStyles.Left | AnchorStyles.Right;
                    txtComentarioH.BorderStyle = BorderStyle.None;
                    txtComentarioH.ReadOnly    = true;
                    txtComentarioH.BackColor   = Color.White;

                    sCHistorial.Panel2.Controls.Add(txtComentarioH);
                    sCHistorial.Panel2.Controls.Add(lblFechaCreacionH);
                };

                sCHistorial.Panel1.Controls.Add(btnHistorial);
            }

            //using (new NetworkConnection(PathFolderShared, _NetworkCredential))
            //{
            //OBTIENE UNA LISTA DE ARCHIVOS CON EXTENCIÓN DESDE UN DIRECTORIO Y SE AGREGAN A UNA LISTA
            //DirectoryInfo _DirectoryInfo   = new DirectoryInfo(@"\\192.169.143.34\\MiPyme_Files\\Documentos\\Grabaciones\\");
            DirectoryInfo          _DirectoryInfo = new DirectoryInfo(@"\\192.168.1.34\\Documentos\\" + LogicaCC.ConnectionString.FolderConnection + "\\Documentos\\Grabaciones\\");
            IEnumerable <FileInfo> fileList       = _DirectoryInfo.GetFiles("*.WAV", SearchOption.AllDirectories);

            sCGrabaciones.Panel1.Controls.Clear();
            int g = 0;

            foreach (FileInfo fi in fileList.Where(fi => fi.Name.Contains("Folio-" + caso.iIdCaso + "-")).OrderByDescending(fi => fi.Name))
            {
                g++;
                //BOTON QUE SE GENERA POR CADA ARCHIVO ENCONTRADO DE LA LISTA DE DOCUMENTPS FILTRADOS
                Button btnGrabacion = new Button();
                btnGrabacion.Location  = new Point(0, 24 * g + -23);                     //(0, 24 * g + 0);//0, 24 * g + -23
                btnGrabacion.Name      = fi.FullName;
                btnGrabacion.Text      = " " + fi.Name;
                btnGrabacion.Font      = new Font("Segoe UI", 9);
                btnGrabacion.ForeColor = Color.FromArgb(105, 105, 105);
                btnGrabacion.Width     = 180;                     //225
                btnGrabacion.Height    = 24;
                btnGrabacion.TextAlign = ContentAlignment.MiddleLeft;
                btnGrabacion.Cursor    = Cursors.Hand;
                btnGrabacion.FlatStyle = FlatStyle.Flat;
                btnGrabacion.FlatAppearance.BorderSize = 0;
                btnGrabacion.Image             = Properties.Resources.microphone_16px1;
                btnGrabacion.ImageAlign        = ContentAlignment.TopLeft;
                btnGrabacion.TextImageRelation = TextImageRelation.ImageBeforeText;
                btnGrabacion.AutoEllipsis      = true;

                //EVENTO CLICK DEL BOTON GRANACIÓN
                btnGrabacion.Click += (s, ev) =>
                {
                    StopPlayer();
                    sCGrabaciones.Panel2.Controls.Clear();
                    //TITULO DE LA GRABACIÓN
                    Label lblGrabacion = new Label();
                    lblGrabacion.Location  = new Point(65, 30);
                    lblGrabacion.Text      = "Grabación";
                    lblGrabacion.Font      = new Font("Calibri Light", 10);
                    lblGrabacion.ForeColor = Color.FromArgb(105, 105, 105);

                    //NOMBRE DE LA GRABACIÓN
                    Label lblNombreGrabacion = new Label();
                    lblNombreGrabacion.Location  = new Point(5, 4);
                    lblNombreGrabacion.Text      = fi.Name;
                    lblNombreGrabacion.Font      = new Font("Calibri Light", 10);
                    lblNombreGrabacion.ForeColor = Color.FromArgb(105, 105, 105);
                    lblNombreGrabacion.Width     = 180;
                    lblNombreGrabacion.Height    = 20;

                    //CONTROL LINK PARA REPRODUCIR LAS GRABACIONES
                    Bitmap play_25px = Properties.Resources.play_25px1;
                    Bitmap stop_25px = Properties.Resources.stop_25px1;
                    MetroFramework.Controls.MetroLink lnkPlayer = new MetroFramework.Controls.MetroLink();
                    lnkPlayer.Image     = play_25px;
                    lnkPlayer.Location  = new Point(85, 50);
                    lnkPlayer.ImageSize = 25;
                    lnkPlayer.Width     = 25;
                    lnkPlayer.Height    = 25;
                    lnkPlayer.Cursor    = Cursors.Hand;

                    //CONTROL PARA REPRODUCIR AUDIO
                    AxWindowsMediaPlayer axWindowsMediaPlayer1 = new AxWindowsMediaPlayer();
                    axWindowsMediaPlayer1.Location = new Point(30, 85);    //(30, 85);
                    axWindowsMediaPlayer1.Width    = 140;
                    axWindowsMediaPlayer1.Height   = 50;

                    axWindowsMediaPlayer1.PlayStateChange += (object senderr, _WMPOCXEvents_PlayStateChangeEvent es) =>
                    {
                        if (es.newState == 8)
                        {
                            lnkPlayer.Image = play_25px;
                            lnkPlayer.Refresh();
                        }
                    };

                    Panel pnl1 = new Panel();
                    pnl1.BackColor = Color.White;
                    pnl1.Location  = new Point(30, 83);
                    pnl1.Width     = 140;
                    pnl1.Height    = 10;

                    Panel pnl2 = new Panel();
                    pnl2.BackColor = Color.White;
                    pnl2.Location  = new Point(30, 103);
                    pnl2.Width     = 140;
                    pnl2.Height    = 34;

                    Panel pnl3 = new Panel();
                    pnl3.BackColor = Color.White;
                    pnl3.Location  = new Point(30, 83);
                    pnl3.Width     = 28;
                    pnl3.Height    = 50;

                    Panel pnl4 = new Panel();
                    pnl4.BackColor = Color.White;
                    pnl4.Location  = new Point(142, 83);
                    pnl4.Width     = 28;
                    pnl4.Height    = 50;

                    //EVENTO CLICK DEL CONTROL METROLINK
                    lnkPlayer.Click += (se, eva) =>
                    {
                        string path = btnGrabacion.Name;

                        axWindowsMediaPlayer1.URL = path;

                        if (lnkPlayer.Image == play_25px)
                        {
                            lnkPlayer.Image = stop_25px;
                            axWindowsMediaPlayer1.Ctlcontrols.play();
                        }
                        else
                        {
                            lnkPlayer.Image = play_25px;
                            axWindowsMediaPlayer1.Ctlcontrols.stop();
                        }
                    };
                    sCGrabaciones.Panel2.Controls.Add(lnkPlayer);
                    sCGrabaciones.Panel2.Controls.Add(lblNombreGrabacion);
                    sCGrabaciones.Panel2.Controls.Add(lblGrabacion);
                    sCGrabaciones.Panel2.Controls.Add(pnl1);
                    sCGrabaciones.Panel2.Controls.Add(pnl2);
                    sCGrabaciones.Panel2.Controls.Add(pnl3);
                    sCGrabaciones.Panel2.Controls.Add(pnl4);
                    sCGrabaciones.Panel2.Controls.Add(axWindowsMediaPlayer1);
                };
                sCGrabaciones.Panel1.Controls.Add(btnGrabacion);
            }
            //}

            LollipopButton btnSeguimiento = new LollipopButton();

            btnSeguimiento.Location = new Point(620, 18);
            btnSeguimiento.Name     = caso.iIdCaso.ToString();
            btnSeguimiento.Text     = "Dar Seguimiento";
            btnSeguimiento.Width    = 126;
            btnSeguimiento.Height   = 24;
            btnSeguimiento.Anchor   = AnchorStyles.Right | AnchorStyles.Top;
            btnSeguimiento.Cursor   = Cursors.Hand;
            btnSeguimiento.Tag      = caso.sMotivo;
            btnSeguimiento.BGColor  = "#2196F3";
            btnSeguimiento.Click   += BtnSeguimiento_Click;

            //AGREGAMOS LOS CONTROLES AL PANEL 2
            scFoliosAbiertos.Panel2.Controls.Add(pnlTitulo);
            scFoliosAbiertos.Panel2.Controls.Add(pctInfo);
            scFoliosAbiertos.Panel2.Controls.Add(lblTitulo);
            scFoliosAbiertos.Panel2.Controls.Add(lblMotivo);
            scFoliosAbiertos.Panel2.Controls.Add(lblFechaCreacion);
            scFoliosAbiertos.Panel2.Controls.Add(lblContador);
            scFoliosAbiertos.Panel2.Controls.Add(txtComentario);
            scFoliosAbiertos.Panel2.Controls.Add(sCHistorial);
            scFoliosAbiertos.Panel2.Controls.Add(sCGrabaciones);
            scFoliosAbiertos.Panel2.Controls.Add(btnSeguimiento);
        }
コード例 #5
0
ファイル: frmTelefono.cs プロジェクト: Mbmaldon/LxJuridico
        void call_CallStateChanged(object sender, CallStateChangedArgs e)
        {
            InvokeGUIThread(() => { lbl_CallState.Text = e.State.ToString(); lblEstatusLlamada.Text = e.State.ToString(); });

            if (e.State == CallState.Answered)
            {
                InvokeGUIThread(() => {
                    wplayer.controls.stop();
                    crearFolio();
                    ALlamadaData.bCurso = true;

                    string sRuta = string.Format(@"{0}\mpy\records\nws", Path.GetTempPath());
                    if (!Directory.Exists(sRuta))
                    {
                        Directory.CreateDirectory(sRuta);
                    }
                });

                StartDevices();
                SendDTMFSingnal();

                sFechaInicio = DateTime.Now;
                sRecordName  = AProspeccionData.bCurso ? string.Format("pcll-{1}.wav", Path.GetTempPath(), AProspeccionData.iIdLlamada) : string.Format("Folio-{0}-{1}{2}{3}{4}{5}{6}.wav", iIdFolio, sFechaInicio.Day, sFechaInicio.Month, sFechaInicio.Year, sFechaInicio.Hour, sFechaInicio.Minute, sFechaInicio.Second);
                filename     = string.Format(@"{0}\mpy\records\nws\{1}", Path.GetTempPath(), sRecordName);

                recorder = new WaveStreamRecorder(filename);  // new recorder object
                _connector.Connect(_microphone, recorder);    // connects the outgoing voice to the recorder
                _connector.Connect(_mediaReceiver, recorder); // connects the incoming voice to the recorder

                _mediaSender.AttachToCall(_call);
                _mediaReceiver.AttachToCall(_call);
                recorder.Start();  // starts the recording

                InvokeGUIThread(() => {
                    timer1.Start();
                    txtDisplay.Text     = "" + ((IPhoneCall)sender).DialInfo.SIPCallerID.DisplayName;
                    lblExtEntrante.Text = "" + ((IPhoneCall)sender).DialInfo.SIPCallerID.DisplayName;

                    if (!AProspeccionData.bCurso)
                    {
                        // Valida despues de mostrar la modal para registrar la llamada
                        if (RegistrarLlamadaModal.Show(iIdFolio, filename) == DialogResult.Yes)
                        {
                            Cliente ACliente = new Cliente();
                            Caso NoCliente;
                            if (bSeguimiento)
                            {
                                NoCliente = new Caso().ClienteCaso(iIdFolioSeguimiento);
                            }
                            else
                            {
                                NoCliente = new Caso().ClienteCaso(iIdFolio);
                            }
                        }
                    }
                });
            }
            else if (e.State == CallState.InCall)
            {
                StartDevices();
            }

            if (e.State == CallState.LocalHeld || e.State == CallState.InactiveHeld)
            {
                StopDevices();
                InvokeGUIThread(() => {
                    lnkHold.Text         = "Unhold";
                    lnkHold.Image        = Properties.Resources.resume_button_48px;
                    lnkHold.NoFocusImage = Properties.Resources.resume_button_48px;
                });
            }
            else
            {
                InvokeGUIThread(() => {
                    lnkHold.Text         = "Hold";
                    lnkHold.Image        = Properties.Resources.pause_48px;
                    lnkHold.NoFocusImage = Properties.Resources.pause_48px;
                });
            }

            if (e.State.IsCallEnded())
            {
                StopDevices();

                _mediaSender.Detach();
                _mediaReceiver.Detach();

                WireDownCallEvents();

                if (recorder != null)
                {
                    recorder.Dispose();
                    recorder = null;
                }

                _call = null;

                timer1.Stop();

                InvokeGUIThread(() => {
                    wplayer.controls.stop();
                    txtDisplay.Text     = String.Empty;
                    lblExtEntrante.Text = string.Empty;
                    lblTiempo.Text      = string.Empty;

                    if (pnlLlamada.Visible == true)
                    {
                        frmTelefono.Animate2(pnlLlamada, frmTelefono.Effect.Slide, 150, 360);
                        frmTelefono.Animate(pnlKeyPad, frmTelefono.Effect.Slide, 150, 360);
                    }

                    lnkPickUpInCall.Visible      = true;
                    lnkVolverLLamada.Visible     = false;
                    pnlTransferirLlamada.Visible = false;
                    txtNoTransferir.Text         = string.Empty;
                    lnkConfigurar.Enabled        = true;
                    lnkHangUp.Location           = new Point(150, 94);
                    AProspeccionData.bCurso      = false;

                    string sFilePath = "";
                    if (bSeguimiento && iIdFolioSeguimiento != 0)
                    {
                        sFilePath = string.Format(@"{0}\mpy\records\nws\Folio-{1}-{2}{3}{4}{5}{6}{7}.wav", Path.GetTempPath(), iIdFolioSeguimiento, sFechaInicio.Day, sFechaInicio.Month, sFechaInicio.Year, sFechaInicio.Hour, sFechaInicio.Minute, sFechaInicio.Second);
                        File.Move(filename, sFilePath);
                        CasoHistorial _UpdRecord = new CasoHistorial();
                        _UpdRecord.UpdateHistorialRecord(iIdHistorialFolio, sFilePath);
                    }

                    if (ALlamadaData.bCurso)
                    {
                        if (sFilePath == "")
                        {
                            string FullPath = string.Format("{0}/{1}/Records/", FTPCredentials.Path, ConnectionString.FolderConnection);
                            FTPServer.Upload(FullPath, FTPCredentials.User, FTPCredentials.Password, Path.GetFileName(filename), filename);
                            File.Delete(filename);
                        }
                        else
                        {
                            string FullPath = string.Format("{0}/{1}/Records/", FTPCredentials.Path, ConnectionString.FolderConnection);
                            FTPServer.Upload(FullPath, FTPCredentials.User, FTPCredentials.Password, Path.GetFileName(sFilePath), sFilePath);
                            File.Delete(sFilePath);
                        }
                        ALlamadaData.bCurso = false;
                    }
                });
            }
        }
コード例 #6
0
        public void BtnFolio_Click(object sender, EventArgs e)
        {
            Button btnFolio = sender as Button;

            StopPlayer();
            //scFoliosAbiertos.Panel2.Controls.Clear();

            Caso caso = new Caso().InformacionCaso(int.Parse(btnFolio.Name));

            lblTitulo.Text        = "Detalles Folio " + caso.iIdCaso;
            lblMotivo.Text        = string.Format("Tipo de Llamada{0}{1}", Environment.NewLine, caso.sMotivo);
            lblFechaCreacion.Text = string.Format("Fecha de Solicitud{0}{1}", Environment.NewLine, caso.dtFechaCreacion);
            lblFechaCierre.Text   = string.Format("Fecha de Cierre{0}{1}", Environment.NewLine, caso.sFechaCierre);
            lblCliente.Text       = string.Format("No. cliente{0}{1}", Environment.NewLine, caso.sCliente);
            lblClienteNombre.Text = string.Format("Cliente{0}{1} {2}  {3}", Environment.NewLine, caso.sNombre, caso.sAPaterno, caso.sAMaterno);
            lblContador.Text      = string.Format("Contador{0}{1} {2} {3}", Environment.NewLine, caso.sContadorNombre, caso.sContadorAPaterno, caso.sContadorAMaterno);
            txtComentario.Text    = string.Format("Comentario{0}{1}", Environment.NewLine, caso.sDescripcion);



            //SE GENERA UNA LISTA DE CASOS
            CasoHistorial casoHistorial = new CasoHistorial();

            LCasoHistorial = casoHistorial.GetListCasoHistorial(caso.iIdCaso);
            for (int i = 0; i < LCasoHistorial.Count; i++)
            {
                //SE CREA UNA LISTA DE BOTONES
                Button btnHistorial = new Button();
                btnHistorial.Location  = new Point(0, 24 * i + 0);
                btnHistorial.Name      = LCasoHistorial[i].iIdCasoHistorial.ToString();
                btnHistorial.Text      = "  " + LCasoHistorial[i].dtFechaCreacion.ToString();
                btnHistorial.Font      = new Font("Segoe UI", 9);
                btnHistorial.ForeColor = Color.FromArgb(105, 105, 105);
                btnHistorial.Width     = 180; //225
                btnHistorial.Height    = 24;
                btnHistorial.FlatStyle = FlatStyle.Flat;
                btnHistorial.FlatAppearance.BorderSize = 0;
                btnHistorial.Anchor            = AnchorStyles.Left | AnchorStyles.Right;
                btnHistorial.TextAlign         = ContentAlignment.MiddleLeft;
                btnHistorial.Cursor            = Cursors.Hand;
                btnHistorial.Image             = Properties.Resources.clock_16px1;
                btnHistorial.ImageAlign        = ContentAlignment.TopLeft;
                btnHistorial.TextImageRelation = TextImageRelation.ImageBeforeText;

                //EVENTO CLICK DEL BOTON HISTORIAL
                btnHistorial.Click += (s, ev) =>
                {
                    sCHistorial.Panel2.Controls.Clear();
                    CasoHistorial casoH = new CasoHistorial().GetInfoCasoHistorial(int.Parse(btnHistorial.Name));

                    //SE GENERA LABEL QUE CONTENDRA LA FECHA DEL HISTORICO
                    Label lblFechaCreacionH = new Label();
                    lblFechaCreacionH.Width    = 200;
                    lblFechaCreacionH.Height   = 45;
                    lblFechaCreacionH.Location = new Point(10, 15);
                    lblFechaCreacionH.Font     = new Font("Calibri Light", 11);
                    lblFechaCreacionH.Text     = string.Format("Por{0}{1}", Environment.NewLine, casoH.sUsuario);

                    //SE GENERA UN ACONTROL RICHTEXTBOX DONDE SE AGREGARA EL COMENTARIO DEL HISTORICO
                    RichTextBox txtComentarioH = new RichTextBox();
                    txtComentarioH.Text        = string.Format("Comentario{0}{1}", Environment.NewLine, casoH.sComentario);
                    txtComentarioH.Location    = new Point(10, 65);             //29, 8
                    txtComentarioH.Font        = new Font("Calibri Light", 11); //122,23
                    txtComentarioH.Width       = 250;                           //470
                    txtComentarioH.Height      = 80;
                    txtComentarioH.Anchor      = AnchorStyles.Left | AnchorStyles.Right;
                    txtComentarioH.BorderStyle = BorderStyle.None;
                    txtComentarioH.ReadOnly    = true;
                    txtComentarioH.BackColor   = Color.White;

                    sCHistorial.Panel2.Controls.Add(txtComentarioH);
                    sCHistorial.Panel2.Controls.Add(lblFechaCreacionH);
                };

                sCHistorial.Panel1.Controls.Add(btnHistorial);
            }



            //SE GENERA BOTON PARA CERRAR FOLIO(SOLO SI EL FOLIO ESTA ABIERTO)
            MaterialSkin.Controls.MaterialRaisedButtonCustom btnCerrarFolio = new MaterialSkin.Controls.MaterialRaisedButtonCustom();
            btnCerrarFolio.Location = new Point(699, 18); //745, 18
            btnCerrarFolio.Name     = caso.iIdCaso.ToString();
            btnCerrarFolio.Text     = "Cerrar Folio";
            btnCerrarFolio.Width    = 105;//160
            btnCerrarFolio.Height   = 23;
            btnCerrarFolio.Anchor   = AnchorStyles.Right | AnchorStyles.Top;
            btnCerrarFolio.Cursor   = Cursors.Hand;
            btnCerrarFolio.Tag      = caso.sMotivo;
            btnCerrarFolio.BGColor  = "#304FFE";
            btnCerrarFolio.Click   += BtnCerrarFolio_Click;

            //AGREGAMOS LOS CONTROLES AL PANEL 2
            //scFoliosAbiertos.Panel2.Controls.Add(pctInfo);
            //scFoliosAbiertos.Panel2.Controls.Add(lblTitulo);
            //scFoliosAbiertos.Panel2.Controls.Add(lblMotivo);
            //scFoliosAbiertos.Panel2.Controls.Add(lblFechaCreacion);
            //scFoliosAbiertos.Panel2.Controls.Add(lblFechaCierre);
            //scFoliosAbiertos.Panel2.Controls.Add(lblCliente);
            //scFoliosAbiertos.Panel2.Controls.Add(lblClienteNombre);
            //scFoliosAbiertos.Panel2.Controls.Add(lblContador);
            //scFoliosAbiertos.Panel2.Controls.Add(txtComentario);
            //scFoliosAbiertos.Panel2.Controls.Add(lblHistorial);
            //scFoliosAbiertos.Panel2.Controls.Add(sCHistorial);
            //scFoliosAbiertos.Panel2.Controls.Add(sCGrabaciones);

            if (caso.bActivo)
            {
                scFoliosAbiertos.Panel2.Controls.Add(btnCerrarFolio);
            }
        }
コード例 #7
0
        private void BtnFolio_Click(object sender, EventArgs e)
        {
            Button btnFolio = sender as Button;

            axWindowsMediaPlayer1.Ctlcontrols.stop();
            RestartControlls(true);
            LlenarListView();

            Caso caso = new Caso().InformacionCaso(int.Parse(btnFolio.Name));

            lblTitulo.Text        = string.Format("Detalles Folio {0}", caso.iIdCaso);
            lblMotivo.Text        = string.Format("Tipo de Llamada{0}{1}", Environment.NewLine, caso.sMotivo);
            lblContador.Text      = string.Format("Contador{0}{1} {2} {3}", Environment.NewLine, caso.sContadorNombre, caso.sContadorAPaterno, caso.sContadorAMaterno);
            txtComentario.Text    = string.Format("Comentario{0}{1}", Environment.NewLine, caso.sDescripcion);
            lblFechaCreacion.Text = string.Format("Fecha Solicitud{0}{1}", Environment.NewLine, caso.dtFechaCreacion);

            CasoHistorial casoHistorial = new CasoHistorial();

            LCasoHistorial = casoHistorial.GetListCasoHistorial(caso.iIdCaso);
            for (int i = 0; i < LCasoHistorial.Count; i++)
            {
                Button btnHistorial = new Button();
                btnHistorial.Location                  = new Point(0, 24 * i + 0);//new Point(12, 24 * i + 0);
                btnHistorial.Name                      = LCasoHistorial[i].iIdCasoHistorial.ToString();
                btnHistorial.Text                      = "  " + LCasoHistorial[i].dtFechaCreacion.ToString();
                btnHistorial.Font                      = new Font("Segoe UI", 9);
                btnHistorial.ForeColor                 = Color.FromArgb(105, 105, 105);
                btnHistorial.Width                     = 180;    //225//160
                btnHistorial.Height                    = 24;
                btnHistorial.FlatStyle                 = FlatStyle.Flat;
                btnHistorial.Anchor                    = AnchorStyles.Left | AnchorStyles.Right;
                btnHistorial.TextAlign                 = ContentAlignment.MiddleLeft;
                btnHistorial.Cursor                    = Cursors.Hand;
                btnHistorial.Image                     = Properties.Resources.clock_16px1;
                btnHistorial.ImageAlign                = ContentAlignment.TopLeft;
                btnHistorial.TextImageRelation         = TextImageRelation.ImageBeforeText;
                btnHistorial.FlatAppearance.BorderSize = 0;

                btnHistorial.Click += (s, ev) =>
                {
                    sCHistorial.Panel2.Controls.Clear();
                    CasoHistorial casoH             = new CasoHistorial().GetInfoCasoHistorial(int.Parse(btnHistorial.Name));
                    Label         lblFechaCreacionH = new Label();
                    lblFechaCreacionH.Width    = 200;
                    lblFechaCreacionH.Height   = 45;
                    lblFechaCreacionH.Location = new Point(10, 5);
                    lblFechaCreacionH.Text     = "Por: " + casoH.sUsuario + Environment.NewLine + "Fecha " + casoH.dtFechaCreacion;
                    lblFechaCreacionH.Font     = new Font("Calibri Light", 11);

                    RichTextBox txtComentarioH = new RichTextBox();
                    txtComentarioH.Text        = "Comentario" + Environment.NewLine + casoH.sComentario;
                    txtComentarioH.Location    = new Point(10, 65);             //29, 8//10, 35
                    txtComentarioH.Font        = new Font("Calibri Light", 11); //122,23
                    txtComentarioH.Width       = 180;                           //270
                    txtComentarioH.Height      = 58;
                    txtComentarioH.Anchor      = AnchorStyles.Left | AnchorStyles.Right;
                    txtComentarioH.BorderStyle = BorderStyle.None;
                    txtComentarioH.ReadOnly    = true;
                    txtComentarioH.BackColor   = Color.White;

                    sCHistorial.Panel2.Controls.Add(txtComentarioH);
                    sCHistorial.Panel2.Controls.Add(lblFechaCreacionH);
                };

                sCHistorial.Panel1.Controls.Add(btnHistorial);
            }

            List <String> fileList = EndFTPRead();

            sCGrabaciones.Panel1.Controls.Clear();
            int g = 0;

            foreach (var fi in fileList.Where(fi => fi.Contains("Folio-" + caso.iIdCaso + "-")).OrderByDescending(fi => fi))
            {
                g++;
                //BOTON QUE SE GENERA POR CADA ARCHIVO ENCONTRADO DE LA LISTA DE DOCUMENTPS FILTRADOS
                Button btnGrabacion = new Button();
                btnGrabacion.Location  = new Point(0, 24 * g + -23); //(0, 24 * g + 0);//0, 24 * g + -23
                btnGrabacion.Name      = fi;
                btnGrabacion.Text      = " " + fi;
                btnGrabacion.Font      = new Font("Segoe UI", 9);
                btnGrabacion.ForeColor = Color.FromArgb(105, 105, 105);
                btnGrabacion.Width     = 180; //225
                btnGrabacion.Height    = 24;
                btnGrabacion.TextAlign = ContentAlignment.MiddleLeft;
                btnGrabacion.Cursor    = Cursors.Hand;
                btnGrabacion.FlatStyle = FlatStyle.Flat;
                btnGrabacion.FlatAppearance.BorderSize = 0;
                btnGrabacion.Image             = Properties.Resources.microphone_16px1;
                btnGrabacion.ImageAlign        = ContentAlignment.TopLeft;
                btnGrabacion.TextImageRelation = TextImageRelation.ImageBeforeText;
                btnGrabacion.AutoEllipsis      = true;
                btnGrabacion.Click            += BtnGrabacion_Click;

                sCGrabaciones.Panel1.Controls.Add(btnGrabacion);
            }

            LollipopButton btnSeguimiento = new LollipopButton();

            btnSeguimiento.Location = new Point(745, 18);
            btnSeguimiento.Name     = caso.iIdCaso.ToString();
            btnSeguimiento.Text     = "Dar Seguimiento";
            btnSeguimiento.Width    = 130;//160
            btnSeguimiento.Height   = 30;
            btnSeguimiento.Anchor   = AnchorStyles.Right | AnchorStyles.Top;
            btnSeguimiento.Cursor   = Cursors.Hand;
            btnSeguimiento.Tag      = caso.sMotivo;
            btnSeguimiento.BGColor  = "#001489";
            btnSeguimiento.Click   += BtnSeguimiento_Click;
        }