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 btnInsert_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtDocumentType.Text) == false)
            {
                if (DocumentsStoredDepartmentService.VerifyDepartmentEquals(txtDocumentType.Text.TrimEnd().Replace(" ", "_").Replace(",", "_")))
                {
                    // MessageBox.Show("This Department Exists!", "Attention!", MessageBoxButtons.OK, MessageBoxIcon.Warning)
                    My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("This Department Exists!", "Attention!", this);
                    return;
                }
            }
            else
            {
                // MessageBox.Show("Field is empty!", "Attention!", MessageBoxButtons.OK, MessageBoxIcon.Warning)
                My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Field is empty!", "Attention!", this);
                return;
            }

            if (ftpser.CreateFolder(txtDocumentType.Text.Replace(" ", "_").Replace(",", "_")))
            {
                if (DocumentsStoredDepartmentService.Insert(txtDocumentType.Text.Replace(" ", "_").Replace(",", "_")))
                {
                    My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Department successfully inserted!", "Success!", this);
                    My.MyProject.Forms.frmAddEditStoreFiles.LoadDepartment(DocumentsStoredDepartmentService.GetLastId());
                    DocumentsStoredUserDepartmentService.Insert(DocumentsStoredDepartmentService.GetLastId(), 163);
                    DocumentsStoredUserDepartmentService.Insert(DocumentsStoredDepartmentService.GetLastId(), 124);
                    DocumentsStoredUserDepartmentService.Insert(DocumentsStoredDepartmentService.GetLastId(), 63);
                    Close();
                }
                else
                {
                    My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("It was not possible to create this Department! Contact IT Department.", "Error!", this);
                    ftpser.DeleteSFTPFolder("/documentstorage/" + txtDocumentType.Text.Replace(" ", "_").Replace(",", "_"));
                }
            }
            else
            {
                My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("It was not possible to create this Department! If necessary Contact IT Department.", "Error!", this);
            }
        }
Exemple #3
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);
        }