private void contextMenuStrip1_MouseClick(object sender, MouseEventArgs e)
        {
            if (contextMenuStrip1.Items[1].Selected)
            {
                if (FlatMessageBox.Show("¿Está seguro de eliminar el archivo?", "SI", "NO", FlatMessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    FtpWebRequest request = (FtpWebRequest)WebRequest.Create(sRutaActual + lvCarpetas.SelectedItems[0].Text);
                    request.Method      = WebRequestMethods.Ftp.DeleteFile;
                    request.Credentials = new NetworkCredential(FTPCredentials.User, FTPCredentials.Password);
                    FtpWebResponse response = (FtpWebResponse)request.GetResponse();
                    response.Close();
                    UpdateList();
                }
            }
            else if (contextMenuStrip1.Items[2].Selected)
            {
                // Opción para descargar el archivo seleccionado
                DownloadData.sRutaArchivo   = sRutaActual;
                DownloadData.sNombreArchivo = lvCarpetas.SelectedItems[0].Text;

                frmDescargarArchivos DownloadFile = new frmDescargarArchivos();
                DownloadFile.StartPosition = FormStartPosition.Manual;
                DownloadFile.Location      = new Point((Screen.PrimaryScreen.WorkingArea.Width - DownloadFile.Width) - 10
                                                       , (Screen.PrimaryScreen.WorkingArea.Height - DownloadFile.Height) - 10);
                DownloadFile.ShowDialog();
            }
            else if (contextMenuStrip1.Items[4].Selected)
            {
                UpdateList();
            }
        }
Exemple #2
0
        private void lnkGuardarLineaCaptura_Click(object sender, EventArgs e)
        {
            DownloadData.sRutaArchivo   = string.Format("ftp://{0}/{1}/{2}/-Declaraciones/{3}", FTPCredentials.Path, ConnectionString.FolderConnection, _Editar.sClient, _Editar.iIdStatement);
            DownloadData.sNombreArchivo = string.Format("{0}.pdf", _Editar.iIdStatement);

            frmDescargarArchivos DownloadFile = new frmDescargarArchivos();

            DownloadFile.StartPosition = FormStartPosition.Manual;
            DownloadFile.Location      = new Point((Screen.PrimaryScreen.WorkingArea.Width - DownloadFile.Width) - 10
                                                   , (Screen.PrimaryScreen.WorkingArea.Height - DownloadFile.Height) - 10);
            DownloadFile.ShowDialog();
        }
Exemple #3
0
        private void lnkGuardarArchivoPago_Click(object sender, EventArgs e)
        {
            string sPathFile = new Adjunto().GetPathAttachment(_Editar.iIdStatement);

            if (!string.IsNullOrEmpty(sPathFile))
            {
                DownloadData.sRutaArchivo   = string.Format("ftp://{0}", Path.GetDirectoryName(sPathFile)).Replace(@"\", "/");
                DownloadData.sNombreArchivo = Path.GetFileName(sPathFile);

                frmDescargarArchivos DownloadFile = new frmDescargarArchivos();
                DownloadFile.StartPosition = FormStartPosition.Manual;
                DownloadFile.Location      = new Point((Screen.PrimaryScreen.WorkingArea.Width - DownloadFile.Width) - 10
                                                       , (Screen.PrimaryScreen.WorkingArea.Height - DownloadFile.Height) - 10);
                DownloadFile.ShowDialog();
            }
            else if (sPathFile == "Error de Conexión")
            {
                FlatMessageBox.Show("Error de Conexón", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Error);
            }
            else if (string.IsNullOrEmpty(sPathFile))
            {
                FlatMessageBox.Show("No se encontro el archivo adjunto", "ACEPTAR", string.Empty, FlatMessageBoxIcon.Warning);
            }
        }