Exemple #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int DepId  = Conversions.ToInteger(dgvEmployees.CurrentRow.Cells[9].Value);
            int IdUser = My.MyProject.Forms.FrmLoginWindow._userID;

            if (DocumentsStoredUserDepartmentService.VerifySecurityDepartmentUser(DepId, IdUser) == false)
            {
                My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Viewing a document restricted to the department." + Constants.vbCrLf + "If you need access, contact the IT department.!", "Restricted access", this);
                return;
            }

            int    DocId      = Conversions.ToInteger(dgvEmployees.CurrentRow.Cells[0].Value);
            string FileOrigin = dgvEmployees.CurrentRow.Cells[6].Value.ToString();
            var    result     = My.MyProject.Forms.MessageBoxCeresYesNo.ShowDialog("Delete this document ?", "Are you sure you want to delete this document ID #" + DocId.ToString(), My.Resources.Resources.caution, this);

            if (result == DialogResult.Yes)
            {
                if (ftpser.DeleteSFTPFile(FileOrigin))
                {
                    if (DocumentsStoredService.Delete(DocId))
                    {
                        My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Document deleted successfully!", "Message", this);
                        SearchDocs();
                    }
                    else
                    {
                        My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Check if you are using WTC VPN or if your computer is connected to the WTC Network." + Constants.vbCrLf + "If this error persists, contact the IT Department!", "Error Message", this);
                    }
                }
                else
                {
                    My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Check if you are using WTC VPN or if your computer is connected to the WTC Network." + Constants.vbCrLf + "If this error persists, contact the IT Department!", "Error Message", this);
                }
            }
        }
Exemple #2
0
        private void dgvEmployees_DoubleClick(object sender, EventArgs e)
        {
            int DepId  = Conversions.ToInteger(dgvEmployees.CurrentRow.Cells[9].Value);
            int IdUser = My.MyProject.Forms.FrmLoginWindow._userID;

            if (DocumentsStoredUserDepartmentService.VerifySecurityDepartmentUser(DepId, IdUser) == false)
            {
                MessageBox.Show("Viewing a document restricted to the department." + Constants.vbCrLf + "If you need access, contact the IT department.!", "Restricted access", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            // ftp_fileName = ReturnFileName()
            string FileName = ReturnFileName();
            // ftp_root = ReturnFile()
            string FTPDirFile = ReturnFile();

            //TODO

            // My.MyProject.Forms.frmLoadingPDF.ftpfileName = FileName;
            //  My.MyProject.Forms.frmLoadingPDF.ftpDirFileName = FTPDirFile;
            //   MdlLoadingSetting.showDialogForm(My.MyProject.Forms.frmLoadingPDF, this);
        }