private void btnDeleteArea_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> item = new List<string>(); List<string> itemName = new List<string>(); if (areaControl.gridViewArea.RowCount.Equals(0)) { XtraMessageBox.Show("There is no area(s) to archive", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Archive " + areaControl.gridViewArea.SelectedRowsCount + " Area(s)", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < areaControl.gridViewArea.SelectedRowsCount; x++) { item.Add(areaControl.gridViewArea.GetRowCellValue(areaControl.gridViewArea.GetSelectedRows()[x], areaControl.gridColumnAreaID).ToString()); itemName.Add(areaControl.gridViewArea.GetRowCellValue(areaControl.gridViewArea.GetSelectedRows()[x], areaControl.gridColumnArea).ToString()); } frmDelete deleteArea = new frmDelete(item, itemName, log, "AREA", false, log); deleteArea.Show(); } } }
private void btnDeleteUser_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> UIDs = new List<string>(); if (gridViewUsers.RowCount.Equals(0)) { XtraMessageBox.Show("There is no user(s) to archive", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Archive " + gridViewUsers.SelectedRowsCount + " User(s)", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < gridViewUsers.SelectedRowsCount; x++) { UIDs.Add(gridViewUsers.GetRowCellValue(gridViewUsers.GetSelectedRows()[x], gridColumnUserID).ToString()); } frmDelete deleteUser = new frmDelete(UIDs, UIDs, string.Empty, "USER", false, ownerUID); deleteUser.Show(); } } }
private void btnDeleteCW_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 archive", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Archive " + cwControl.gridViewCW.SelectedRowsCount + " File(s)", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { 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()); } frmDelete deleteFile = new frmDelete(item, itemName, string.Empty, "CW", false, editorUID); deleteFile.Show(); } } }
private void btnDeleteMessages_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> item = new List<string>(); List<string> itemName = new List<string>(); if (gridViewMessage.RowCount.Equals(0)) { XtraMessageBox.Show("There is no message(s) to delete", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Delete " + gridViewMessage.SelectedRowsCount + " message(s)", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < gridViewMessage.SelectedRowsCount; x++) { item.Add(gridViewMessage.GetRowCellValue(gridViewMessage.GetSelectedRows()[x], gridColumnMsg_id).ToString()); itemName.Add(gridViewMessage.GetRowCellValue(gridViewMessage.GetSelectedRows()[x], gridColumnSubject).ToString()); } frmDelete delete = new frmDelete(item, itemName, uid, "MESSAGE", false, string.Empty); delete.ShowDialog(); } } }
private void btnDeleteSub_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> item = new List<string>(); List<string> itemName = new List<string>(); if (MySQLCommands.TestConnection()) { if (gridViewSubject.RowCount.Equals(0)) { XtraMessageBox.Show("There is no subject(s) to delete", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Archive " + gridViewSubject.SelectedRowsCount + " Subject(s)", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < gridViewSubject.SelectedRowsCount; x++) { item.Add(gridViewSubject.GetRowCellValue(gridViewSubject.GetSelectedRows()[x], gridColumnSID).ToString()); itemName.Add(gridViewSubject.GetRowCellValue(gridViewSubject.GetSelectedRows()[x], gridColumnSubject).ToString()); } frmDelete delete = new frmDelete(item, itemName, string.Empty, "SUBJECT", false, log); delete.ShowDialog(); } } } }
private void btnRemoveFile_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 remove", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { 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()); } frmDelete deleteAct = new frmDelete(fid,itemName,string.Empty,"ACTFILE",false,log); deleteAct.ShowDialog(); } }
private void btnDeleteActivity_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> act_id = new List<string>(); List<string> itemName = new List<string>(); if (activity.gridViewActivity.RowCount.Equals(0)) { XtraMessageBox.Show("There is no activity to delete", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Archive " + activity.gridViewActivity.SelectedRowsCount + " Activity", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < activity.gridViewActivity.SelectedRowsCount; x++) { act_id.Add(activity.gridViewActivity.GetRowCellValue(activity.gridViewActivity.GetSelectedRows()[x], activity.gridColumnAID).ToString()); itemName.Add(activity.gridViewActivity.GetRowCellValue(activity.gridViewActivity.GetSelectedRows()[x], activity.gridColumnActivityTitle).ToString()); } frmDelete delete = new frmDelete(act_id, itemName, string.Empty, "ACTIVITY", false, log); delete.Show(); } } }
private void btnRemoveStudent_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> UID = new List<string>(); List<string> CID = new List<string>(); if (userControl.gridViewUsers.RowCount.Equals(0)) { XtraMessageBox.Show("There is no student(s) to remove", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Remove " + userControl.gridViewUsers.SelectedRowsCount + " student(s)",MessageBoxButtons.YesNo,MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < userControl.gridViewUsers.SelectedRowsCount; x++) { UID.Add(userControl.gridViewUsers.GetRowCellValue(userControl.gridViewUsers.GetSelectedRows()[x], userControl.gridColumnUserID).ToString()); CID.Add(this.CID); } frmDelete remove = new frmDelete(UID, CID, string.Empty, "RFC", false, log); remove.Show(); } } }
private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> id = new List<string>(); List<string> itemName = new List<string>(); if (mode.Equals("FILE")) { if (fileBin.gridViewFiles.RowCount.Equals(0)) { XtraMessageBox.Show("There is no file(s) to delete", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Permanently delete " + fileBin.gridViewFiles.SelectedRowsCount + " File(s)", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < fileBin.gridViewFiles.SelectedRowsCount; x++) { id.Add(fileBin.gridViewFiles.GetRowCellValue(fileBin.gridViewFiles.GetSelectedRows()[x], fileBin.gridColumnFID).ToString()); itemName.Add(fileBin.gridViewFiles.GetRowCellValue(fileBin.gridViewFiles.GetSelectedRows()[x], fileBin.gridColumnFileName).ToString() + fileBin.gridViewFiles.GetRowCellValue(fileBin.gridViewFiles.GetSelectedRows()[x], fileBin.gridColumnFileExt).ToString()); } frmDelete deleteFile = new frmDelete(id, itemName, ownerUID, "FILE", true, ownerUID); deleteFile.Show(); } } } else if (mode.Equals("CW")) { if (cwBin.gridViewCW.RowCount.Equals(0)) { XtraMessageBox.Show("There is no file(s) to delete", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Permanently delete " + cwBin.gridViewCW.SelectedRowsCount + " File(s)", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < cwBin.gridViewCW.SelectedRowsCount; x++) { id.Add(cwBin.gridViewCW.GetRowCellValue(cwBin.gridViewCW.GetSelectedRows()[x], cwBin.gridColumnPDFID).ToString()); itemName.Add(cwBin.gridViewCW.GetRowCellValue(cwBin.gridViewCW.GetSelectedRows()[x], cwBin.gridColumnCWName).ToString()); } frmDelete deleteFile = new frmDelete(id, itemName, ownerUID, "CW", true, ownerUID); deleteFile.Show(); } } } }
private void btnDeleteClass_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> CID = new List<string>(); List<string> itemName = new List<string>(); if (gridViewClass.RowCount.Equals(0)) { XtraMessageBox.Show("There is no class(es) to archive", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Archive " + gridViewClass.SelectedRowsCount + " Class(es)", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < gridViewClass.SelectedRowsCount; x++) { CID.Add(gridViewClass.GetRowCellValue(gridViewClass.GetSelectedRows()[x], gridColumnCID).ToString()); itemName.Add(gridViewClass.GetRowCellValue(gridViewClass.GetSelectedRows()[x], gridColumnClassName).ToString()); } frmDelete deleteFile = new frmDelete(CID, itemName, ownerUID, "CLASS", false, ownerUID); deleteFile.Show(); } } }
private void btnDeleteFile_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { List<string> FID = new List<string>(); List<string> itemName = new List<string>(); if (fileControl.gridViewFiles.RowCount.Equals(0)) { XtraMessageBox.Show("There is no file(s) to archive", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (XtraMessageBox.Show("Do you wish to continue ?", "Archive " + fileControl.gridViewFiles.SelectedRowsCount + " File(s)", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.Yes)) { for (int x = 0; x < fileControl.gridViewFiles.SelectedRowsCount; x++) { FID.Add(fileControl.gridViewFiles.GetRowCellValue(fileControl.gridViewFiles.GetSelectedRows()[x], fileControl.gridColumnFID).ToString()); itemName.Add(fileControl.gridViewFiles.GetRowCellValue(fileControl.gridViewFiles.GetSelectedRows()[x], fileControl.gridColumnFileName).ToString() + fileControl.gridViewFiles.GetRowCellValue(fileControl.gridViewFiles.GetSelectedRows()[x], fileControl.gridColumnFileExt).ToString()); } frmDelete deleteFile = new frmDelete(FID, itemName, string.Empty, "FILE", false, uid); deleteFile.Show(); } } }