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 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(); } }
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(); } } }
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(); } } }
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(); } } }