コード例 #1
0
        private void btnDownloadCW_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            List<string> item = new List<string>();
            List<string> itemName = new List<string>();

            if (cwControl.gridViewCW.RowCount.Equals(0))
            {
                XtraMessageBox.Show("There is no file(s) to download", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {

                if (folderBrowserDialogCW.ShowDialog().Equals(DialogResult.OK))
                {
                    string dir = folderBrowserDialogCW.SelectedPath;

                    for (int x = 0; x < cwControl.gridViewCW.SelectedRowsCount; x++)
                    {
                        item.Add(cwControl.gridViewCW.GetRowCellValue(cwControl.gridViewCW.GetSelectedRows()[x], cwControl.gridColumnPDFID).ToString());
                        itemName.Add(cwControl.gridViewCW.GetRowCellValue(cwControl.gridViewCW.GetSelectedRows()[x], cwControl.gridColumnCWName).ToString());
                    }
                    frmDownload downloadFiles = new frmDownload(item, itemName, dir, "CW", string.Empty);
                    downloadFiles.Show();
                }
            }
        }
コード例 #2
0
        private void btnOpenCW_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            List<string> item = new List<string>();
            List<string> itemName = new List<string>();

            if (cwControl.gridViewCW.RowCount.Equals(0))
            {
                XtraMessageBox.Show("There is no file(s) to open", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {

                Random randomNum = new Random();
                string dir = Path.GetTempPath() + "CD" + randomNum.Next(1000, 5000);
                Directory.CreateDirectory(dir);

                for (int x = 0; x < cwControl.gridViewCW.SelectedRowsCount; x++)
                {
                    item.Add(cwControl.gridViewCW.GetRowCellValue(cwControl.gridViewCW.GetSelectedRows()[x], cwControl.gridColumnPDFID).ToString());
                    itemName.Add(cwControl.gridViewCW.GetRowCellValue(cwControl.gridViewCW.GetSelectedRows()[x], cwControl.gridColumnCWName).ToString());
                }
                frmDownload downloadFiles = new frmDownload(item, itemName, dir, "VPDF", string.Empty);
                downloadFiles.Show();
            }
        }
コード例 #3
0
ファイル: frmFiles.cs プロジェクト: garciagars/ComDriveSW
        private void btnDownload_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            List<string> item = new List<string>();
            List<string> itemName = new List<string>();

            if (gridViewFiles.RowCount.Equals(0))
            {
                XtraMessageBox.Show("There is no file(s) to download", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {

                if (folderBrowserDialogMain.ShowDialog().Equals(DialogResult.OK))
                {
                    string dir = folderBrowserDialogMain.SelectedPath;

                    for (int x = 0; x < gridViewFiles.SelectedRowsCount; x++)
                    {
                        string id = gridViewFiles.GetRowCellValue(gridViewFiles.GetSelectedRows()[x], gridColumnFID).ToString();
                        string fileName = gridViewFiles.GetRowCellValue(gridViewFiles.GetSelectedRows()[x], gridColumnFileName).ToString();
                        string ext = gridViewFiles.GetRowCellValue(gridViewFiles.GetSelectedRows()[x], gridColumnFileExt).ToString();

                        item.Add(id);
                        itemName.Add(fileName + ext);
                    }
                    frmDownload downloadFiles = new frmDownload(item, itemName, dir, "FILE",ownerUID);
                    downloadFiles.Show();
                }
            }
        }