private void btnDownload_Click(object sender, EventArgs e) { List<string> fid = 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 (folderBrowserDialog.ShowDialog().Equals(DialogResult.OK)) { string dir = folderBrowserDialog.SelectedPath; for (int x = 0; x < gridViewFiles.SelectedRowsCount; x++) { fid.Add(gridViewFiles.GetRowCellValue(gridViewFiles.GetSelectedRows()[x], gridColumnFID).ToString()); itemName.Add(gridViewFiles.GetRowCellValue(gridViewFiles.GetSelectedRows()[x], gridColumnFileName).ToString()); } frmDownload downloadFile = new frmDownload(fid, itemName, dir, "ACTRESPOND", string.Empty); downloadFile.ShowDialog(); } } }
private void btnBatchDL_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> item = new List<string>(); List<string> itemName = new List<string>(); if (userControl.gridViewUsers.RowCount.Equals(0)) { XtraMessageBox.Show("There is no student(s)", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { for (int x = 0; x < userControl.gridViewUsers.SelectedRowsCount; x++) { item.Add(userControl.gridViewUsers.GetRowCellValue(userControl.gridViewUsers.GetSelectedRows()[x], userControl.gridColumnUserID).ToString()); itemName.Add((userControl.gridViewUsers.GetRowCellValue(userControl.gridViewUsers.GetSelectedRows()[x], userControl.gridColumnUserfName).ToString()) + " " + (userControl.gridViewUsers.GetRowCellValue(userControl.gridViewUsers.GetSelectedRows()[x], userControl.gridColumnUsermName).ToString() + " " + (userControl.gridViewUsers.GetRowCellValue(userControl.gridViewUsers.GetSelectedRows()[x], userControl.gridColumnUserlName).ToString()))); } List<string> fileName = new List<string>(); if (saveFileDialogBatch.ShowDialog().Equals(DialogResult.OK)) { string dir = Path.GetDirectoryName(saveFileDialogBatch.FileName); fileName.Add(Path.GetFileName(saveFileDialogBatch.FileName)); frmDownload download = new frmDownload(item, itemName, fileName, dir, "BATCH",classArea); download.ShowDialog(); } } }